|
1 |
| -# Flash loader template |
2 |
| -Flash loader template without the need for a Keil/Segger DSK license. Uses Cmake and arm-none-eabi. Uses parts of [klib](https://github.com/itzandroidtab/klib/) |
| 1 | +# Open Flash loader template (OFL) |
| 2 | +Flash loader template without the need for a Keil/Segger DSK license. OFL uses Cmake and arm-none-eabi to build. OFL Uses parts of [klib](https://github.com/itzandroidtab/klib/) |
3 | 3 |
|
4 |
| -## Targets of this project |
5 |
| -Compatible with Segger J-link (Rip Open flash loader (OFL)) |
| 4 | +## Create a Flash loader executable |
| 5 | +To create a OFL executable you need the following: |
| 6 | +* A driver for the peripheral the memory is connected to |
| 7 | +* A driver to communicate with the flash memory |
| 8 | +* Way to feed the watchdog if enabled |
| 9 | +* A way to restore modified registers after deinit |
| 10 | + |
| 11 | +## Stack usage |
| 12 | +In the previous documentation Segger reserved 256 bytes of stack for Open flash loaders. In newer versions the documentation mention 512 bytes of stack with a fallback to 256 bytes for devices with low amounts of memory (debugging linkerscript is set to 256 bytes of stack). |
| 13 | + |
| 14 | +## Create a flash loader xml file |
| 15 | +SEGGER J-Link uses xml files to add support for external loaders. The xml file configures the follwing: |
| 16 | +* The target Microcontroller for the loader |
| 17 | +* The address the memory is located |
| 18 | +* What executable file to load |
| 19 | +* The name it shows up as in the J-Link software |
| 20 | + |
| 21 | +Example xml file for the LPC1756 is25lq040b open flash loader. |
| 22 | +```xml |
| 23 | +<DataBase> |
| 24 | + <Device> |
| 25 | + <ChipInfo Vendor="NXP" Name="LPC1756" /> |
| 26 | + <FlashBankInfo Name="NOR Flash" BaseAddr="0xA0000000"> |
| 27 | + <LoaderInfo Name="SPI flash loader" MaxSize="0x01000000" Loader="flash_loader.elf" LoaderType="FLASH_ALGO_TYPE_OPEN" /> |
| 28 | + </FlashBankInfo> |
| 29 | + </Device> |
| 30 | +</DataBase> |
| 31 | +``` |
| 32 | + |
| 33 | +More info can be found at https://wiki.segger.com/J-Link_Device_Support_Kit |
| 34 | + |
| 35 | +## Installing your open flash loader |
| 36 | +There are 2 ways to install your open flash loader |
| 37 | +1. Manually copying the executable and xml to `%appdata%/SEGGER/JlinkDevices/vendor/device_family` |
| 38 | +2. Using a installer (like [ofl_installer](https://github.com/itzandroidtab/ofl_installer)) |
6 | 39 |
|
7 | 40 | ## Example
|
8 | 41 | A example is available for the [LPC1756 and is25lq040b](https://github.com/itzandroidtab/ofl_lpc1756_is25lq040b). Made using the drivers from: [klib](https://github.com/itzandroidtab/klib).
|
0 commit comments