cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F105 flash programming through CAN

JBizo.1
Associate

I have an application where I must be able to update the code remotely through the CAN2 link and the embedded bootloader. This worked fine using the mass erase function, but now I need to erase sectors individually. The ap note AN3154 poorly describes this functionality by "Send message with stdID=0x43 and data field containing sector codes" . Later it says "std ID = 0x43, DLC = 0x01 to 0x08, data = see data sheet" . Should the pages be erased one by one or through a list ? Is it possible to provide an example of what should be the CAN message ?

Thanks !

3 REPLIES 3
TDK
Guru

The data bytes indicate the number of the flash pages you wish you erase.

It's up to you if you want to erase one by one (DLC=1, data[0] = #), or all at once (DLC>1).

So to erase page 0: ID = 0x43, DLC = 0x01, data[0] = 0x00.

If you feel a post has answered your question, please click "Accept as Solution".
JBizo.1
Associate

THanks for the answer.. however is it possible to erase several pages at once, for example:

ID= 0x43, DLC = 0x08, data = 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07,

and repeat the command with other pages until all space I need is erased ?

Yes.
If you feel a post has answered your question, please click "Accept as Solution".