MCB bootloader protocol
MCB bootloader uses also MCB protocol, although it uses its own register dictionary addressing for containing the registers needed to access the MCU flash:
- Version address 0x67F. Return the bootloader version. The Slave reply with ACK.
Simple read version example
Version command request
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x67F | 0b001 | 0b0 | 0x0 |
67F2 0000 0000 0000 0000 |
The reply contains, the major, minor and compilation data.
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x67F | 0b011 | 0b0 | Major: 0x1, Minor: 0x2 Compile: 0x3 |
67F6 0001 0002 0003 0000 |
- Enter boot mode 0x67B. Enter boot mode. The slave must reply with an ACK.
Enter boot mode
Enter boot mode.
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x67B | 0b010 | 0b0 | 0x0 |
67B4 0000 0000 0000 0000 |
Version command reply. Error command → 0x6, ACK command → 0x3
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x67B | 0b011 | 0b0 | 0x0 |
67B6 0000 0000 0000 0000 |
- Erase address 0x67D. It erases a flash sector. First 32 bits of config data field, are interpreted as an address, the sector that contains that address will be the target to erase. The slave must reply with an ACK or Error when the address is out of limits.
Erase command example
Erase command request for the sector that contains 0xB8000 address.
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x67D | 0b010 | 0b0 | 0xB8000 |
67D4 8000 000B 0000 0000 |
Version command reply. Error command → 0x6, ACK command → 0x3
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x67D | 0b011 | 0b0 | 0x0 |
67D6 0000 0000 0000 0000 |
- Write address 0x67C. Command that writes a flash memory sector. The first 32 bits of the config data field are used as begin address, from that point, all the data send will be written in sequence. The slave must reply with an ACK or Error when the address is out of limits.
It makes sense to use segmented packages with this command, the performance will be increased substantially.
Write command example
Write command request for sector that contains the 0x88000 address, data 0x12345678
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x67C | 0b010 | 0b0 | 0x8000000856781234 |
67C4 8000 0008 5678 1234 |
Version command reply. Error command → 0x6, ACK command → 0x3
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x67C | 0b011 | 0b0 | 0x0 |
67C6 0000 0000 0000 0000 |
- Close address 0x67E. This command executes the end of booloader program.
Close command example
Close command request
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x67E | 0b010 | 0b0 | 0x0 |
67E4 0000 0000 0000 0000 |
Version command reply. ACK command → 0x3
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x67E | 0b011 | 0b0 | 0x0 |
67E6 0000 0000 0000 0000 |
Open eeprom boot mode 0x67A. Invalidates the data stored into the external eeproms. The slave must reply with an ACK.
Enter boot mode
Enter eeprom boot mode.
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x67A | 0b010 | 0b0 | 0x0 |
67A4 0000 0000 0000 0000 |
Enter eeprom boot mode command reply. Error command → 0x6, ACK command → 0x3
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x67A | 0b011 | 0b0 | 0x0 |
67A6 0000 0000 0000 0000 |
- EEPROM Command 0x679. Command that writes or reads from EEPROM memory. The first 2 bytes of the config data field are used as node address, the next 2 bytes as address, and the following 4 bytes as data (write case). The slave must reply with an ACK or Error when the command fails.
Write EEPROM command example
Write command request (EEPROM node 0x51, EEPROM address 0x290 and data 0x64)
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x679 | 0b010 | 0b0 | 0x0051029000640000 |
6794 0051 0290 0064 0000 |
Version command reply. ACK command → 0x3
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x679 | 0b011 | 0b0 | 0x0051029000000000 |
6796 0051 0290 0000 0000 |
Read EEPROM command example
Read command request (EEPROM node 0x51, EEPROM address 0x29)
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x679 | 0b001 | 0b0 | 0x0051029000000000 |
6794 0051 0290 0000 0000 |
Version command reply. ACK command → 0x3 Data = 123456
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x679 | 0b011 | 0b0 | 0x0051029034560012 |
6796 0051 0290 3456 0012 |
- Close eeprom boot mode 0x678. Validates the stored eeprom data.
Close command example
Close eeprom command request
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x678 | 0b010 | 0b0 | 0x0 |
6784 0000 0000 0000 0000 |
Version command reply. ACK command → 0x3
Header | Config data | ||
---|---|---|---|
Address | Command | Pending frame | |
0x678 | 0b011 | 0b0 | 0x0 |
6786 0000 0000 0000 0000 |