Skip to main content
RLour.1
Associate II
May 1, 2022
Solved

Creating basic program with STM32CubeMX for STM32G030F6P6 without any changes results in code executing with no source code

  • May 1, 2022
  • 7 replies
  • 2929 views

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.

This topic has been closed for replies.
Best answer by waclawek.jan

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.

https://community.st.com/s/question/0D53W00000raYd2SAE/intermittent-break-at-address-0x1fff51f4-with-no-debug

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

7 replies

TDK
May 1, 2022

It's in system memory. Maybe it reset due to IWDG or similar. Check option bytes.

Custom board? Is BOOT0 held low?

"If you feel a post has answered your question, please click ""Accept as Solution""."
RLour.1
RLour.1Author
Associate II
May 1, 2022

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;
}

TDK
May 1, 2022

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.

"If you feel a post has answered your question, please click ""Accept as Solution""."
RLour.1
RLour.1Author
Associate II
May 1, 2022

Generate IRQ handler is checked for Time base: System tick timer.

RLour.1
RLour.1Author
Associate II
May 1, 2022

I have no idea why SysTick_Handler() is not being called and the code goes in some location with no source code.

waclawek.jan
waclawek.janBest answer
Super User
May 1, 2022

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.

https://community.st.com/s/question/0D53W00000raYd2SAE/intermittent-break-at-address-0x1fff51f4-with-no-debug

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

RLour.1
RLour.1Author
Associate II
May 2, 2022

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.