AnsweredAssumed Answered

Unable to erase flash STM32L05 using bootloader via SPI cmds

Question asked by Danny on Nov 19, 2015
Latest reply on Nov 24, 2015 by Amel N

The AN4286.pdf SPI Bootloader application note specifies two different commands for erasing flash. On page 24 it specifies 0x44 with checksum 0xBB. However, on page 25 the datasheet specifies 0x43 with a checksum of 0xBC. Which is the proper command to erase flash? I'm communicating with a STM32L05 with bootloader version 1.1. 

After doing some testing I'm only able to receive a ACK back when using the command 0x44 with checksum 0xBB. Might want to update the documentation.

Byte Structure sent to SMT32L05 for erase command: [0x5A,0x44, 0xBB] 

This brings me to the next issue. After receiving the ACK back for the command erase, I send it a special 3 byte special erase command 0xFF 0xFF with the checksum 0x00. This immediately returns a NACK. I have verified using a logic analyzer that the packets are correctly being sent. I would expect to wait a bit for an ACK (up to 100ms) and not receive an NACK. 

Byte Structure sent to SMT32L05 for special erase: [0xFF,0xFF, 0x00] 

Thoughts?

Thank You!

Side Note: I'm able to successfully write a program to flash and execute it. I just cannot seem to erase flash using the global erase. I didn't see any mention of this issue in the errata. 

Outcomes