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

nRF52832 ram_retention demo not working with factory supplied hex file

Hello. We are now starting our review to customize code for the pending use of the Nordic devices in low power mode. Have a mix of Nordic kits now. Using the nRF52832 (PCA10040) kit, downloaded the nRF5_SDK_14.2.0 which offers the ram_retention demo for PCA10040 and PCA10056 (nRF52840 based kit).

The nRF52840 pre-compiled hex file appears to work as documented when applied on the PCA10056 nRF52840 Preview DK.

LED #1 turns ON upon a reset -> a few seconds later -> LED #1 turns OFF. All LEDs are OFF. PB # 1 press turns on LED #2. This is the correct behavior.

Repeat the above using the factory PCA10040 firmware (nRF5_SDK_14.2.0_17b948a\nRF5_SDK_14.2.0_17b948a\examples\peripheral\ram_retention\hex) on the nRF52832 kit and the results are:

LED #1 turns ON upon a reset -> a few seconds later -> ALL LEDs turn ON (this is wrong behavior). PB # 1 press turns on LED #2. This is the correct behavior.

In attempting to debug to the best of our limited knowledge, the hard fault is being triggered - if we comment out that routine, the "all leds on" is no longer being enabled.

What is the issue here? Something local with our kit or silicon revision?

What we wish to achieve is to place the pending nRF52832 based module to sleep to save power (wish to run off coin cell battery for as long as possible) -> upon receiving a port pin toggle / trigger -> wake up the Nordic based module and broadcast a value of xx and than back to sleep again. For now, wish to evaluate the power down / up modes.

Will keep testing and update this post if the results change for the better Slight smile

Thanks in advance for any feedback.

  • Hello Kumar,

     So it is step 3 your PCA10040 board turns ON all the LEDS? This happens every time you test it?

    Could you go through and debug your code to see where it fails and what error codes you get?

    (I would also recommend you to check out the Power Management Example)

  • Hello Martin. Thanks for your reply.

    1)  Yes, on step 3 - all LEDs are on but only if we use the PCA10040 kit. Would you please test the same .hex file (drag & drop) from the hex folder for the ram_retention example? LED1 will be on for about a second and then all LEDs are on.

    We have tested the pre-compiled example supplied with SDK 14.2 and also older SDK 11.0 with the same results.

    2) From our IAR debug trace, it appears that the following routine is being called - when we halt the trace, the while(1) perm loop inside this routine is where we end up.

        // This code will only be reached if System OFF did not work and will trigger a hard-fault which will
        // be handled in HardFault_Handler(). If wake the up condition is already active while System OFF is triggered,
        // then the system will go to System OFF and wake up immediately with a System RESET.
        display_failure();

    3) If we drag & drop the pre-compiled code example from the hex folder for the PCA10056 kit, all LEDs do not light up so this must confirm the Nordic CPU did indeed enter OFF state?

    4) Not clear on the difference between the HardFault_Handler() and this display_failure(void).

    5) We do not believe we have the proper tools to confirm the lower power consumption of your processor. Is the Power Profiler kit (shield p/n NRF6707) suitable to use with the PCA10040 & PCA10056 kits? Can we then observe in real time the power being consumed by the processor?

  • Hello Kumar,

     1.) I could reproduce your issue. Unfortunately, the "drag-and-drop" of a .hex file over to the device can be unstable as you also have seen. 

    "The correct way": If you want to program your device with a precompiled .hex file, you can use "nRFgo studio" (easiest) or better yet use the "nRF5x Command Line Tools" which is the prefered way of flashing the device. 

    Or you could compile the project and flash it through the IDE of your choosing. (I recommend SES since it's a great IDE and also free if you use nordic chips)

     

    The Power Profiler kit is an affordable, flexible tool that measures the real-time power consumption of your designs. It also just had a major software upgrade so it it works even better than before, and the PPK can be used in conjunction with the nRF5x DK to measure current on the nRF5x DK or on an external board. (documentation)

  • Hello Martin. This post is to confirm that using nRFgo studio works perfectly with the factory demo. Repeated again with the drag & drop and it failed. Very strange since the PCA10056 kit works fine with drag & drop. Coming from using mbed tools, thought this method was acceptable but now we know better Slight smile

    Thanks for your prompt assistance and also your comments on the PPK. We will order one today so we can review the current draw and make our attempts to run this board (soon to be replaced with one of your design partner's module) off a coin cell battery.

Related