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

BSD error codes

extern void bsd_recoverable_error_handler(uint32_t error)

AND

extern void bsd_irrecoverable_error_handler(uint32_t error);

Will return various error codes - is there a list to decipher what they mean? Especially error code 3 seems frequent...
Parents Reply Children
  • Haakon,

    Thanks for your reply. The fix for the referenced errata is applied. Still there are occurrences of the error (Especially 3).

    1. I find that usually it is the recoverable error that is thrown. However - I find it that the link is not really recoverable. Meaning socket operations to the modem will never return. Alas - I do not know error code 3 - so hard to tell what is actually going on.

    2. Is there any steps required when recovering from recoverable error handler through any of the API calls in bsdlib?

  • vkbakken said:
    1. I find that usually it is the recoverable error that is thrown. However - I find it that the link is not really recoverable. Meaning socket operations to the modem will never return. Alas - I do not know error code 3 - so hard to tell what is actually going on.

    In this case, you should be able to close the socket, then reopen a new one without the application going into a bad state. What example are you running, and how are you handling the socket? 

    vkbakken said:

    2. Is there any steps required when recovering from recoverable error handler through any of the API calls in bsdlib?

    That would depend on where you are in your process. Close the socket, and try to open it. If you still get an error, could you check the signal strength using at_client (AT+CESQ)?

     

    Kind regards,

    Håkon

  • Alrighty,

    I was kind of hoping to eak out what error 3 was...

    Now - sockets are always closed after use - so they are not held open as this is pretty poor practice. In my case UDP data is sent, an ACK received and socket closed. So I would say that suggested fix is not working. This is product specific code - but generally based on the asset_tracker.

    Given the CSQ response - what do you suggest should be done based on strength?

  • 3 == generic internal error. a catch all error.

    In the last field of the CESQ command, you get the RSRP, which is provided in a integer, where the received signal is calculated: -140 + <num> = <my_current_signal_strength>

    If you are around the receiver sensitivity (~-103 to -108 dBm, depending on band etc), you might see issues.

    In general, I would recommend you to check if your current modem fw is up to date, as this can have a great impact on the overall stability. You can download the latest modemfw here:

    https://www.nordicsemi.com/Products/Low-power-cellular-IoT/nRF9160/Download#infotabs

     

    Kind regards,

    Håkon

  • Haakon

    Not sure if I am able to follow your suggestion. What I see is that when I try to recover from error 3 - then the SDK seems locked in an endless loop calling this function:

    int32_t bsd_os_timedwait(uint32_t context, uint32_t timeout)

    So there is no way I can simply close a socket and continue....
Related