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

Unstable S140 softdevice release (s140_nrf52840_5.0.0-2.alpha) ?

Hello, for the past I've been trying to migrate unsuccessfully my code from nrf51 to nrf52840 S140. Now that I'm unsuccessful, I'm trying to eliminate the possibility of a hardware (I'm using my own custom board) error by trying to get the official examples (ble_hrs) up and running on my board.

Then I encountered a variety of problems, most notably that I couldn't get the synth clock or the RC clock up and running, and the lf clk configuration register can't seem to be modified for some reason.

Today all the problems are miraculously gone, I did not do anything, and the same happened to not only the official example but also my own project, which is extremely odd.

Nevertheless I proceeded forward with my own project, but got stuck at sd_ble_uuid_vs_add function. I tried to add custom uuid, but couldn't and it returns 0x04 NRF_ERROR_NO_MEM.

So It turned out that I may have not set

ble_cfg.common_cfg.vs_uuid_cfg.vs_uuid_count

to a value that is >0.

The thing is, right after I set it to 1, just 1, I keep getting NRF_ERROR_NO_MEM when using sd_ble_enable, it keeps returning NRF_ERROR_NO_MEM.

The above happened to my own project. So I did the same to the official example (ble_hrs) and tried to replicated this error. But it doesn't happen.

So naturally I came to the conclusion that there must be some steps which I skipped and I decided to remove some initialization functions of the official example to see what they are - things I may have skipped which caused my program's downfall. After several trial and error attempts, I now come to the conclusion that it is none of them, because sometimes it gives no memory error, some times it doesn't, even if I don't do anything at all, other than reseting the chip and run. More specifically, after the NRF_ERROR_NO_MEM error, if I wait for a good 20 minutes or so, it may very well be hunky dory.

I don't know what to make of all this. But a tldr version:

  • After changing the value of ble_cfg.common_cfg.vs_uuid_cfg.vs_uuid_count from 0 to a none 0 value, API call

    softdevice_enable

Sometimes return NRF_ERROR_NO_MEM, sometimes don't and execute properly. No apparent pattern has being detected, all seem random.

Oh and if you followed my progress somehow, you probably remember that softdevice_enable won't return the "recommended" APP_RAM_BASE, it still doesn't, but instead of ALWAYS giving NRF_ERROR_NO_MEM, it now properly executes sometime.

Parents Reply Children
No Data
Related