Hi
I want to migrate my application to Zephyr RTOS platform from old setup given below.
- Old Setup:
Hardware: nRF52832 board.
Soft device: S132
Software: SEGGER Embedded Studio
SDK: nRF5_SDK_15.3.0
- New Setup:
Hardware: nRF52832 board.
Software: visual studio. version (1.87.2)
SDK: nRF Connect for Visual Studio. Version (v2.5.2)
Zephyr RTOS environment with the new setup:
In the ticket, I found out that there is no separate soft device for nRF connect. https://devzone.nordicsemi.com/f/nordic-q-a/83481/nrf-connect-for-vs-code-and-softdevice
I have tried the example code of system_off (https://github.com/nrfconnect/sdk-zephyr/tree/v3.5.99-ncs1/samples/boards/nrf/system_off) on my customized board and measured the current using the joule scope meter (I am not using PPK2 setup). My device is consuming around 1mA of current.
According to the given value in the data sheet it should consume in 0.3µA. In my case it is not.
I have also testing the following listed functions in the nRF connect SDK by creating a new project and no other major functions used, but still the current consumption is around 1mA only.
- k_cpu_idle();
- k_sleep(K_FOREVER);
- rc = pm_device_action_run(cons, PM_DEVICE_ACTION_SUSPEND);
if (rc < 0) { printf("Could not suspend console (%d)\n", rc);
return 0; }
sys_poweroff(); -
NRF_POWER->DCDCEN=1;
while(true);
With the old setup:
In my last project, using nRF SDK 15.3.0 with soft device S132. I am using the following power management functions to put the device into low power mode.(from the nRF SDK example "ble_app_buttonless_dfu")
static void idle_state_handle(void)
{
if (NRF_LOG_PROCESS() == false)
{
nrf_pwr_mgmt_run();
}
}
void powerManagementInit(void)
{
uint32_t err_code = nrf_pwr_mgmt_init();
APP_ERROR_CHECK(err_code);
}
sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE);
Now I want to port into the Zephyr RTOS platform,
- What configuration adjustments in the nRF Connect SDK project would be necessary to achieve the same functionality (deep sleep mode, ideal mode/low power mode)?
- What other possible settings must I make in order to maintain the same functionality of my code since Zephyr RTOS does not support independent soft devices? There are no libraries in Zephyr RTOS that support soft devices.?
- In the "ble_app_buttonless_dfu" example code we have below function. what is the equivalent API to be used while porting into the Zephyr RTOS.
// Initialize the async SVCI interface to bootloader before any interrupts are enabled. err_code = bleDfuButtonlessAsyncSvciInit(); APP_ERROR_CHECK(err_code);
I've already opened a ticket regarding the porting task, but I wasn't sure how to move forward in this case: https://devzone.nordicsemi.com/f/nordic-q-a/110919/porting-the-application-from-nrf5_sdk_15-3-0-to-the-nrf-connect-sdk-for-vs-code . Since there is no 1-1 mapping of API of all functionalities as these SDK work on different fundamental concepts of one being baremetal and the other being RTOS based.
Please advise how to proceed with the VS code for the nRF Connect SDK Zephyr RTOS as I am finding difficulty in mapping the each functionality.
Kindly assist me with this issue of porting from nRF SDK to NCS for VS Code as I am stuck.
Your input will be appreciated.
Regards,
Naveed