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

About memory error after adding a VS service (using Embedded Studio)

Hi,

I have just added a VS service (PCA10040, s132 7.0.1, embedded studio v5.10a x64)and I understand I need to increase the ram given to the softdevice. However, I have try to add the followings in "Section Placement Macros".

FLASH_PH_START=0x0

FLASH_PH_SIZE=0x100000

RAM_PH_START=0x20000000

RAM_PH_SIZE=0x40000

FLASH_START=0x26000

FLASH_SIZE=0x5a000

SRAM_START=0x20002260

SRAM_SIZE=0xddc0

However, the program still crash when calling "err_code = nrf_sdh_ble_enable(&ram_start)".

The debug log is saying that I didn't change any macros

[2020-09-11_18:55:53:331]<info> app_timer: RTC: initialized.
[2020-09-11_18:55:53:331]<warning> nrf_sdh_ble: Insufficient RAM allocated for the SoftDevice.
[2020-09-11_18:55:53:331]<warning> nrf_sdh_ble: Change the RAM start location from 0x20002250 to 0x20002260.
[2020-09-11_18:55:53:331]<warning> nrf_sdh_ble: Maximum RAM size for application is 0xDDA0.
[2020-09-11_18:55:53:372]<error> nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.
[2020-09-11_18:55:53:372]<error> app: Fatal error

Could you suggest how I can change them?

Jones

Parents
  • Hi,

    SRAM_START and SRAM_SIZE should be named RAM_START and RAM_SIZE by default, maybe that's why the settings aren't applied in your case? And please remember to update RAM_SIZE according to the log output. The current RAM setting will lead to a hardfault if you are running the code on a pca10040 board.

    Also, note that the FLASH_PH_SIZE and RAM_PH_SIZE are for the nRF52840 (1MB flash and 256KB RAM), not the nRF52832 which has 512KB flash and 64KB RAM.

    Best regards,

    Vidar

  • Hi Vidar,

    Thank you for your quick reply.

    Do you mean FLASH_PH_SIZE, FLASH_PH_START, RAM_PH_SIZE and RAM_PH_START are mutually exclusive to FLASH_SIZE, FLASH_START, RAM_SIZE and RAM_START?

    Could you give me example on what should be needed for nRF52832 and nRF52840?

    Do this MACROS of nRF52832 different from nRF52810?

    Thanks,

    Jones

  • Hi Jones,

    FLASH_PH_* and RAM_PH_* specifies the total memory address range for the chip, while FLASH_* and RAM_* is for the application only.

    Jones said:

    Could you give me example on what should be needed for nRF52832 and nRF52840?

    Do this MACROS of nRF52832 different from nRF52810?

     Please use the existing SDK examples as reference.

Reply Children
No Data
Related