Merge pull request #109 from jepler/uf2-self-install-when-blank

mimxrt10xx: Also self-install when FCFB not valid
This commit is contained in:
Ha Thach 2021-04-12 22:28:06 +07:00 committed by GitHub
commit 7cd271ec08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

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

View file

@ -71,9 +71,9 @@ 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();
}
}