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

sleep and wakeup from RTC

I'm trying to get the nrf52810 (pca10040e s112) to wake up from sleep every 5 second using RTC or timer. My goal is to sleep on less than 2 uA. I'm using the pca10040 development board and the segger IDE. I have seen other posts regarding this (link1link2link3) but i don't find these very helpful, probably because of my skill level. I would be very grateful for a minimal example code if possible.

Parents
  • Hello there,

    Please have a look at our RTC example in SDK15.3 for pca10040. Be aware that this example does not include a project for pca10040e, but please read this user guide.

    Kind regards,
    Øyvind

  • Thank you Øyvind, This example is great.

    I have now been working on merging this RTC example into my own project, that is based on a ble_uart example for the s112 softdevice, but this gives me all kinds of strange errors that probably relate to drivers or includes that are not compatible with each other.

    Is there some guides that will explain how all this works. I seem to keep running in to problems related to adding drivers and preprocessor include path issues.

    There seems to be a lot of users running into these kind of problems. Is this just really complicated or is it just about reading the right guides?

    Thanks in advance,
    Lasse

  • Can you please give some more information regarding what errors you are meeting? 

    There is, unfortunately, no tutorial on how to combine examples. When combining example projects, the best is to start with the more complex example, in your case this is ble_uart. Then add RTC example into this example, adding the same header files etc. Be sure to enable correct peripherals in the sdk_config.h

    Have a look in DevZone, where similar questions has been asked e.g. this thread or this thread.

    Let me know how it goes!

    Good luck!

    -Øyvind

  • Hi Øyvind, Thanks a lot.

    I followed your tip adding lines step by step from the RTC example to the ble_uart and managed to get a step further. Also i found the Nrfx Migration User Guide which seems to address some of the issues i had. 

    Now i don't expect you to keep answering all my newbie questions, but this one would be very helpful

    In your answer you linked to This user guide.
    I would love to be able to transfer more examples from nRF52832 to nRF52810, but is seems that the paragraph "Transferring the project to nRF52810 hardware" is not written for the segger IDE. Specifically i can't find where to change all of the following settings in the segger IDE?

    1. In the project settings, change to device "NordicSemiconductor->nRF52810_xxaa".
    2. In the C/C++ preprocessor settings, remove the defines "NRF52" and "NRF52832_XXAA".
    3. Add the preprocessor define "NRF52810_XXAA".
    4. In the linker script settings, adjust the linker script to match the maximum RAM and flash size of nRF52810.
      • ROM END: 0x2FFFF
      • RAM END: 0x20005FFF

    Cheers Lasse

Reply
  • Hi Øyvind, Thanks a lot.

    I followed your tip adding lines step by step from the RTC example to the ble_uart and managed to get a step further. Also i found the Nrfx Migration User Guide which seems to address some of the issues i had. 

    Now i don't expect you to keep answering all my newbie questions, but this one would be very helpful

    In your answer you linked to This user guide.
    I would love to be able to transfer more examples from nRF52832 to nRF52810, but is seems that the paragraph "Transferring the project to nRF52810 hardware" is not written for the segger IDE. Specifically i can't find where to change all of the following settings in the segger IDE?

    1. In the project settings, change to device "NordicSemiconductor->nRF52810_xxaa".
    2. In the C/C++ preprocessor settings, remove the defines "NRF52" and "NRF52832_XXAA".
    3. Add the preprocessor define "NRF52810_XXAA".
    4. In the linker script settings, adjust the linker script to match the maximum RAM and flash size of nRF52810.
      • ROM END: 0x2FFFF
      • RAM END: 0x20005FFF

    Cheers Lasse

Children
  • Hi Lasse,

    Lasse Hansen said:
    Now i don't expect you to keep answering all my newbie questions, but this one would be very helpful

     This is not a problem at all, this is why we are here. 

    Lasse Hansen said:
    Specifically i can't find where to change all of the following settings in the segger IDE?

     And, I agree that the section is not written for SES. I will try to guide you through the steps, and hopefully get you up and running. A good start is to compare settings in PCA10040 vs PCA10040e. The following steps show how to open the configuration. Also, have a look at the Developing with SES - Getting Started Guide (pdf).

    In SES, make sure to click on the project in project items:

    Now, in the menu, click Project -> Options. This opens the Project Options. Make sure to choose Common settings:

    Next, we'll go through the steps from the User Guide. See my comments in bold. 

    1. In the project settings, change to device "NordicSemiconductor->nRF52810_xxaa".
      • NordicSemiconductor does not apply, but in the search field type: nrf
      • This should give some alternatives to where NRF52 and NRF52832_XXAA are defined.
      • Debugger - Target Device: Double click on value and choose nRF52810_xxAA
      • Please make sure to compare PCA10040 vs PCA10040e project options
    2. In the C/C++ preprocessor settings, remove the defines "NRF52" and "NRF52832_XXAA".
      • See answer above, in Preprocessor Definitions not C/C++ preprocessor settings
    3. Add the preprocessor define "NRF52810_XXAA".
      • Preprocessor Definitions, add NRF52810_XXAA
      • Please make sure to compare PCA10040 vs PCA10040e project options
    4. In the linker script settings, adjust the linker script to match the maximum RAM and flash size of nRF52810.
      • ROM END: 0x2FFFF
      • RAM END: 0x20005FFF
      • The two above does not apply, instead: Under build -> memory segments (searh segments)
        • FLASH RX 0x0 0x30000
        • RAM RWX 0x20000000 0x6000
      • Copy Section Placement Macros from PCA10040e
      • EDIT: Please see this tutorial

    And of course, remember to do step 6 and 7.

    Let me know how this works for you! 

    Kind regards,
    Øyvind

Related