Skip to content
Permalink
Browse files

dfu/boot: non-secure app support

In non-secure Trustzone application dedicated flash non-secure
partition are used instead of regular one, which become secure
partition in Trustzone collaboration model.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
  • Loading branch information...
nvlsianpu authored and nashif committed Apr 11, 2019
1 parent aa2b8a1 commit 945f9c7d5414beff9cfdd74173ebb60c44663b46
Showing with 8 additions and 1 deletion.
  1. +8 −1 subsys/dfu/boot/mcuboot.c
@@ -70,8 +70,15 @@ struct mcuboot_v1_raw_header {
#define FLASH_MIN_WRITE_SIZE DT_FLASH_WRITE_BLOCK_SIZE

/* DT_FLASH_AREA_IMAGE_XX_YY values used below are auto-generated by DT */
#ifdef CONFIG_TRUSTED_EXECUTION_NONSECURE
#define FLASH_BANK0_ID DT_FLASH_AREA_IMAGE_0_NONSECURE_ID
#define FLASH_BANK1_ID DT_FLASH_AREA_IMAGE_1_NONSECURE_ID
#define FLASH_AREA_IMAGE_SCRATCH DT_FLASH_AREA_IMAGE_SCRATCH_ID
#else
#define FLASH_BANK0_ID DT_FLASH_AREA_IMAGE_0_ID
#define FLASH_BANK1_ID DT_FLASH_AREA_IMAGE_1_ID
#define FLASH_AREA_IMAGE_SCRATCH DT_FLASH_AREA_IMAGE_SCRATCH_ID
#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE */

#define COPY_DONE_OFFS(bank_area) ((bank_area)->fa_size -\
BOOT_MAGIC_SZ - BOOT_MAX_ALIGN * 2)
@@ -399,7 +406,7 @@ static int boot_read_swap_state(u8_t bank_id, struct boot_swap_state *state)
}
state->magic = rc;

if (bank_id != DT_FLASH_AREA_IMAGE_SCRATCH_ID) {
if (bank_id != FLASH_AREA_IMAGE_SCRATCH) {
rc = boot_copy_done_read(bank_id);
if (rc < 0) {
return rc;

0 comments on commit 945f9c7

Please sign in to comment.
You can’t perform that action at this time.