2021-08-06 05:44 AM
I'm currently testing the UART bootloader on a NUCLEO-L496ZG-P, the bootloader itself works fine and i've written a python script which can upload .bin files to the controller.
The problemi'm having is that the product will need Readout Protection in the end, but when i'm uploading a programm and afterwards send the Readout Protect command ( 0x82 + checksum ) and than pull the jumper from boot0 (currently it's a jumper, but will be handled otherwise later on) and reset the controller it doesn't boot into the user application, but instead into an undefined(??) state which is neither bootloader nor user application (none of the user LEDs are on or blinking (my user app currently is only blinking LEDs) and it's also not responding to any of the commands from the bootloader command set). Only when going through a power cycle the chip will boot into the user application.
So i guess my question is, is this intended? Is there any way to get into the user application without going through a power cycle?
2021-08-06 06:55 AM
The Readout Protect command generates a system reset.
You could attach a debugger to find out where the CPU is after this command. Likely it's executing code somewhere.
Another option would be to check and set RDP at the beginning of your program rather than via the bootloader.
2021-08-06 06:57 AM
according to AN3155 (page 32, note 2) the readout protect command will only generate a system reset on some controllers, but not on the L496.
2021-08-06 07:03 AM
I was looking at an older version which didn't have that note.
Seems like if it responds to the "go" command, it's still in the bootloader after that, and the "go" command probably works. I would attach a debugger.
2021-08-06 07:06 AM
Problem is the go command is also not available in Readout protected mode (same application note page 7). I'll try attaching a debugger, although idk yet how i can get a debugger to listen to the bootloader.