cancel
Showing results for 
Search instead for 
Did you mean: 

stm32g070, some custom boards start, others do not

nielsbraspenning
Associate II

Hi,

We have some problems with booting a mcu (stm32g070), we have custom hardware.

i can generate a mxcube project that works fine, every time a power the mcu on the custom hardware. this works on
all pieces which we have produced

We created a project (the purpose of the hardware) and this works fine on one example of the custom hardware

On a other piece, it seems the mcu is not starting executing code. i am not sure if it just won't start or is locked-up.

I think that something in the project is causing this, and i have bypassed basically all code. so only the init's are left and the blinking of a led

13 REPLIES 13
TDK
Guru

Attach a debugger, debug the code, step through it to understand where and why it's failing. Perhaps in the clock initialization.

If you feel a post has answered your question, please click "Accept as Solution".
BarryWhit
Senior III

Might also be BOOT0 pin left floating by mistake. So random parasitics on each board decide if the board goes into bootloader or jumps to user code.

- If a post has answered your question, please acknowledge the help you received by clicking "Accept as Solution".
- Once you've solved your issue, please consider posting a summary of any additional details you've learned. Your new knowledge may help others in the future.

Get better instrumentation and determine the point of failure.

Have Error_Handler() report the line and source file that calls there to die silently.

Have a HardFault_Handler() that reports actionable data.

Use LEDs or GPIOs to signal different states, and check-points if you lack a viable serial channel to communicate outwardly with.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
BarryWhit
Senior III

Each person has their own approach to debugging. A very quick sanity check to see what's going on is to connect via SWD using STM32CubeProgammer and use the CPU pane see what the value of PC is. That tells you if you're in the bootloader or user code. If in user-code you can use the CubeIDE Build analyzer to see what function you're in, but then your next step is to start a debug session anyway.

- If a post has answered your question, please acknowledge the help you received by clicking "Accept as Solution".
- Once you've solved your issue, please consider posting a summary of any additional details you've learned. Your new knowledge may help others in the future.

Indeed, but most of these "Don't Run" complaints DO RUN, just not what/how is wanted.

The ability to debug and diagnose will depend a lot on what methods of communication and connectivity have been provided for.

One of the issues with STM32's is there's frequently no outward indication for signs-of-life, so you either have to create those yourself, early, and not a million instructions deep, or drop it into the ROM code, and tickle it per AN2606 and observe responses.

Might take a dozen, or two, machine instructions in Reset_Handler() to configure and set a GPIO, or squawk from a UART. Tedious to do on a custom board, when you're annoyed, for sure, but still probably easier than matching the spin on a falling space station to dock with it.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Space station? can you share a good story? ))

 

 

> but still probably easier than matching the spin on a falling space station to dock with it.

Sure, and now that spin is increasingly AI-generated it seems even more hopeless... 😉

 

- If a post has answered your question, please acknowledge the help you received by clicking "Accept as Solution".
- Once you've solved your issue, please consider posting a summary of any additional details you've learned. Your new knowledge may help others in the future.
nielsbraspenning
Associate II

Hi,

Thanks for the fast responses,

i have the ability to turn led's on and or put text to a terminal, however is mentioned it seem(s) the problem
happen before that point

i have a intresting conclusion, but not a solution yet.

I created a new project with only a gpio (it is connected to a led) and minimal configuration with stmcubeide, with the graphical tool (in the past it was called mxcube)

this project works and show a blinky led

from there on a copied as much settings until it has the same behiaviour as the "broken" project.

i use PA6 as output in the broken project, when i reset this to its reset state, the mcu start reliable and start executing the code.

So now i have to check why PA6 has this behaviour

thanks,

no this is not the case, i setup the option bytes that it ignores the pin and uses the option bytes settings.

Besides that i am able to generate a stm32mxcudeide project that works fine