Hello I would like to know when nrf51822 (SDK v12.3 with SD S130 ) advertising timeout and system goes to sleep , how could I retain the ram data so the MCU could work properly when it is woke up by other event? Thanks.
Hello I would like to know when nrf51822 (SDK v12.3 with SD S130 ) advertising timeout and system goes to sleep , how could I retain the ram data so the MCU could work properly when it is woke up by other event? Thanks.
Hi
When using the SoftDevice you should use the sd_power_ramon_set() function to access the RAMON register.
To enable RAM retention both in system ON and system OFF make sure to set both the OFFRAM0/1 fields and the ONRAM0/1 fields.
Best regards
Torbjørn Øvrebekk
Thanks Torbjørn. Turns out I discovered my problem is the device got RESET when the advertisement got timeout.
I suppose this is because I have some ADC operation going on and the timer and ppi wakes up the mcu from deep sleep.
I have modified ble_advertising.c to change the action of advertising time out from system off to WFE and the problem is solved.
Thanks Torbjørn. Turns out I discovered my problem is the device got RESET when the advertisement got timeout.
I suppose this is because I have some ADC operation going on and the timer and ppi wakes up the mcu from deep sleep.
I have modified ble_advertising.c to change the action of advertising time out from system off to WFE and the problem is solved.