2020-11-23 01:42 AM
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?
2020-11-23 02:40 AM
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 :)
2020-11-23 07:51 AM
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
2020-11-23 08:47 AM
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
2020-11-23 10:07 AM
Power supply by the programmer, partially?
2020-11-24 01:15 AM
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
2020-11-24 01:30 AM
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
2020-11-24 01:44 AM
exactly, it seems to be the reset pin and it starts if i just connect it momentarily. should i use a pull-down resistor?
2020-11-24 02:02 AM
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
2020-11-24 02:18 AM
ahhhhhhh thankyou that seems to have sorted it