M-Boot ROM Description
558
SPRUH22I – April 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
ROM Code and Peripheral Booting
•
mbrom_analog_system_init()
•
M-Boot ROM WIR Mode Check – Please refer to the WIR Mode section in the
System Control and
Interrupts
chapter.
•
mbrom_get_bootmode()
–
If boot mode is boot_from_serial, then execute the following functions
•
ConfigureDevice()
•
PickInterface();
•
Update()
•
Download application data from any of the available serial communication peripherals
(UART0/SSI0/I2C0) on to RAM.
•
mbrom_start_app(M_BOOT_ROM_SERIAL_BOOT_MODE_ENTRY_POINT)
When performing an update via a serial port (UART0, SSI0, or I2C0), ConfigureDevice() is used to
configure the serial ports (all the three interfaces) making them ready to be used to download application
code on to device RAM.
Then PickInterface() function is called which will continuously poll UART0, SSI0 and I2C0 interfaces for a
successful baud rate synchronization on UART0 or successful data reception on SSI0 or successful data
reception on I2C0. If baud rate is successfully synchronized on UART0 using auto baud feature then
UART0 interface is selected for boot. Otherwise either I2C0 or SSS0 interface is selected based on which
interface received data. If UART0 auto baud is not successful and neither I2C0 and SSI0 interfaces
received data then M-Boot ROM keeps waiting for one of the above events to occur
Once an interface is picked to boot, Update() function is called which sits in an endless loop accepting
commands and updating the application code when requested. All transmissions from this main routine
use the packet handler functions (SendPacket(), ReceivePacket(), AckPacket(), and NakPacket()). Once
the update is complete, the application can be started by issuing a COMMAND_RUN command or
COMMAND_RESET command.
6.5.15.1.5.1 Packet Handling
The bootloader uses the SendPacket() function in order to send a packet of data to another device. This
function encapsulates all of the steps necessary to send a valid packet to another device including waiting
for the acknowledge or not-acknowledge from the other device.
Received packets use the same format as sent packets. The bootloader uses the ReceivePacket()
function in order to receive or wait for a packet from another device. This function does not take care of
acknowledging or not-acknowledging the packet to the other device. This allows the contents of the packet
to be checked before sending back a response.
The steps performed while sending a packet are as listed in
.
The steps necessary to acknowledge reception of a packet are implemented in the AckPacket() function.
Acknowledge bytes are sent out whenever a packet is successfully received and verified by the
bootloader.
A not-acknowledge byte is sent out whenever a sent packet is detected to have an error, usually as a
result of a checksum error or just malformed data in the packet. This allows the sender to re-transmit the
previous packet.
6.5.15.1.5.2 Transport Layer
The bootloader supports updating via the I2C0, SSI0, and UART0 ports which are available on Concerto
microcontrollers. The SSI port has the advantage of supporting higher and more flexible data rates but it
also requires more connections to the microcontroller. The UART has the disadvantage of having slightly
lower and possibly less flexible rates. However, the UART requires fewer pins and can be easily
implemented with any standard UART connection. The I2C interface also provides a standard interface,
only uses two wires, and can operate at comparable speeds to the UART and SSI interfaces.