This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

z_arm_secure_fault on nRF9160 using flash_read after upgrade

We appear to be getting a "z_arm_secure_fault" after the call to "flash_read", trying to access what appears to be any area of flash memory using tag v1.3.0.  This call, including accompanying functions for erase and write, were working perfectly on tag v1.0.0 within addresses 0x040000-0x0FFFFF to store sensor readings.  We haven't been able to locate any sort of read protection enable flag/option.  It seems like this could be a simple issue, but we're not sure where to look.  Any ideas?

These are the related options in "prj.conf", which have not changed among the two tag versions:

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF=y

Thanks!

Parents
  • Hi Arthur,

    Please add the following configurations in prj.conf file:

    CONFIG_LOG=y
    CONFIG_FLASH_LOG_LEVEL_DBG=y

    Then share the serial output log.

    (it could be related to v1.3.0 release notes: "Added external flash secondary slot MCUboot. See Flash partitions used by MCUboot.")

    Br,
    Martin l.

  • Hi Martin,

    For whatever reason, adding these lines seems to have not done anything, but we did notice that both of our device binding calls are failing and returning zero.  This is what we had:

    p0=device_get_binding(DT_LABEL(DT_NODELABEL(gpio0)));
    flash=device_get_binding(DT_LABEL(DT_NODELABEL(flash0)));


    The GPIO one was copied from "board.c" in the newest "nrf9160dk_nrf52840" directory.  This is how we found out how to do this before (it used to be "device_get_binding(DT_GPIO_P0_DEV_NAME)"), and it worked then.

    For flash, we tried just "flash" as before, but the compiler seemed to want "flash0".  We also tried "PM_S0_DEV_NAME" as can be seen in "ncs/nrf/tests/subsys/fw_info/src/main.c", but there doesn't seem to be a value defined for it anywhere.

    We're not sure where to look to find out what to use in place of these commands, so any guidance would be appreciated.  This is almost certainly the reason for the crash.  Thanks!

    - Arthur

Reply
  • Hi Martin,

    For whatever reason, adding these lines seems to have not done anything, but we did notice that both of our device binding calls are failing and returning zero.  This is what we had:

    p0=device_get_binding(DT_LABEL(DT_NODELABEL(gpio0)));
    flash=device_get_binding(DT_LABEL(DT_NODELABEL(flash0)));


    The GPIO one was copied from "board.c" in the newest "nrf9160dk_nrf52840" directory.  This is how we found out how to do this before (it used to be "device_get_binding(DT_GPIO_P0_DEV_NAME)"), and it worked then.

    For flash, we tried just "flash" as before, but the compiler seemed to want "flash0".  We also tried "PM_S0_DEV_NAME" as can be seen in "ncs/nrf/tests/subsys/fw_info/src/main.c", but there doesn't seem to be a value defined for it anywhere.

    We're not sure where to look to find out what to use in place of these commands, so any guidance would be appreciated.  This is almost certainly the reason for the crash.  Thanks!

    - Arthur

Children
Related