Skip to content

Commit f91b3ba

Browse files
committed
Updated the readme with how to start
1 parent 23eaf1c commit f91b3ba

File tree

2 files changed

+45
-4
lines changed

2 files changed

+45
-4
lines changed

Readme.md

+37-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,41 @@
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/)
33

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))
639

740
## Example
841
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).

example.xml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<DataBase>
2+
<Device>
3+
<ChipInfo Vendor="NXP" Name="LPC1756" />
4+
<FlashBankInfo Name="NOR Flash" BaseAddr="0xA0000000">
5+
<LoaderInfo Name="SPI flash loader" MaxSize="0x01000000" Loader="flash_loader.elf" LoaderType="FLASH_ALGO_TYPE_OPEN" />
6+
</FlashBankInfo>
7+
</Device>
8+
</DataBase>

0 commit comments

Comments
 (0)