cancel
Showing results for 
Search instead for 
Did you mean: 

How to program final 'release version' of code?

deep_rune
Associate III

I've been programming my chips via the debug mode in STM32cubeIDE, but the code doesn't seem to run properly when the debugger isn't connected. What is the correct way to program a 'final release' version of my code, that will run independently every time the chip turns on?

9 REPLIES 9
KnarfB
Principal III

ideally, there should be no differences betwenn debug and release mode. What are your observations?

And,its not uncommon to ship a debug configuration of the code to be sure that late bugs can be traced accordingly.

Finally: there will never be a final version 🙂

deep_rune
Associate III

the LEDs (controlled by PWM on the timers) light up, but the main program does nothing - the program runs on interrupts and there seems to be no interrupts. The main loop seems to run as there is an LED indicator which lights up in the main loop, but there is no signal on the external I2C DAC.

If i just connect the programmer (without turning it on) everything starts working fine

Very odd. Is this a custom board? Did you pull BOOT0 low?

Or it could be that your code is running, and ended up in the HardFault_Handler() or Error_Handler(), or perhaps there is a GPIO clock initialization missing.

Code loaded at 0x08000000 should run out of boot/power-up

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

Power supply by the programmer, partially?

It's a custom board with an STM32L412C8T6, the Boot0 is pulled low.

the chip runs of a 3.3V regulator but the connector only needs to be connected momentarily - as in, if I just *touch* the programmer to the header and pull it off again the program starts working fine

Danish1
Lead II

Do you have anything on your board to ensure that Reset is held low as power comes up?

It isn't always necessary but can help, particularly if Vdd rises slowly.

Does it start if you don't connect the full debugger but just momentarily pull Reset down and then release it?

Hope this helps,

Danish

exactly, it seems to be the reset pin and it starts if i just connect it momentarily. should i use a pull-down resistor?

The ref. designs use only a 100nF C to gnd, see AN4555 Application note "Getting started with STM32L4 Series and STM32L4+ Series hardware development"

KnarfB

ahhhhhhh thankyou that seems to have sorted it