cancel
Showing results for 
Search instead for 
Did you mean: 

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

RLour.1
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

7 REPLIES 7
TDK
Guru

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
Associate II

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

RLour.1
Associate II

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

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
Associate II

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

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
Associate II

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.