Skip to content

Get more specific error when R/TX buffers are out of resource #4981

@mohammad1603

Description

@mohammad1603

Description

  • Type: Bug
  • Priority: Minor

Target
K64F
Toolchain:
GCC_ARM

Toolchain version:
GCC 6

mbed-os sha:
latest tag

Expected behavior
More specific error when TX buffers go out of resources

explain:
in handshake flow, the "mbed_lwip_sendto()" function is called, when the flow reaches "k64f_low_level_output()" this function calls " osSemaphoreAcquire()" which returns osErrorResource which is translated by the lwip code to “ERR_BUFF – 0xfe” and by the higher level lwip code to
"NSAPI_ERROR_DEVICE_ERROR - 0xfffff43c"

The "NSAPI_ERROR_DEVICE_ERROR" is too generic in this case and we want more specific error for this case in order to be sure that waiting and calling the "mbed_lwip_sendto()" after resources are available can return with success.

We are trying to prevent a situation that we are in a loop and getting "NSAPI_ERROR_DEVICE_ERROR" from another reason.

Actual behavior
Getting more specific error value which say that the R/TX buffers are out of resource and the application can try again later after resources are available again.

Steps to reproduce
The issue happens during DTLS handshake in debug mode only.
attached the call stack:
2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions