Skip to content

Commit 49699bc

Browse files
committed
Add example for larger wolfBoot partition scheme (all partitions 40KB). Added instructions for debugging.
1 parent 61d24ab commit 49699bc

File tree

2 files changed

+37
-24
lines changed

2 files changed

+37
-24
lines changed

config/examples/mcxa.config

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,20 @@ SPMATH?=1
2121
RAM_CODE?=1
2222
DUALBANK_SWAP?=0
2323
PKA?=1
24-
WOLFBOOT_PARTITION_SIZE?=0xB000
24+
25+
# 8KB sectors
2526
WOLFBOOT_SECTOR_SIZE?=0x2000
27+
28+
# Default configuration
29+
# 32KB boot, 44KB partitions, 8KB swap
30+
WOLFBOOT_PARTITION_SIZE?=0xB000
2631
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x8000
2732
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x13000
2833
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x1E000
34+
35+
# Alternate larger configuration for debugging or SP ASM
36+
# 40KB boot, 40KB partitions, 8KB swap
37+
#WOLFBOOT_PARTITION_SIZE?=0xA000
38+
#WOLFBOOT_PARTITION_BOOT_ADDRESS?=0xA000
39+
#WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x14000
40+
#WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x1E000

docs/Targets.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,36 +1719,25 @@ The support has been tested using FRDM-MCXA153 with the onboard MCU-Link configu
17191719
This requires the MCXA SDK from the NXP MCUXpresso SDK Builder. We tested using `SDK_2.14.2_MCXA153` and placed into `../NXP/MCXA153` by default (see .config or set with `MCUXPRESSO`).
17201720
MCUXpresso SDK Builder
17211721

1722-
### Configuring and compiling
1722+
### MCX A: Configuring and compiling
17231723

1724-
Copy the example configuration file:
1724+
Copy the example configuration file and build with make:
17251725

1726-
`cp config/examples/mcxa.config .config`
1727-
1728-
Compile via:
1726+
```sh
1727+
cp config/examples/mcxa.config .config`
1728+
make
1729+
```
17291730

1730-
`make`
1731-
1732-
### Loading the firmware
1731+
### MCX A: Loading the firmware
17331732

17341733
The NXP Freedom MCX A board debugger comes loaded with MCU Link, but it can be updated to JLink. See https://docs.nxp.com/bundle/UM12012/page/topics/Updating_MCU_Link_firmware.html
17351734

1736-
Use JLinkExe tool to upload the initial firmware:
1737-
1738-
`JLinkExe -if swd -Device MCXA153`
1735+
Use JLinkExe tool to upload the initial firmware: `JLinkExe -if swd -Device MCXA153`
17391736

17401737
At the Jlink prompt, type:
17411738

17421739
```
17431740
loadbin factory.bin 0
1744-
'loadbin': Performing implicit reset & halt of MCU.
1745-
ResetTarget() start
1746-
Reset via SYSRESETREQ and reset pin + halt after bootloader
1747-
ResetTarget() end - Took 111ms
1748-
AfterResetTarget() start
1749-
SRAM_XEN set to RWX
1750-
FLASH and IFR set to RWX
1751-
AfterResetTarget() end - Took 7.40ms
17521741
Downloading file [factory.bin]...
17531742
J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
17541743
O.K.
@@ -1758,17 +1747,17 @@ Reset or power cycle board.
17581747
17591748
Once wolfBoot has performaed validation of the partition and booted the D15 Green LED on P3_13 will illuminate.
17601749
1761-
### Testing firmware update
1750+
### MCX A: Testing firmware update
17621751
17631752
1) Sign the test-app with version 2:
17641753
1765-
```
1754+
```sh
17661755
./tools/keytools/sign --ecc256 test-app/image.bin wolfboot_signing_private_key.der 2
17671756
```
17681757

17691758
2) Create a bin footer with wolfBoot trailer "BOOT" and "p" (ASCII for 0x70 == IMG_STATE_UPDATING):
17701759

1771-
```
1760+
```sh
17721761
echo -n "pBOOT" > trigger_magic.bin
17731762
```
17741763

@@ -1781,7 +1770,19 @@ echo -n "pBOOT" > trigger_magic.bin
17811770
0xAFFB trigger_magic.bin
17821771
```
17831772

1784-
4) Flash update.bin to 0x13000 (`loadbin update.bin 0x13000`). The D15 GDB LED Blue P3_0 will show if version is > 1.
1773+
4) Flash update.bin to 0x13000 (`loadbin update.bin 0x13000`). The D15 RGB LED Blue P3_0 will show if version is > 1.
1774+
1775+
Note: For alternate larger scheme flash `update.bin` to `0x14000` and place trigger_magic.bin at `0x9FFB`.
1776+
1777+
### MCX A: Debugging
1778+
1779+
Debugging with JLink:
1780+
1781+
In one terminal:
1782+
`JLinkGDBServer -if swd -Device MCXA153 -port 3333`
1783+
1784+
We include a `.gdbinit` in the wolfBoot root that loads the wolfboot and test-app elf files:
1785+
In another terminal use `gdb`.
17851786

17861787

17871788
## TI Hercules TMS570LC435

0 commit comments

Comments
 (0)