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

Facing an issue regarding NRF MEMORY MANAGEMENT(Code Restarts while assigning values to allocated mem)

Hi, I am using the nrf mem_manager library for allocationg multiple dynamic memories in my code. I have done the following

All the devices are getting the allocation for the memory as I am getting success prints ... But while filling the data to these values , the first two dynamically allocated memories (i.e. device1_database,device2_database )get filled with proper data and while filling the third allocated memory (i.e. device3_database) the code restarts . The code snippet of filling the data is shown below:

 Can anyone help me understand what is making the code to restart?

  • Hi

    Are you able to check the memory addresses written to the 4 devicetype pointers after you have run the calls to nrf_malloc(..) ?

    If the code crashes when you try to write to one of the pointers it indicates that it has an invalid memory address. 

    Are you running the code on a standard nRF52DK?

    Best regards
    Torbjørn