cancel
Showing results for 
Search instead for 
Did you mean: 

STM8AF Bootloader CAN write memory.

MR.9
Associate

I'm trying to write a program to the microcontroller through the bootloader via the СAN interface.

  1. First I pass message ID 0x7f to activate bootloader. (ID=0x02, data=0x79)
  2. Then I transfer the file "E_W_ROUTINEs_128K_ver_2.0.s19" in binary form to address 0x000000A0 to enable write and erase commands. I transfer in blocks of 128 bytes. After transferring each block, I transmit the checksum and receive a positive response from the bootloader (ID=0x02, data=0x79)
  3. Then I send a command (ID 0x43) to erase all FLASH memory and EEPROM and specify 0xFF in the first byte. (I get 2 positive answers 0x79)
  4. Then I try to transfer the file of the new program to address 0x00008000 in the same way as the file "E_W_ROUTINEs_128K_ver_2.0", but after sending the first block of 128 bytes with a checksum, the bootloader does not respond.

I cannot understand why the bootloader does not respond to an attempt to write to address 0x00008000. When a command with the ID 0x31 is sent with the address and the number of bytes, a positive response is received from the bootloader (ID=0x02, data=0x79). But after sending the first block of data (128 bytes) the bootloader does not respond..

1 ACCEPTED SOLUTION

Accepted Solutions
MR.9
Associate

Solved a problem.

There was an error in the algorithm for writing to the microcontroller's memory.

View solution in original post

1 REPLY 1
MR.9
Associate

Solved a problem.

There was an error in the algorithm for writing to the microcontroller's memory.