Can't get my STM32L496AG13 to run
I have a stm32L496AG13 on a custom Board
Running code that was tested on a development board, in debug mode, the code crashed at random places during HAL init
I worte a new program using STEMCubeIDE version 1.12.0 and put in a simple program:
while (counter1 <= 3)
{
counter1++;
}
Everything else is default as the IDE built it.
I can step through main and then it goes to LoopForever() in startup_stm32l496agix.s
But when I try to run full speed it crashes.
I note the reset pin NRST# is asserted for about 30 us when it crashes and I think It's being asserted by the stm32L496AG13.
Looking at the CSR register, I see that it's 1C00 0600 before the crash and 1C00 0610 after.
I have a couple of questions about this:
1) The manual for the MCU says the reset value for this CSR register should be 0C00 0600, but it's not, indicating a software reset (1C000600).
But this register is like this from the very beginning and if I step through main and then let it run it stays that way (1C000600) and the chip never resets
2) Why would the reset value indicate Brownout and Pin resets(0C00 0600)? and why would they stay set?
3) Why is the LSI only becoming ready after the chip is reset? (1C00 0610)
I'm reading the CSR register by looking at the FSR tab and toggling live update.
I'm using the SWD debugger at 140 kHz with SWW disabled and logging to file, using an STLink V3 set with a ribbon cable interface
I'm just trying to find out why the board is resetting.
