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 2023/03/09 13:59:25 UTC

[mynewt-core] branch master updated: bsp/nordic_pca10095: IPC flash configuration change

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


The following commit(s) were added to refs/heads/master by this push:
     new 02159a2cc bsp/nordic_pca10095: IPC flash configuration change
02159a2cc is described below

commit 02159a2ccd91793ab0753507bfa3710f03af6c4c
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Tue Mar 7 14:42:01 2023 +0100

    bsp/nordic_pca10095: IPC flash configuration change
    
    When IPC flash is enabled (access to NET core flash)
    HAL_FLASH_MAX_DEVICE_COUNT must be 3 if QSPI flash
    is not enabled.
    This is needed due to the way how flash is initialized.
    NRF flashes have hardcoded ID 0 - for APP core flash.
    1 - for QSPI flash
    2 - for NET core flash over IPC
    
    Flash initialization stops when hal_bsp_flash_dev() returns NULL
    for the first time unless HAL_FLASH_MAX_DEVICE_COUNT is specified.
    This sets up syscfg value to required number and also ensures
    that it was not changed in target or app.
    When value is to small IPC flash is not available.
---
 hw/bsp/nordic_pca10095/src/hal_bsp.c | 2 ++
 hw/bsp/nordic_pca10095/syscfg.yml    | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/hw/bsp/nordic_pca10095/src/hal_bsp.c b/hw/bsp/nordic_pca10095/src/hal_bsp.c
index c23347f76..c491b9684 100644
--- a/hw/bsp/nordic_pca10095/src/hal_bsp.c
+++ b/hw/bsp/nordic_pca10095/src/hal_bsp.c
@@ -61,6 +61,8 @@ hal_bsp_flash_dev(uint8_t id)
     }
 #endif
 #if MYNEWT_VAL(IPC_NRF5340_FLASH_CLIENT)
+    _Static_assert(2 < MYNEWT_VAL(HAL_FLASH_MAX_DEVICE_COUNT) || MYNEWT_VAL(QSPI_ENABLE),
+        "HAL_FLASH_MAX_DEVICE_COUNT must be set to 3 when QSPI_ENABLE is 0");
     if (id == 2) {
         return ipc_flash();
     }
diff --git a/hw/bsp/nordic_pca10095/syscfg.yml b/hw/bsp/nordic_pca10095/syscfg.yml
index d0b287647..1a8dbc1fe 100644
--- a/hw/bsp/nordic_pca10095/syscfg.yml
+++ b/hw/bsp/nordic_pca10095/syscfg.yml
@@ -108,6 +108,9 @@ syscfg.vals.BSP_NRF5340_NET_ENABLE:
 syscfg.vals.BSP_NRF5340_NET_FLASH_ENABLE:
     IPC_NRF5340_CHANNELS: 4
 
+syscfg.vals.IPC_NRF5340_FLASH_CLIENT:
+    HAL_FLASH_MAX_DEVICE_COUNT: 3
+
 syscfg.restrictions.BSP_NRF5340_NET_FLASH_ENABLE:
     - 'IPC_NRF5340_CHANNELS >= 4'