We have been using the nrf9160 successfully for several month. I'm currently upgrading our products to use the new modem firmware (1.2.0) and, together with that, to the most recent version of the bsdlib. The function bsdinit() was changed to take a parameter, which I find somewhat underdocumented:
Since, to my knowledge, the lib uses it's own memory area that needs to be configured in the linker file, all I could guess to pass as parameters are those values. This is what I do:
bsd_init_params_t initParams; initParams.trace_on = false; initParams.bsd_memory_address = BSD_RESERVED_MEMORY_ADDRESS; initParams.bsd_memory_size = BSD_RESERVED_MEMORY_SIZE; int retval = bsd_init(&initParams);
The function returns -1 and errno is set to 12 = "Cannot allocate memory".
This is the documentation for those parameters:
/**@brief Structure for bsd library initialization parameters. */ typedef struct { bool trace_on; /**< Indicates the traces are in use. */ uint32_t bsd_memory_address; /**< Defines the bsd library memory address. */ uint32_t bsd_memory_size; /**< Defines the bsd library memory size. */ } bsd_init_params_t;
With the version 0.6.0 of bsdlib (where there was no parameter to bsd_init()) we had no such issues.
So - what is going wrong and what values am I supposed to set in that parameters?
Any help is appreciated, thanks