This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Nordic51822AA hrs project can not enter main SDK12.3

Hi, First,i want to develop my project via SDK12.3 hrs project. I download the SD and app in hrs project in SDK12.3 via Keil ,but it does not work. I enter debug mode and find it can not enter main function(See Picture_1). Picture_1.png

Second,I download the SD and app in experimental_ble_app_blinky project in SDK12.3 via Keil , it can enter main function.I change the clock to NRF_CLOCK_LF_SRC_SYNTH, it works well.(See Picture_2). Picture_2.png

All settings are default setting in the two projects. I doubt the ram(Nordic 51822AA 16K RAM) is not enough in hrs project. what can i do to solve the problem? I want to use hrs project as the reference of my own projcet ,and use Nordic 51822AA 16K RAM to develop.It is better not to replace any of them.

regards, alivexiaoluo.

  • Hi alivexiaoluo,

    if you're using a custom nRF51822 module that does not have the optional 32kHz crystal, then you need to set the internal RC oscillator as the LFCLK source, i.e. you need to modify the NRF_CLOCK_LFCLKSRC in the pca10040.h or custom_board.h to the following

    #define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_RC,            \
    
                                     .rc_ctiv       = 16,                             \
    
                                     .rc_temp_ctiv  = 2,                              \
    
                                     .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM }
    

    Secondly you need to modify the RAM settings so that it takes into account the 16kB of RAM, i.e.

    IRAM1 Start: 0x20001FE8 Size: 0x2018
    

    Best regards

    Bjørn

  • Thanks,Bjørn. I have already solved the problem yesterday,the solution is as you say. I have an another question to consult.As you know,i choose Nrf51822AA (256K Flash 16K RAM) to develop my project.When build the hrs project,the ram remaining for user application is not big enough.I removed the hrs and bat service,but the ram seems not big enough for my application. I wonder,is there a way to save some ram spaces for my project.

    Best regards

    alivexialuo

  • So 0x2018 bytes is not enough for the Heart Rate Sensor application in addition to your own custom code? Are you adding a lot of custom libraries etc?

  • Yes,0x2018 bytes is not enough. When build the hrs project about 5k ram(RW_data 444 ZI-data 4932) spaces used.Only about 3k ram spaces for my own code. 512 bytes for rtt printf.512 bytes for ble protocol. The remains is not enough for my application.

  • The only thing I can think of is to disable the logging module, i.e. set NRF_LOG_ENABLED is set to 0 in sdk_config.h. If that does not free up enough RAM then I am afraid that you will have to go for a nRF51822 variant with 32kB RAM.

Related