diff --git a/config/examples/nrf5340.config b/config/examples/nrf5340.config index 707fe338..5a7ba646 100644 --- a/config/examples/nrf5340.config +++ b/config/examples/nrf5340.config @@ -49,7 +49,10 @@ USE_GCC=1 CFLAGS_EXTRA+=-DFLASHBUFFER_SIZE=0x1000 # Enable optional power control pin (active low) P1.00 -CFLAGS_EXTRA+=-DQSPI_PWR_CTRL_PORT=1 -DQSPI_PWR_CTRL_PIN=0 +#CFLAGS_EXTRA+=-DQSPI_PWR_CTRL_PORT=1 -DQSPI_PWR_CTRL_PIN=0 + +# Use UART0 on P0.22 +#CFLAGS_EXTRA+=-DUART_PORT=0 -DUART_PIN=22 CFLAGS_EXTRA+=-DDEBUG_FLASH CFLAGS_EXTRA+=-DDEBUG_QSPI=1 diff --git a/docs/Targets.md b/docs/Targets.md index 28929e6d..acf3439b 100644 --- a/docs/Targets.md +++ b/docs/Targets.md @@ -2131,11 +2131,8 @@ Tested with the Nordic nRF5340-DK. This device has two cores: 1) Application core: Cortex-M33 at 128MHz, w/TrustZone, 1MB flash, 512KB RAM 2) Network core: Cortex-M33 at 64MHz, 256KB Flash and 64KB RAM -The cores communicate using the IPC peripheral. - -The network core can access application core resources (flash, RAM, and peripherals) when granted permission through the application's DCNF and SPU settings. A small portion of the application core RAM is dedicated to the exchange of messages between the application and network cores. - The DK board has two virtual COM ports. Application core and Network core will each output to different VCOM ports. +The cores communicate firmware updates using shared memory hosted on application core. Example Boot Output: diff --git a/hal/nrf5340.c b/hal/nrf5340.c index 8515f223..a6c8f2b9 100644 --- a/hal/nrf5340.c +++ b/hal/nrf5340.c @@ -466,9 +466,11 @@ static void hal_net_check_version(void) /* signal network core to do update */ hal_shm_status_set(&shm->app, SHARED_STATUS_UPDATE_START); + wolfBoot_printf("Waiting for net core update to finish...\n"); + /* wait for update_done */ ret = hal_shm_status_wait(&shm->net, - SHARED_STATUS_UPDATE_DONE, 1000000); + SHARED_STATUS_UPDATE_DONE, 5000000); if (ret == 0) { wolfBoot_printf("Network core firmware update done\n"); } diff --git a/src/update_flash.c b/src/update_flash.c index c04196ee..07269844 100644 --- a/src/update_flash.c +++ b/src/update_flash.c @@ -265,6 +265,7 @@ static int wolfBoot_swap_and_final_erase(int resume) wb_flash_write(boot, tmpBootPos, (void*)tmpBuffer, sizeof(tmpBuffer)); } /* erase the last boot sector(s) */ + wolfBoot_printf("Erasing unused boot sectors...\n"); wb_flash_erase(boot, WOLFBOOT_PARTITION_SIZE - eraseLen, eraseLen); /* set the encryption key */ #ifdef EXT_ENCRYPTED @@ -281,6 +282,7 @@ static int wolfBoot_swap_and_final_erase(int resume) /* mark boot as TESTING */ wolfBoot_set_partition_state(PART_BOOT, IMG_STATE_TESTING); /* erase the last sector(s) of update */ + wolfBoot_printf("Erasing unused update sectors...\n"); wb_flash_erase(update, WOLFBOOT_PARTITION_SIZE - eraseLen, eraseLen); return 0; } @@ -440,7 +442,7 @@ static int wolfBoot_delta_update(struct wolfBoot_image *boot, } #ifndef DISABLE_BACKUP /* start re-entrant final erase, return code is only for resumption in - * wolfBoot_start*/ + * wolfBoot_start */ wolfBoot_swap_and_final_erase(0); #endif out: