Skip to content

Commit

Permalink
Add support for wolfBoot_success() from test-app.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske committed Mar 29, 2024
1 parent 49699bc commit 574f42a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
14 changes: 10 additions & 4 deletions docs/Targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -1778,11 +1778,17 @@ Note: For alternate larger scheme flash `update.bin` to `0x14000` and place trig

Debugging with JLink:

In one terminal:
`JLinkGDBServer -if swd -Device MCXA153 -port 3333`
Note: We include a `.gdbinit` in the wolfBoot root that loads the wolfboot and test-app elf files.

In one terminal: `JLinkGDBServer -if swd -Device MCXA153 -port 3333`

We include a `.gdbinit` in the wolfBoot root that loads the wolfboot and test-app elf files:
In another terminal use `gdb`.
In another terminal use `gdb`:

```
b main
mon reset
c
```


## TI Hercules TMS570LC435
Expand Down
1 change: 1 addition & 0 deletions test-app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ ifeq ($(TARGET),mcxa)
APP_OBJS+=$(MCUXPRESSO_DRIVERS)/drivers/fsl_clock.o
APP_OBJS+=$(MCUXPRESSO_DRIVERS)/drivers/fsl_reset.o
APP_OBJS+=$(MCUXPRESSO_DRIVERS)/drivers/fsl_gpio.o
APP_OBJS+=$(MCUXPRESSO_DRIVERS)/drivers/fsl_spc.o
endif

ifeq ($(TARGET),imx_rt)
Expand Down
7 changes: 7 additions & 0 deletions test-app/app_mcxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

#include "wolfboot/wolfboot.h"

extern void hal_init(void);

/* init gpio for port 3 */
void gpio_port3_init(int pin)
{
Expand Down Expand Up @@ -70,6 +72,8 @@ void main(void)
uint8_t* bootPart = (uint8_t*)WOLFBOOT_PARTITION_BOOT_ADDRESS;
uint32_t bootVer = wolfBoot_get_blob_version(bootPart);

hal_init();

/* If application version 1 then GREEN, else BLUE */
/* RGB LED D15 (RED=P3_12, GREEN=P3_13, BLUE=P3_0) */
if (bootVer == 1) {
Expand All @@ -81,6 +85,9 @@ void main(void)
GPIO_PinWrite(GPIO3, 0, 0);
}

/* mark boot successful */
wolfBoot_success();

/* busy wait */
while (1) {
__WFI();
Expand Down

0 comments on commit 574f42a

Please sign in to comment.