I'm trying to put the nRF9160 into System Off mode and am getting a bus fault error when writing to the REGULATORS module. This is the error output:
***** BUS FAULT ***** Precise data bus error BFAR Address: 0x40004500***** Hardware exception *****Current thread ID = 0x200245f8Faulting instruction address = 0x412daFatal fault in thread 0x200245f8! Aborting.
I first set the modem to power off using ```lte_power_off()```, and then call ```nrf_regulators_system_off(NRF_REGULATORS_NS);```
I'm calling this from a non-secure app. Do I have to add configuration in the bootloader to allow non-secure access to the REGULATORS registers? Are there additional steps to configure before going into System Off mode?
Hi Jack,Sorry for my confusion.
Basically we need to set the regulators in non-secure to be able to use it:
To set the Regulators in non-secure we can add this in the spm.c:
PERIPH("NRF_REGULATORS", NRF_REGULATORS_S, CONFIG_SPM_NRF_REGULATORS_NS),
And we need to set it as default non-secure in the Kconfig file:
bool "Regulators is Non-Secure"
From the serial output you can confirm that the Regulators are set in Non-Secure:
Thanks for the response.
So I have been using an older version of the SDK and had no idea that so much had changed. I was still using secure_boot instead of spm. And I have EM Studio v4.14. Just wondering if you guys have a plan to get to a standard bootloader for the nRF9160? Is secure_boot obsolete? Don't they pretty much do the same thing by configuring security around all of the peripherals?
I just downloaded all the latest SDKs and EM Studio v4.16. I'm trying to run the spm sample and am getting build errors for 2 things that are not defined.
DT_FLASH_AREA_IMAGE_0_NONSECURE_OFFSET_0 undeclared. (line 26 in spm.c)
NRF_P0 undeclared (line 317 in spm.c)
Am I missing any configs for these?
Another issue I'm having:
I'm noticing in the board directory in Zephyr for the nrf9160 there is an inconsistency. The nRF Connect documentations says to use the branch "nrf91", however this branch does not have definitions for "nrf9160_pca10090ns". Master does have the definitions, however, when I try to open the "spm" sample with the master branch of Zephyr I get "Project load failed".
CMake Error at C:/Users/jpanetta/Documents/Dignity/nrf91-2/Zephyr/cmake/kconfig.cmake:194 (message): command failed with return code: 1Call Stack (most recent call first): C:/Users/jpanetta/Documents/Dignity/nrf91-2/Zephyr/cmake/app/boilerplate.cmake:500 (include) CMakeLists.txt:3 (include)
-- Configuring incomplete, errors occurred!Project load failedReported error: solution load command failed (1)
The "Secure_boot" name has been changed to "Secure Partition Manager" (SPM) to comply with the Platform Security Architecture (PSA).It basically does the same thing as you may know from what you know from the "secure_boot".
The new feature with the NCS v0.4.0 release is that you do not need to build the SPM sample separately as you may remember from "secure_boot".
When building an application it will default build the compliant SPM for that application and it will also make a merged.hex file for your convenience when you are going to flash.
This is how you flash with SES v4.16.
However, the error you are getting is most likely because the you are not using the correct versions of the repositories.
Please do the following to get the latest recommended tagged version of NCS.
git checkout master
git checkout v0.4.0
2.) The nrf91 branch is deprecated, you are most likely reading that from an old version of the "Getting started assistant"?This is the latest documentation for NCS.I highly recommend you to go through the updated (latest version: v.0.9.2)"Getting Started Assistant" in nRF Connect for Desktop to see that you have done all the correct steps with the updated information.
Thanks for your response! I upgraded to v0.4.0 of the SDK and am now able to build & run the spm bootloader. I am also able to build & run my application.
One thing I noticed is, it looks like the AT_Client sample has changed. I was running the at_host in my application before as a debugging tool to talk to the modem. I can't seem to run it in my app after updating the sdk. I see that the new at_client sample doesn't have a main while() loop so its obviously running in some new way now. How can I run the AT_Host client on UART_0 in my application?
Hi Jack,You are correct that the at_client sample has changed.
It is now easier to add the at_host library into your application.
There are three options on how to enable the at_host library your application.
1.) You can add:
in the prj.conf file of your application.
2.) Enable the at_host library via 'menuconfig' in the command line:
3.) Enable it in SES IDE