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/09 09:13:01 UTC
[mynewt-core] branch master updated: mcu/nrf5340: Fix flash sector
info
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 6951071 mcu/nrf5340: Fix flash sector info
6951071 is described below
commit 6951071d11af74c8d8a538ffedcb6d49b94b49e4
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Tue Apr 6 10:27:36 2021 +0200
mcu/nrf5340: Fix flash sector info
Function nrf5340_net_flash_sector_info was returning wrong
address for all sectors. It was not using hf_base_addr for
calculation and network core flash does not starts from 0
but from 0x1000000. It prevents mcuboot from correctly
identify slot size.
This just takes into account base address of netcore flash.
---
hw/mcu/nordic/nrf5340_net/src/hal_flash.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/mcu/nordic/nrf5340_net/src/hal_flash.c b/hw/mcu/nordic/nrf5340_net/src/hal_flash.c
index 8e36efd..ccc771c 100644
--- a/hw/mcu/nordic/nrf5340_net/src/hal_flash.c
+++ b/hw/mcu/nordic/nrf5340_net/src/hal_flash.c
@@ -131,7 +131,7 @@ nrf5340_net_flash_sector_info(const struct hal_flash *dev, int idx,
uint32_t *address, uint32_t *sz)
{
assert(idx < nrf5340_net_flash_dev.hf_sector_cnt);
- *address = idx * NRF5340_NET_FLASH_SECTOR_SZ;
+ *address = dev->hf_base_addr + idx * NRF5340_NET_FLASH_SECTOR_SZ;
*sz = NRF5340_NET_FLASH_SECTOR_SZ;
return 0;
}