workinkg-par-runner-and-added-debug-attach

pull/1/head
Piotr Lewandowski 2023-06-26 23:55:38 +02:00
rodzic e4d8ba430b
commit 54d683c793
6 zmienionych plików z 51 dodań i 14 usunięć

26
.vscode/launch.json vendored
Wyświetl plik

@ -13,10 +13,6 @@
"interface/cmsis-dap.cfg",
"./openocd_scripts/dp32g030.cfg" // "target/swm050.cfg", //
],
// "openOCDLaunchCommands": [
// "write_image ./build/src/par_runner/par_runner.bin 0",
// "reset halt"
// ],
"searchDir": [
".",
"${workspaceRoot}",
@ -26,5 +22,27 @@
"showDevDebugOutput": "both",
"preLaunchTask": "flash firmware"
},
{
"svdFile": "./.vscode/stm32g030.svd",
"cwd": "${workspaceRoot}",
"executable": "./build/src/par_runner/par_runner",
"name": "attach kwaczek",
"request": "attach",
"type": "cortex-debug",
"servertype": "openocd",
"configFiles": [
"interface/cmsis-dap.cfg",
"./openocd_scripts/dp32g030.cfg" // "target/swm050.cfg", //
],
"openOCDLaunchCommands": [
"reset halt",
],
"searchDir": [
".",
"${workspaceRoot}",
"${workspaceRoot}/.vscode/",
],
"showDevDebugOutput": "both",
},
]
}

2
.vscode/tasks.json vendored
Wyświetl plik

@ -4,7 +4,7 @@
{
"label": "flash firmware",
"type": "shell",
"command": "openocd -f interface/cmsis-dap.cfg -f ./openocd_scripts/dp32g030.cfg -c 'reset halt' -c 'write_image ./build/src/par_runner/par_runner.bin 0' -c 'shutdown'",
"command": "openocd -f interface/cmsis-dap.cfg -f ./openocd_scripts/dp32g030.cfg -c 'reset halt' -c 'write_image ./build/src/par_runner/par_runner_with_bootloader.bin 0' -c 'shutdown'",
"presentation": {
"reveal": "always",
"panel": "shared"

Wyświetl plik

@ -1,5 +1,5 @@
transport select swd
adapter speed 300
adapter speed 8000
reset_config srst_only srst_nogate connect_assert_srst
set _CHIP_NAME DP32G0xx

Wyświetl plik

@ -12,9 +12,7 @@ int main()
return 0;
}
__attribute__ ((interrupt)) void MultiIrq_Handler(unsigned int u32IrqSource)
void MultiIrq_Handler(unsigned int u32IrqSource)
{
Hw.Power.EnableDbg();
__BKPT();
while(1);
GPIOC->DATA ^= 1 << 3;
}

Wyświetl plik

@ -17,7 +17,7 @@ struct TFlash
#define FLASH_BASE 0x4006F000
#define FLASH ((TFlash*)FLASH_BASAE)
struct TGpio
struct TPort
{
unsigned int PORTA_SEL0;
unsigned int PORTA_SEL1;
@ -28,8 +28,29 @@ struct TGpio
unsigned int PORTA_IE;
unsigned int PORTB_IE;
unsigned int PORTC_IE;
unsigned int PORTA_PU;
unsigned int PORTB_PU;
unsigned int PORTC_PU;
unsigned int PORTA_PD;
unsigned int PORTB_PD;
unsigned int PORTC_PD;
unsigned int PORTA_OD;
unsigned int PORTB_OD;
unsigned int PORTC_OD;
unsigned int PORTA_WKE;
unsigned int PORTB_WKE;
unsigned int PORTC_WKE;
unsigned int PORT_CFG;
};
struct TGpio
{
unsigned int DATA;
};
#define GPIO_BASE 0x400B0000
#define GPIO ((TGpio*)GPIO_BASE)
#define __BKPT(value) __asm volatile ("bkpt "#value)
#define GPIO ((TPort*)GPIO_BASE)
#define __BKPT(value) __asm volatile ("bkpt "#value)
#define GPIOC_BASE 0x40061000
#define GPIOC ((TGpio*)GPIOC_BASE)

Wyświetl plik

@ -15,7 +15,7 @@ __attribute__ ((interrupt)) static void CommonIrqWrapper()
MultiIrq_Handler(VectorNr);
if (pOrgVectors->Vectors[VectorNr])
{
// pOrgVectors->Vectors[VectorNr]();
pOrgVectors->Vectors[VectorNr]();
}
}