Creating basic program with STM32CubeMX for STM32G030F6P6 without any changes results in code executing with no source code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-01 9:06 AM
I created a project with STM32MXCube for the STM32G030F6P6. No changes to the settings. Generate code, run it in STM32CubeIDE in the debugger (STLINK). No changes to the generated code. It stops at main. If I single step it gets to the while(1) loop. If I hit run, and then pause, but PC is somewhere there is no source code.
Call stack displays Thread #1 [main] 1 [core:0 ] (Suspended : Signal : SIGINT:Interrupt)
then lists
0x1fff12c6
0x1fff1176
I have no clue how the CPU gets there. I am just trying to start with something that works before I add one line of code. Any suggestions? I wish there was a WORKING example for this value line CPU.
Solved! Go to Solution.
- Labels:
-
STM32CubeMX
-
STM32G0 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-01 11:45 AM
Maybe related to the AN2606 Pattern 11 bootloader/PEMPTY mechanism. In debugger, check if user flash or system memory is mapped at 0x0000'0000, and/or check SYSCFG_CFGR1.MEM_MODE.
Try power cycling the target; or if that won't help, try to set bits in Option bytes so that bootloader is never entered. I don't use the 'G0 so don't know the specifics.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-01 9:15 AM
It's in system memory. Maybe it reset due to IWDG or similar. Check option bytes.
Custom board? Is BOOT0 held low?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-01 9:20 AM
Ok, if I don't enable the sys tick by adding the following code, the interrupt is apparently unhandled. Nice out of the box behavior.
/* USER CODE BEGIN 4 */
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
{
return HAL_OK;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-01 9:21 AM
Generate IRQ handler is checked for Time base: System tick timer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-01 9:26 AM
HAL_InitTick isn't an interrupt handler, and it's defined in the HAL library. Shouldn't need to mess with or redefine/override it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-01 9:29 AM
I have no idea why SysTick_Handler() is not being called and the code goes in some location with no source code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-01 11:45 AM
Maybe related to the AN2606 Pattern 11 bootloader/PEMPTY mechanism. In debugger, check if user flash or system memory is mapped at 0x0000'0000, and/or check SYSCFG_CFGR1.MEM_MODE.
Try power cycling the target; or if that won't help, try to set bits in Option bytes so that bootloader is never entered. I don't use the 'G0 so don't know the specifics.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-05-01 7:53 PM
Wow! A power cycle did it for the STM32G030 as well. I remember I erased the whole part when I pulled the DEV board out of the draw to use. Thanks everyone for your responses.
