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:30 UTC

[mynewt-core] 03/05: mcu/nrf5340: Add virtual flash for BSP to use

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 2fe15eeb8fe9e0dfe3f94d5839ffd4008fe47c9a
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Fri Apr 9 12:30:55 2021 +0200

    mcu/nrf5340: Add virtual flash for BSP to use
    
    BSP for net core that is going to be build by combine
    image target needs to add vflash to its flash list.
    This provides type and extern that is needed for this,
    just like normal flash device.
---
 hw/mcu/nordic/nrf5340_net/include/mcu/nrf5340_net_hal.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/hw/mcu/nordic/nrf5340_net/include/mcu/nrf5340_net_hal.h b/hw/mcu/nordic/nrf5340_net/include/mcu/nrf5340_net_hal.h
index ceb3acb..3ce2763 100644
--- a/hw/mcu/nordic/nrf5340_net/include/mcu/nrf5340_net_hal.h
+++ b/hw/mcu/nordic/nrf5340_net/include/mcu/nrf5340_net_hal.h
@@ -24,6 +24,8 @@
 extern "C" {
 #endif
 
+#include <hal/hal_flash_int.h>
+
 /* Helper functions to enable/disable interrupts. */
 #define __HAL_DISABLE_INTERRUPTS(x)                     \
     do {                                                \
@@ -46,7 +48,14 @@ struct nrf5340_net_uart_cfg {
 };
 const struct nrf5340_net_uart_cfg *bsp_uart_config(void);
 
-struct hal_flash;
+struct nrf5340_vflash {
+    struct hal_flash nv_flash;
+    const uint8_t *nv_image_address;
+    uint32_t nv_image_size;
+    const struct flash_area *nv_slot1;
+};
+extern struct nrf5340_vflash nrf5340_net_vflash_dev;
+
 extern const struct hal_flash nrf5340_net_flash_dev;
 
 /* SPI configuration (used for both master and slave) */