2021-06-23 03:19 PM
Using STM32CubeIde 1.6.0.
Using ST-LINK on NUCLEO-l4r5zi for debug.
Any suggestions for fixes or how to debug this?
2021-06-28 02:54 PM
Additional information - the attache ZIP file contains a STM32CubeIdo project that demonstrates my problem on a NUCLEO-L4R5ZI board.
When GOOD_CODE is defined in main.c the program runs normally with output redirected to LP1UART (vcom on NUCLEO ST-Link).
When GOOD_CODE is not defined then program locks up during USB initialization at system memory address 0x1fff6d2. No output on serial port.
I have not been able to determine how it gets there.
Any suggestions for tracking this down?
2021-06-29 01:21 PM
Problem solved.
For some reason the bad code was causing the 0x0 address region to be remapped to system memory.
This results in the vector table being mapped to the ROM boot loader vector table and the first systick interrupt goes off to system memory forever.
The NUCLEO brd has BOOT0 pin pulled down through 10K; should always map 0x0 to FLASH unless FLASH is erased.
I fixed the issue by changing the option bits to ignore BOOT0 pin and always boot from FLASH.
This is a work-around, but it lets me move forward,
I check the L4R5 errata and didn't see anything regarding this.
I would still like a real explanation for why this was happening.