Using the chrom-art accelerator to refresh an lcd-tft display (22 pages)
Summary of Contents for ST AN3154
Page 1
It details each supported command. For more information about the CAN hardware resources and requirements for your device bootloader, please refer to the “STM32 system memory boot mode” application note (AN2606). Related documents Available from www.st.com: AN2606 “STM32 system memory boot mode” March 2010 Doc ID 17063 Rev 1 1/34 www.st.com...
AN3154 Bootloader code sequence Bootloader code sequence Figure 1. Bootloader for STM32 with CAN Once the system memory boot mode is entered and the STM32 device has been configured (for more details refer to application note AN2606 “STM32 system memory boot mode”), the bootloader code waits for a frame on the CANx_Rx pin.
Bootloader code sequence AN3154 Figure 2. Check HSE frequency Next, the code initializes the serial interface accordingly. Using this calculated baud rate, an acknowledge byte (0x79) is returned to the host, which signals that the STM32 is ready to receive commands.
AN3154 CAN settings CAN settings The STM32 CAN is compliant with the 2.0A and B (active) specifications with a bitrate up to 1 Mbit/s. It can receive and transmit standard frames with 11-bit identifiers as well as extended frames with 29-bit identifiers.
Bootloader command set AN3154 Bootloader command set The supported commands are listed in Table 1 below. Each command is further described in this section. Table 1. CAN bootloader commands Command Command Command description code Gets the version and the allowed commands...
AN3154 Bootloader command set Device-dependent bootloader parameters While the CAN bootloader protocol’s command set and sequences are the same for all STM32 devices, some parameters are device-dependent. For a few commands, the value of some parameters may depend on the device used. The concerned parameters are listed below: ●...
AN3154 Bootloader command set The host sends messages as follows: Command message: Std ID = 0x00, data length code (DLC) = ‘not important’. Figure 5. Get command: device side The STM32 sends messages as follows: Message 1: Std ID = 0x00, DLC = 1, data = 0x79...
AN3154 Bootloader command set Figure 7. Get Version & Read Protection Status command: device side 1. GV = Get Version & Read Protection Status. The STM32 sends messages as follows: Message 1: Std ID = 0x01, DLC = 1, data = ACK Message 2: Std ID = 0x01, DLC = 1, data[0] = bootloader version (0 <...
Bootloader command set AN3154 Get ID command The Get ID command is used to get the version of the chip ID (identification). When the bootloader receives the command, it transmits the product ID to the host. Figure 8. Get ID command: host side 1.
AN3154 Bootloader command set Figure 9. Get ID command: device side 1. GID = Get ID. 2. PID stands for product ID. Byte 1 is the MSB and byte 2 is LSB of the address. The STM32 sends the bytes as follows:...
Bootloader command set AN3154 Speed command The speed command allows the baud rate for CAN run-time to be changed. It can be used only if CAN is the peripheral being used. A system reset is generated if the CAN receives the correct message but the operation to set the new baudrate fails, which prevents it from entering or leaving initialization mode.
AN3154 Bootloader command set Figure 11. Speed command: device side The STM32 sends the bytes as follows: Message 1: Std ID = 0x03, DLC = 1, data[0] = ACK= 0x79: with old baudrate if the receive message is correct else data[0] = NACK= 0x1F...
Bootloader command set AN3154 Read Memory command The Read Memory command is used to read data from any valid memory address (see note) in RAM, Flash memory and in the information block (System memory or option byte areas). Note: Refer to Section 3.1: Device-dependent bootloader parameters...
AN3154 Bootloader command set Figure 13. Read memory command: device side The STM32 sends 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...
Bootloader command set AN3154 After sending an ACK message to the application, the bootloader firmware performs the following: ● it initializes the registers of the peripherals used by the bootloader to their default reset values ● it initializes the user application’s main stack pointer ●...
AN3154 Bootloader command set Figure 15. Go command: device side The STM32 send the messages as follows: ACK message: Std ID = 0x21, DLC = 1, data[0] = ACK if content of the command is correct else data[0] = NACK...
Bootloader command set AN3154 Note: When writing to the RAM, you should take care not to overlap the first RAM memory used by the bootloader firmware. No error is returned when performing write operations on write protected sectors. Write operations to Flash memory/SRAM must be word aligned, if less data are written the remaining bytes must be filled with 0xFF.
AN3154 Bootloader command set Figure 17. Write memory command: device side Start write memory Received message with stdID = 0x31? ROP inactive? Address valid? Send ACK message Receive the ’data messages’ and If a message is corrupted temporarily write the data to RAM...
Bootloader command set AN3154 Erase Memory command 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].
AN3154 Bootloader command set Figure 19. Erase Memory command: device side The STM32 sends messages as follows: ACK message: Std ID = 0x43, DLC = 1, data[0] = ACK if content of the command is correct and ROP is not active else data[0] = NACK...
Bootloader command set AN3154 3.10 Write Protect command The Write Protect command is used to enable the write protection for some or all Flash memory sectors. When the bootloader receives the Write Protect command, it transmits the ACK message to the host if ROP is disabled else it transmits NACK.
AN3154 Bootloader command set Figure 21. Write Protect command: device side 1. WP = Write Protect The STM32 sends messages as follows: ACK message: Std ID = 0x43, DLC = 1, data[0] = ACK if the content of the command is correct and ROP is not active else data[0] = NACK.
AN3154 Bootloader command set The STM32 sends messages as follows: ACK message: Std ID = 0x73, DLC = 1, data[0] = ACK if the content of the command is correct and ROP is not active else data[0] = NACK. 3.12 Readout Protect command The Readout Protect command is used to enable the Flash memory read protection.
Bootloader command set AN3154 Figure 25. Readout Protect command: device side 1. RDP_PRM = Readout Protect The STM32 sends messages as follows: ACK message: Std ID = 0x82, DLC = 1, data[0] = ACK if the content of the command is correct and ROP is not active else data[0] = NACK.
AN3154 Revision history Revision history Table 3. Document revision history Date Revision Changes 09-Mar-2010 Initial release. Doc ID 17063 Rev 1 33/34...
Page 34
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein.
Need help?
Do you have a question about the AN3154 and is the answer not in the manual?
Questions and answers