Skip to content

Commit

Permalink
Bootloader documentation [bootloader]
Browse files Browse the repository at this point in the history
  • Loading branch information
augustofg committed Mar 3, 2020
1 parent 69e1a90 commit c70cde9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Make sure to include the ```your_prefix_path/usr/bin``` directory in your ```PAT

## Flashing

The nuttx.bin image does not contains the bootloader and is expected to be loaded at 0x00010000, so if you are flashing blank uCs, flash the bootloader from legacy/bootloader first.
The nuttx.bin image does not contains the bootloader and is expected to be loaded at 0x00010000, so if you are flashing blank uCs, flash the bootloader from bootloader/ first.

### Via CMSIS-DAP

Expand Down
21 changes: 21 additions & 0 deletions bootloader/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# RFFE Bootloader

The flash memory is divided in three regions:
* Bootloader 0x00000000 - 0x0000FFFF (64KiB);
* Application 0x00010000 - 0x00047FFF (224KiB);
* Firmware update 0x00048000 - 0x00080000 (224KiB).

```
New firmware record at flash address 0x0007FFF0:
+-----------------+-----------------+-----------------+---------------+------------+
| Major version | Minor version | Build version | Firmware type | Magic word |
| number (1 byte) | number (1 byte) | number (1 byte) | (1 byte) | (4 bytes) |
+-----------------+-----------------+-----------------+---------------+------------+
```

The bootloader checks the last 32bit word in flash is equal to 0xAAAAAAAA (firmware update magic word), if it is, the new firmware will be copied from 0x00048000 to 0x00010000 or 0x00000000 depending on the firmware type (application or bootloader). After finishing the copying, the bootloader will erase the last flash sector to prevent unnecessary rewrites to flash after reset.

The Firmware type byte indicates what to update, (0x01: application, 0x02: bootloader). All flash writing logic is executed from SRAM to allow self updating.

0 comments on commit c70cde9

Please sign in to comment.