Author Topic: STM32 Bootloader read memory command fails  (Read 1813 times)

0 Members and 1 Guest are viewing this topic.

Offline ElectronicJunkyTopic starter

  • Newbie
  • Posts: 1
  • Country: in
STM32 Bootloader read memory command fails
« on: June 13, 2017, 08:27:34 am »
I'm using an STM32F103 and flashing a code into it using the bootloader. I'm successful in writing the code into the MCU, but when I try reading it using the Read Memory command (pg13) [AN3155] it fails at step 6 (Send the number of bytes to be read (1 byte) & a checksum (1 byte).)  I receive a NACK. It's confusing here, so I tried sending both XOR of 8th byte with 0 and in the next try tried sending complement of 8th byte, both failed.
Here's what I'm doing:
1. Read 128 byte of the file to be written from SD card
2. Write this 128 bytes into the STM32 flash (code space) through the boot loader //works perfectly fine
3. Read back the recently written 128 bytes to verify if the write was successful.
4. If data written == read, move on. Write the next set of data.
5. Loop till the whole file has been written.
6. Send GO command and reset the STM.

Does anyone with experience in STM32 bootloaders who can help me understand what I'm doing wrong?
 
P.S. I know the write command is working because previously I only had the write command, and it was working in the field. But some devices were flashed with the wrong/ corrupted code. So I'm reading back and checking if the data were written is the right one.

[AN3155] - http://www.st.com/content/ccc/resource/technical/document/application_note/51/5f/03/1e/bd/9b/45/be/CD00264342.pdf/files/CD00264342.pdf/jcr:content/translations/en.CD00264342.pdf
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf