From fabfa843be8c9d3c5238bded8fc1f8feb184c6fc Mon Sep 17 00:00:00 2001 From: John Bland Date: Mon, 21 Aug 2023 17:39:05 -0400 Subject: [PATCH 1/3] add hal_init to the imx test-app and trigger update --- test-app/app_imx_rt.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test-app/app_imx_rt.c b/test-app/app_imx_rt.c index 88cc2fe46..b47056e7e 100644 --- a/test-app/app_imx_rt.c +++ b/test-app/app_imx_rt.c @@ -124,6 +124,12 @@ void rt1050_init_pins(void) void main(void) { + hal_init(); + if (wolfBoot_current_firmware_version() == 1) { + wolfBoot_update_trigger(); + return; + } + imx_rt_init_boot_clock(); #if defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1064DVL6A) rt1060_init_pins(); @@ -137,11 +143,6 @@ void main(void) PRINTF("wolfBoot Test app, version = %d\r\n", wolfBoot_current_firmware_version()); - /* enable to test update trigger on reboot */ -#if 0 - wolfBoot_update_trigger(); -#endif - while (1) { /* 100ms delay */ SDK_DelayAtLeastUs(100 * 1000, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); From 245f5f4cfc8940e5a3e4b525b8d8691ff92ddaa1 Mon Sep 17 00:00:00 2001 From: John Bland Date: Mon, 21 Aug 2023 23:30:45 -0400 Subject: [PATCH 2/3] move the update_trigger to before the SysTick_Config call --- test-app/app_imx_rt.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test-app/app_imx_rt.c b/test-app/app_imx_rt.c index b47056e7e..24ae860a1 100644 --- a/test-app/app_imx_rt.c +++ b/test-app/app_imx_rt.c @@ -124,12 +124,6 @@ void rt1050_init_pins(void) void main(void) { - hal_init(); - if (wolfBoot_current_firmware_version() == 1) { - wolfBoot_update_trigger(); - return; - } - imx_rt_init_boot_clock(); #if defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1064DVL6A) rt1060_init_pins(); @@ -137,12 +131,18 @@ void main(void) rt1050_init_pins(); #endif SystemCoreClockUpdate(); - SysTick_Config(SystemCoreClock / 1000U); - init_debug_console(); PRINTF("wolfBoot Test app, version = %d\r\n", wolfBoot_current_firmware_version()); + if (wolfBoot_current_firmware_version() == 1) { + wolfBoot_update_trigger(); + return; + } + + SysTick_Config(SystemCoreClock / 1000U); + init_debug_console(); + while (1) { /* 100ms delay */ SDK_DelayAtLeastUs(100 * 1000, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); From 34b563674a2e3a61ee42bcfd9d43e4866959732b Mon Sep 17 00:00:00 2001 From: John Bland Date: Tue, 22 Aug 2023 10:24:05 -0400 Subject: [PATCH 3/3] remove SysTick_Config, add wolfBoot_success --- test-app/app_imx_rt.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test-app/app_imx_rt.c b/test-app/app_imx_rt.c index 24ae860a1..46cff2c5b 100644 --- a/test-app/app_imx_rt.c +++ b/test-app/app_imx_rt.c @@ -131,18 +131,17 @@ void main(void) rt1050_init_pins(); #endif SystemCoreClockUpdate(); + init_debug_console(); PRINTF("wolfBoot Test app, version = %d\r\n", wolfBoot_current_firmware_version()); if (wolfBoot_current_firmware_version() == 1) { wolfBoot_update_trigger(); - return; + } else { + wolfBoot_success(); } - SysTick_Config(SystemCoreClock / 1000U); - init_debug_console(); - while (1) { /* 100ms delay */ SDK_DelayAtLeastUs(100 * 1000, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY);