
AN2662
CAN bootloader
Doc ID 14156 Rev 1
3.11
Erase Memory command via CAN
The Erase Memory command allows the host to erase Flash memory pages. When the
bootloader receives the Erase Memory command and ROP is disabled, it transmits the ACK
message to the host. After the transmission of the ACK message, the bootloader checks if
the message that contain data[0].
Erase Memory command specifications:
1.
The bootloader receives one message that contains N, the number of pages to be
erased – 1.
N = 255 is reserved for global erase requests. For 0
≤
N
≤
254, N + 1 pages are erased.
2.
The bootloader receives (N + 1) bytes, each byte containing a page number
Note:
No error is returned when performing erase operations on write protected sectors.
Figure 42.
Erase Memory command via CAN: Host side
The host sends the message as follows
The ID contains the command type (0x43):
●
Total erase message: Std ID = 0x43, DLC = 0x01, data = 0xFF.
●
Erase sector by sector message: Std ID = 0x43, DLC = 0x01 to 0x08, data = see
product datasheet.
'LOBAL
3TARTERASEMEMORY
.O
9ES
3ENDAMESSAGEWITHSTD
)$XANDDATABYTE
X&&4HEBOOTLOADER
TAKESNOACCOUNTOFOTHER
DATAINTHEMESSAGE
3ENDAMESSAGEWITHSTD
)$XANDDATAFIELD
CONTAININGSECTORCODES
%NDOFERASEMEMORY
AI
7AITFOR!#+
OR.!#+
%RASE
.!#+
!#+