
CAN bootloader
AN2662
Doc ID 14156 Rev 1
The STM32F105xx and STM32F107xx sends the messages as follows:
ACK message: Std ID = 0x11, DLC = 1, data[0] = ACK if content of the command is correct
else data[0] = NACK
Data message (N+1) / 8: Std ID = 0x11, DLC = Number of Byte, data[0] = 0xXX ...
data[Number of Byte - 1] = 0xYY
ACK message: Std ID = 0x11, DLC = 1, data[0] = ACK
3.9
Go command via CAN
The Go command is used to execute the downloaded code or any other code by branching
to an address specified by the user. When the bootloader receives the Go command, it
starts if the message contains the following valid information:
●
ID of the command is correct or not
●
ReadOutProtection is disabled or enabled
●
Branch destination address is valid or not(data[0] is the address MSB and data[3] 4 is
LSB
if the message content is correct it transmits an ACK message otherwise it transmits a
NACK message.
After sending an ACK message to the user the CPU program counter automatically jumps to
the address.
Note:
1
The Jump to the application works only if the user application sets the vector table correctly
to point to the application address.
2
When performing a jump from the Bootloader to a loaded application code which uses the
USB IP, the user application has to disable all pending USB interrupts and reset the core
before enabling interrupts. Otherwise, a pending interrupt (issued from the bootloader code)
may interfere with the user code and cause a functional failure. This procedure is not
needed after exiting system memory boot mode.
Figure 38.
Go command via CAN: Host side
1.
See product datasheet
for valid addresses.
The host sends the bytes as follows
Go command message: Std ID = 0x21, DLC = 0x04, data[0] = 0xXX: MSB address,...data[3]
= 0xYY LSB address.
7AITFOR!#+
OR.!#+
%NDOF'O
3END'OMESSAGESTD)$X
3TART'OCOMMAND
AI