From 574f42ad8369b1a008a562ccd35bef047d8ba3f5 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 29 Mar 2024 11:51:26 -0700 Subject: [PATCH] Add support for wolfBoot_success() from test-app. --- docs/Targets.md | 14 ++++++++++---- test-app/Makefile | 1 + test-app/app_mcxa.c | 7 +++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/Targets.md b/docs/Targets.md index 102077811..a205d48de 100644 --- a/docs/Targets.md +++ b/docs/Targets.md @@ -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 diff --git a/test-app/Makefile b/test-app/Makefile index feb962e7d..034262f52 100644 --- a/test-app/Makefile +++ b/test-app/Makefile @@ -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) diff --git a/test-app/app_mcxa.c b/test-app/app_mcxa.c index a5fc8752b..d4da85eeb 100644 --- a/test-app/app_mcxa.c +++ b/test-app/app_mcxa.c @@ -32,6 +32,8 @@ #include "wolfboot/wolfboot.h" +extern void hal_init(void); + /* init gpio for port 3 */ void gpio_port3_init(int pin) { @@ -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) { @@ -81,6 +85,9 @@ void main(void) GPIO_PinWrite(GPIO3, 0, 0); } + /* mark boot successful */ + wolfBoot_success(); + /* busy wait */ while (1) { __WFI();