2020-07-14 01:41 PM
I am facing a problem after I finish the debug session. Once I try to reset the cpu via the reset button or manually resetting the CPU via the ST-Link Utility the program does not start. The only way to start the program again is to click agian the debug option which reuploads the firmware to the MCU (STM32L431KB) and starts the gdb server via st-link.
Further information
When using the ST-Link utility and go to the Target>MCU Core.. option., I click the "System Reset" and the "Core State" is displayed as "Lockup".
Debug Setup
ST-LINK FW : V2J36M26
Connect mode: Under Reset
Reset mode : Hardware reset
STM32CubeProgrammer v2.4.0
GDB server. Version 5.5.0
2020-07-14 03:04 PM
Custom board? Is BOOT0 pulled down?
2020-07-14 08:19 PM
if your code doesn t have stop modes, try sw reset by swd. also if you disconnect stlink, check if using stlink rx pullup or mco clock.
2020-07-14 09:00 PM
BOOT0 state is one potential issue. Having NRST driven high by a push-pull driver can be another.
Code also might actually be starting, check it is not dying in ErrorHandler(), HardFault_Handler(), or some other while(1) loop
2020-07-15 02:21 AM
Yes I have the MCU pin Boot0 pulled down. I was able to debug and reset the CPU without a problem. I changed from Atollic 9.3 to STCMCube IDE and updated the ST-Link firmware and now this is happening.
2020-07-15 03:39 AM
I made a new project and it works as expected. The only difference is that in my project I have modified the Flash Address in the linker script as
FLASH (rx) : ORIGIN = 0x8008000, LENGTH = 94K
And the "system_stm32l4xx.c" file with
#define VECT_TAB_OFFSET 0x8000
I suspect that the MCU does not start at address 0x8008000 when resetting. I had this working with atollic but when migrating to STM32Cubeide this has for some reasone caused a problem.
2020-07-15 04:39 AM
Yes the processor isn't going to start from there, you'd need a boot loader at 0x08000000 to transfer control elsewhere.
2020-07-15 04:43 AM
Ok I will have to check if the bootloader is working. Now that I think about it .... it might have been that I erased the chip completely so the bootloader is gone...
2020-07-15 05:41 AM
Ok I have just reflashed the bootloader I had and now I can reset the MCU. thanks a lot!