Skip to content

Commit e051504

Browse files
committed
Add doc : how to generate files needed by the factory.
1 parent 71ce13d commit e051504

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

doc/buildAndProgram.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,33 @@ Loading section .sec7, size 0xdf08 lma 0x40000
231231
Start address 0x0, load size 314200
232232
Transfer rate: 45 KB/sec, 969 bytes/write.
233233
```
234+
235+
### How to generate files needed by the factory
236+
These files are needed by the Pine64 factory to flash InfiniTime as the default firmware on the PineTimes.
237+
238+
Two files are needed: an **HEX (.hex)** file that contains the content of the internal flash memory (bootloader + InfiniTime) and a **binary (.bin)** file that contains the content of the external flash memory (recovery firmware).
239+
240+
#### merged-internal.hex
241+
First, convert the bootloader to hex:
242+
```
243+
<ARM TOOLCHAIN>/bin/arm-none-eabi-objcopy -I binary -O ihex ./bootloader.bin ./bootloader.hex
244+
```
245+
where `bootloader.bin` is the [last stable version](https://github.com/JF002/pinetime-mcuboot-bootloader/releases) of the [bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader).
246+
247+
Then, convert the MCUBoot image of InfiniTime:
248+
```
249+
<ARM TOOLCHAIN>/bin/arm-none-eabi-objcopy -I binary -O ihex --change-addresses 0x8000 ./pinetime-mcuboot-app-image-1.6.0.bin ./pinetime-mcuboot-app-image-1.6.0.hex
250+
```
251+
where `pinetime-mcuboot-app-image-1.6.0.bin` is [the bin of the last MCUBoot image](https://github.com/InfiniTimeOrg/InfiniTime/releases) of [InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime).
252+
253+
Pay attention to the parameter `--change-addresses 0x8000`. It's needed to ensure the image will be flashed at the offset expected by the bootloader (0x8000).
254+
255+
Finally, merge them together with **mergehex**:
256+
```
257+
/opt/mergehex/mergehex -m ./bootloader.hex ./pinetime-mcuboot-app-image-1.6.0.hex -o merged-internal.hex
258+
```
259+
260+
This file must be flashed at offset **0x00** of the internal memory of the NRF52832.
261+
262+
#### spinor.bin
263+
This file is the MCUBoot image of the last stable version of the recovery firmware. It must be flashed at offset **0x00** of the external SPINOR flash memory.

0 commit comments

Comments
 (0)