From 098e74f0b87361f7b46ac20b70f1abff3fc318cb Mon Sep 17 00:00:00 2001 From: bnjmnp Date: Thu, 2 Dec 2021 21:55:39 +0100 Subject: [PATCH 1/2] Fix the foe code of the rtl_slavedemo application With d9ebdc99 the FOE part of the API changed a bit, but the application was not updated. --- applications/rtl_slavedemo/bootstrap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/rtl_slavedemo/bootstrap.c b/applications/rtl_slavedemo/bootstrap.c index 9ae42df..d76e3b2 100644 --- a/applications/rtl_slavedemo/bootstrap.c +++ b/applications/rtl_slavedemo/bootstrap.c @@ -46,7 +46,7 @@ void boot_inithook (void) } } -uint32_t flash_foe_buffer (foe_writefile_cfg_t * self, uint8_t * data, size_t length) +uint32_t flash_foe_buffer (foe_file_cfg_t * self, uint8_t * data, size_t length) { uint32_t flash_cmd_failed = 0; uint32_t calculated_address = self->dest_start_address + self->address_offset; @@ -92,7 +92,7 @@ void bootstrap_foe_init (void) * extern uint32_t flash_start; */ /* This part is Cortex M4 Kinetis specific therefore placed in Hooks*/ - static foe_writefile_cfg_t files[] = + static foe_file_cfg_t files[] = { { .name = "ato.bin", @@ -122,7 +122,7 @@ void bootstrap_foe_init (void) .files = files }; - FOE_config ((foe_cfg_t *)&config, (foe_writefile_cfg_t *)&files); + FOE_config ((foe_cfg_t *)&config); } void bootstrap_state (void) From 2e389e1d56eb898f36c049f29fe2b8ca4f279b0b Mon Sep 17 00:00:00 2001 From: bnjmnp Date: Thu, 16 Dec 2021 07:48:45 +0100 Subject: [PATCH 2/2] Allow FoE write only in BOOTSTRAP state in the rtl_slavedemo application To demonstrate the use of of the `write_only_in_boot` FoE file configuration. --- applications/rtl_slavedemo/bootstrap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/applications/rtl_slavedemo/bootstrap.c b/applications/rtl_slavedemo/bootstrap.c index d76e3b2..341e138 100644 --- a/applications/rtl_slavedemo/bootstrap.c +++ b/applications/rtl_slavedemo/bootstrap.c @@ -100,6 +100,7 @@ void bootstrap_foe_init (void) .dest_start_address = FLASH_BLOCK_SIZE + 0, /* + (uint32_t)&flash_start,*/ .address_offset = 0, .filepass = 0, + .write_only_in_boot = 1, .write_function = flash_foe_buffer /* NULL if not used */ }, { @@ -109,6 +110,7 @@ void bootstrap_foe_init (void) (FLASH_EEPROM_SECTIONS * FLASH_SECTOR_SIZE), .address_offset = 0, .filepass = 0, + .write_only_in_boot = 1, .write_function = flash_foe_buffer /* NULL if not used */ }, };