From c6c4d8477f2bc64e43eaefddaee6253c4a1b7f24 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 12 Apr 2021 09:32:55 -0500 Subject: [PATCH 1/3] mimxrt10xx: Also self-install when FCFB not valid --- ports/mimxrt10xx/board_flash.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/mimxrt10xx/board_flash.c b/ports/mimxrt10xx/board_flash.c index c69c8ee..08c1e67 100644 --- a/ports/mimxrt10xx/board_flash.c +++ b/ports/mimxrt10xx/board_flash.c @@ -76,6 +76,11 @@ void board_flash_init(void) TUF2_LOG1("BootMode = 01: "); write_tinyuf2_to_flash(); } + bool fcfb_valid = (*(uint32_t*) FCFB_START_ADDRESS == FLEXSPI_CFG_BLK_TAG); + if (!fcfb_valid) { + TUF2_LOG1("FCFB not present: "); + write_tinyuf2_to_flash(); + } } uint32_t board_flash_size(void) From 218cb26da181c7587ae2c8ca7013eb57a8a3920e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 12 Apr 2021 10:04:39 -0500 Subject: [PATCH 2/3] unify 2 tests, get rid of debug message --- ports/mimxrt10xx/board_flash.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ports/mimxrt10xx/board_flash.c b/ports/mimxrt10xx/board_flash.c index 08c1e67..d26fc59 100644 --- a/ports/mimxrt10xx/board_flash.c +++ b/ports/mimxrt10xx/board_flash.c @@ -71,16 +71,11 @@ void board_flash_init(void) // TinyUF2 will copy its image to flash if Boot Mode is '01' i.e Serial Download Mode (BootRom) // Normally it is done once by SDPHost or used to recover an corrupted boards uint32_t const boot_mode = (SRC->SBMR2 & SRC_SBMR2_BMOD_MASK) >> SRC_SBMR2_BMOD_SHIFT; - if (boot_mode == 1) + bool fcfb_valid = (*(uint32_t*) FCFB_START_ADDRESS == FLEXSPI_CFG_BLK_TAG); + if (boot_mode == 1 || !fcfb_valid) { - TUF2_LOG1("BootMode = 01: "); write_tinyuf2_to_flash(); } - bool fcfb_valid = (*(uint32_t*) FCFB_START_ADDRESS == FLEXSPI_CFG_BLK_TAG); - if (!fcfb_valid) { - TUF2_LOG1("FCFB not present: "); - write_tinyuf2_to_flash(); - } } uint32_t board_flash_size(void) From 05d60b9a15037f4e438231bdab7b082cefcd04c9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 12 Apr 2021 10:04:54 -0500 Subject: [PATCH 3/3] update tag on esp-idf cache to fix failed build --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 51bf805..ce343c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -97,7 +97,7 @@ jobs: id: idf-cache with: path: ${{ github.workspace }}/.idf_tools - key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/lib/esp-idf/HEAD') }}-20201222 + key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/lib/esp-idf/HEAD') }}-20210412 - name: Install IDF tools if: steps.idf-cache.outputs.cache-hit != 'true'