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

New parameters to bsd_init()

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

Parents Reply
  • Hi again,

    I'm sad to report, that I still get the same error I got before. I updated to current version (0.7.7), and I still get error 12 whenever I set `trace_on=false`. I tried replacing

        initParams.bsd_memory_size = BSD_RESERVED_MEMORY_SIZE;

    with

        initParams.bsd_memory_size = BSD_RESERVED_MEMORY_SIZE_TRACE_DISABLED;

    Still, error 12. It does not seem that 0.7.7 fixes this issue (there is no mention of it in the release notes either).

Children
No Data
Related