Context:  SDKV11 s132 nrf52 Eclipse
Two inter-related problems:
1/
CHECK_RAM_START_ADDR outputs:
RAM START ADDR 0x20002BD8 should be adjusted to 0x20002840
RAM SIZE should be adjusted to 0xD7C0
on the next line
softdevice_enable outputs
sd_ble_enable: RAM START at 0x20002BD8
sd_ble_enable: app_ram_base should be adjusted to 0x20002A1
ram size should be adjusted to 0xD5F0
I am happy to read the documentation, but seem unable to find the right stuff.  What do these apparently conflicting error messages mean?
2/  probably related
If I include this line:  
err_code = pm_init()  // initialize the peer manager

then I get no output on the SEGGER RTT channel.
Even if I simply link in the pm module, but don’t call, or  reference it. (i.e. I don’t remove unused modules in linker) RTT still goes quiet.
It seems likely that there is some conflict in the memory layout that I don’t yet understand. Again, could you refer me to the appropriate documentation.

————-

Hi Michael,
1)  You should change the ram base address in your project setttings.  For KEIL it will be in the Project_settings->Target->IRAM1 settings. For GCC it will be .ld file in your project.
The softdevice migration guide (comes with softdevice zip file) explains you how softdevice reserves RAM for its use when it is enable and disabled. Application should make sure that it does use the RAM that is used by the softdevice. From your output it seems that you have not changed your application project settings to change the IRAM1 start address and size. You should do that. With softdevice version change only its usage of ROM and RAM is affected. The settings of the application is done in application project to make sure that it reflects the new start address and size.
2)  I am not sure if I get what you mean. What does peer manager (pm_init) have to do with RAM settings? Maybe pm_init failed and your application is not checking the error?
/Susheel
————–
Susheel,   First, I want to thank you for your swift and apposite response.  I much appreciate you guys at Nordic!
Ah…  the migration document.  I feel embarrassed.  I skimmed it when I upgraded and was looking in documents with more specific titles.  I will wear “sackcloth and ashes” while I re-read it more carefully, and get back if there is something I don’t understand, or close out the query.  Thank you.
The pm_init appears indirectly to set up persistent memory in flash, and I wondered if perhaps there was some flash-layout issue relating to the first message.  I plan to see if my homework fixes problem #1, and then maybe #2 will evaporate.
Again, thank you so much for your PROMPT help.  You did good!
————-
OK I read the document.
I’m using Eclipse/GCC.  I changed my .ld file, blindly using the R/W memory numbers in the migration document, and ran it again.

MEMORY{  FLASH (rx) : ORIGIN = 0x1c000, LENGTH = 0x64000  RAM (rwx) :  ORIGIN = 0x20002800, LENGTH = 0xd800}

Here is some output from the following code fragment:

    //Check the ram settings against the used number of links
    CHECK_RAM_START_ADDR(CENTRAL_LINK_COUNT,PERIPHERAL_LINK_COUNT);
    // Enable BLE stack.
    err_code = softdevice_enable(&ble_enable_params);

0> RAM START ADDR 0x20002800 should be adjusted to 0x20002840
0> RAM SIZE should be adjusted to 0xD7C0 

0> sd_ble_enable: RAM START at 0x20002800
0> sd_ble_enable: app_ram_base should be adjusted to 0x20002A10
0> ram size should be adjusted to 0xD5F0
0>
0> Error: NRF_ERROR_NO_MEM file:  // error returned from softdevice_enable(&ble_enable_params)

Notice the conflicting suggestions again.  

Change RAM START ADDR   to 0x20002840 size 0xD7C0
Change app_ram_base     to 0x20002A10 size 0xD5F0


But I changed to the values suggested by “sd_ble_enable”

MEMORY
{
  FLASH (rx) : ORIGIN = 0x1c000, LENGTH = 0x64000
  RAM (rwx) :  ORIGIN = 0x20002a10, LENGTH = 0xd5f0
}

Now the program runs correctly, but outputs these conflicting messages:

0> RAM START ADDR 0x20002A10 should be adjusted to 0x20002840
0> RAM SIZE should be adjusted to 0xD7C0 
0> sd_ble_enable: RAM START at 0x20002A10
So which call is the one to believe?



Leave a Reply