Example for using custom UART port/pin. Additional debug output on erase of unused flash sectors.

pull/507/head
David Garske 2024-10-01 09:38:06 -07:00 committed by Daniele Lacamera
parent eb175cdfec
commit 832ac479c3
4 changed files with 11 additions and 7 deletions

View File

@ -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

View File

@ -2186,11 +2186,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:

View File

@ -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");
}

View File

@ -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: