Maximum exceeded for refPositionSampleMap

can someone explain this warning i find in my system log and how to avoid this?

user.warn Legato: -WRN- | posDaemon[1770]/framework T=main | safeRef.c le_ref_CreateRef() 547 | Safe reference map maximum exceeded for refPositionSampleMap, new size 5057

In my app i make large use of:


cause i suscribe:

posHandler = le_gnss_AddPositionHandler(PositionReceivedHandler, NULL);

but i correctly release at the end of related handler:

static void PositionReceivedHandler(le_gnss_SampleRef_t positionSampleRef, void* contextPtr){

Maybe event are not related… but if they are maybe i’m doing something not correct.

Same for this log line:

Jun 5 19:33:47 swi-mdm9x28-wp kernel: [ 155.043058] gpio_check_and_wake: wake-n_gpio26 STATE=WAKEUP
**Jun 5 19:33:47 swi-mdm9x28-wp user.err kernel: [ 155.058836] swimcu_gpio_irq_event_handle: Re-enabled irq 1 type B for MCU GPIO 2 **
Jun 5 19:33:47 swi-mdm9x28-wp kernel: [ 155.065586] gpio_check_and_wake: wake-n_gpio26 STATE=SLEEP

i see again and again buth i have no interaction with gpio26… nor i use it ad wakeup source naturally.


wake-n_gpio26 is for internal usage, you can ignore this message

BTW, what is the actual problem you faced for " Safe reference map maximum exceeded for refPositionSampleMap?

Good morning.
about refPositionSampleMap I think I’m in a classic producer-consumer problem.
I’ve component A receiving position events cause it subscribes le_gnss_AddPositionHandler.
On other isde I’ve componet B that is responsible to send this postions over the network.
Naturally B is slower than A (low network, connection lost orto recover etc.).
So… in case B is not fast enough to dequeue refPositionSampleMap seems to grow too much.
I’ve no control on items in refPositionSampleMap, cause it belongs to platform service, so i cant refuse new additions.

That seems my problem now.


in component A, inside PositionReceivedHandler(), you don’t need to directly call component B to send data.
You can use some global variable to save it.
In this case, you can immediately do le_gnss_ReleaseSampleRef().

You can then create another thread or timer to read these global variable and ask component B to send to network.

I’ve tried with tread as first solution but the app stops working with message “call to Component B on a different Thread”. I used a Timer with a local variable and it worked.