You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2021/04/22 07:49:31 UTC

[mynewt-core] 04/05: bsp/nordic_pca10095_net: Add slot for combine image

This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 074e59727271bdf80380abb73e203d50529e41e6
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Fri Apr 9 12:38:45 2021 +0200

    bsp/nordic_pca10095_net: Add slot for combine image
    
    This moves slot 2 (FLASH_AREA_IMAGE_1) to virtual flash
    that takes data from current slot 1 on application core.
---
 hw/bsp/nordic_pca10095_net/bsp.yml       | 6 +++---
 hw/bsp/nordic_pca10095_net/src/hal_bsp.c | 6 ++++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/hw/bsp/nordic_pca10095_net/bsp.yml b/hw/bsp/nordic_pca10095_net/bsp.yml
index 26e1f99..41db3a1 100644
--- a/hw/bsp/nordic_pca10095_net/bsp.yml
+++ b/hw/bsp/nordic_pca10095_net/bsp.yml
@@ -45,10 +45,10 @@ bsp.flash_map:
             device: 0
             offset: 0x01008000
             size: 100kB
-        # TODO this should map to app flash
+        # This maps to app flash and uses vflash
         FLASH_AREA_IMAGE_1:
-            device: 0
-            offset: 0x01021000
+            device: 1
+            offset: 0x00000000
             size: 100kB
         FLASH_AREA_IMAGE_SCRATCH:
             device: 0
diff --git a/hw/bsp/nordic_pca10095_net/src/hal_bsp.c b/hw/bsp/nordic_pca10095_net/src/hal_bsp.c
index 09a7e8e..e0b1845 100644
--- a/hw/bsp/nordic_pca10095_net/src/hal_bsp.c
+++ b/hw/bsp/nordic_pca10095_net/src/hal_bsp.c
@@ -25,6 +25,7 @@
 #include <flash_map/flash_map.h>
 #include <hal/hal_bsp.h>
 #include <hal/hal_flash.h>
+#include <hal/hal_flash_int.h>
 #include <hal/hal_system.h>
 #include <mcu/nrf5340_net_hal.h>
 #include <mcu/nrf5340_net_periph.h>
@@ -49,6 +50,11 @@ hal_bsp_flash_dev(uint8_t id)
     if (id == 0) {
         return &nrf5340_net_flash_dev;
     }
+#if MCUBOOT_MYNEWT
+    if (id == 1) {
+        return &nrf5340_net_vflash_dev.nv_flash;
+    }
+#endif
 
     return NULL;
 }