CC3100SDK: sl_Bind returns -9 after sl_Socket 4 times before correct binding

Part Number: CC3100SDK
Other Parts Discussed in Thread: CC3100

Hello, we are using CC3100 SDK v 1.3.0, and have encountered a problem with socket binding. It is needed to set custom local port in UDP client mode, as such, after sl_Socket, which initializes socket correctly, we use sl_Bind to set necessary local port. function returns -9, and if we are trying again(Without rebooting of module), on fifth time function returns 0, and local port is set correctly. If we reboot module, same happens (function returns -9 and on fifth time, 0) We tried setting a delay between sl_Socket and sl_Bind for up to 1 sec, still same result. I have not found such issue on Errata as well as on forum.

Best regards, Kyrylo

  • Hi,

    This sounds strange.

    Can you elaborate if it happens right after you boot? are you able to work normally for some time (opening and closing sockets) and then it happens, or does it happen immediately on the first socket instance?

    As far as I can tell, the only two options where this error may be returned from sl_Bind() are:

    • socket is out of bounds (valid range is 0 to 14) - what socket number to you get from sl_Socket()?
    • the used socket is no longer valid (for example, you got socket 0 but bind to other socket that is no longer in use)

    Regards,

    Shlomi