nrf_modem_init should document lifetime

Hello,

I'm using the libmodem directly and have to call this function: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfxlib/nrf_modem/doc/api.html#c.nrf_modem_init

I've recently had to spend almost 25 mandays to debug an issue.
It turns out the init_params have to stay alive for the entire duration of the program since libmodem refers to it later.
It's a miracle we've not run into this problem earlier.

This wasn't the case in the past looking at some of the older init code of your zephyr layer.
Around 3-4 years ago that changed where your init code now uses a static.

This change was never mentioned in the changelog and this lifetime requirement is not documented with the function.
It's quite negligent to not document this, it could've bricked 10k+ devices in the field.

So please add some documentation and make a pass over the other API's too to check whether they should have extra documentation too.

Parents Reply Children
No Data
Related