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

gettng NRF_ERROR_NO_MEM when initiating a bond in Peer Manager

I'm starting to get things moved over to Peer Manager in SDK11 and when I call pm_conn_secure I get NRF_ERROR_NO_MEM. When reading the manual it states that this error means:

"NRF_ERROR_NO_MEM If there is no more space in flash."

flash? Doesn't the bond information go into the fsd file system on fstorage? Is there some config that needs to happen to make things fit?

I have 11 custom UUIDs discovered from the custom service on my peripheral role radio code when I make the call. Is there some limit on the amount of data that can be cached? Im running on a NRF511422XXAC device.

  • it would have to be private. I know we have an NDA in place, however it's going to have to go through the lawyers on this one since there might be other IP that I cannot share due to other contracts. I can go through the fstorage/fds code and see what they are assuming and see what is in the linker files. I'm wondering if the standard linker files that I am using from the sdk11 stack dirs isn't reserving the space and the code grew into it. the fds code must have a signature there that is trashed with the code load and it then throws a no mem error.

  • it looks like fstorage starts at the end of flash and works backwards. I'm on an xxAC NRF51 part and I'm only using around 12K hex of flash (on both my peripheral code as well as the other central role project) so there should be plenty of room as there are 25K hex avail. I'm comparing the two projects right now and seeing if there are any differences since I don't see this error on my peripheral code base.

  • so it looks like the docs are wrong. They state that NO_MEM means no space in the flash. My central code wasn't using the macro to build the ble enable param struct and was only setting the number of centrals and peripherals manually (this was fine before as I wasn't using security) there is a param in there for the number of SMP instances which was set to zero in my previous code. Switching over to using the macro put it at 1 and I no longer get the NO_MEM return code. The docs should be updated to remove the "no more space in flash" description and put in that there isn't enough SMP instances to handle the security operation.

  • Petter see my answer as I figured it out eventually and it was a doc issue that was the cause of my confusion

  • Great that you figured it out. I'm guessing the error code originates from sd_ble_gap_authenticate() then? Above it in ble_gap.h it is written: @retval ::NRF_ERROR_NO_MEM The maximum number of authentication procedures that can run in parallel for the given role is reached. Maybe this should be the description of NRF_ERROR_NO_MEM in relation to pm_conn_secure(). I'll report it. Thanks.

Related