ARMmbed / mbed-os

Arm Mbed OS is a platform operating system designed for the internet of things
https://mbed.com
Other
4.67k stars 2.98k forks source link

nRF52840 DTLS test MbedOS Error Code: 311 Rtos Event flags Error occurs. #13394

Closed ghost closed 3 years ago

ghost commented 4 years ago

Description of defect

I'm using sample source code from this link. https://os.mbed.com/docs/mbed-os/v6.2/apis/secure-socket-apis.html

I change the sample to use DTLS and connect using psk to COAP server, send simple packet and receive ACK. I attached modified source code. 13_5_DTLS coap err only debug.zip When Server is online and psk password is correct code works fine. The problem is when time out set and server is not responding or psk is not mach to server I got MbedOS Error(Rtos Event flags Error) at the end. You can check 3 condition below.

Could you please guide me understand why I got MbedOS Error and how to get rid of it? I appreciate your time.

1.When Server is online, psk password is correct. I have no problem. (no MbedOS Error occurs )this is the log

nRF52840 Built: Aug 6 2020, 14:03:20 Mbed OS version 6.2.0 Connecting to network DTLS ConnectedDTLS: Sent 29 Bytes to xxx.xxx.xxx.xxx Received from echo server 8 Bytes Done

I start to check error patterns and are they handling correctly. these are patterns that I checked.

  1. When Server is not online. I got mbed MbedOS Error.

    nRF52840 Built: Aug 6 2020, 13:56:22 Mbed OS version 6.2.0 Connecting to network [ERR ][TLSW]: mbedtls_ssl_handshake() failed: -0x6900 (-26880): SSL - No data of requested type currently available on underlying transport DTLS connect error xxx.xxx.xxx.xxx:5684. error code = [-3013] Done ++ MbedOS Error Info ++ Error Status: 0x80010137 Code: 311 Module: 1 Error Message: EventFlags: 0x200070BC, Parameter error Location: 0x22797 Error Value: 0x200070BC Current Thread: shared_event_queue Id: 0x20000DE0 Entry: 0x24AB5 StackSize: 0x800 StackMem: 0x20000E28 SP: 0x2003FF30 For more info, visit: https://mbed.com/s/error?error=0x80010137&tgt=NRF52840_DK -- MbedOS Error Info -- = System will be rebooted due to a fatal error = = Reboot count(=5) reached maximum, system will halt after rebooting =

After long debugging i remove this line(which is I need). then MbedOS Error gone. I don't know why. sock.set_timeout(SOCKET_TIMEOUT);

  1. When Server is online but psk is not match to server. I change psk and test it. got same MbedOS Error

nRF52840 Built: Aug 6 2020, 14:03:20 Mbed OS version 6.2.0 Connecting to network [ERR ][TLSW]: mbedtls_ssl_handshake() failed: -0x7780 (-30592): SSL - A fatal alert message was received from our peer DTLS connect error xxx.xxx.xxx.xxx:5684. error code = [-3011] Done ++ MbedOS Error Info ++ Error Status: 0x80010137 Code: 311 Module: 1 Error Message: EventFlags: 0x200070B4, Parameter error Location: 0x2278B Error Value: 0x200070B4 Current Thread: shared_event_queue Id: 0x20000DD8 Entry: 0x24AA9 StackSize: 0x800 StackMem: 0x20000E20 SP: 0x2003FF30 For more info, visit: https://mbed.com/s/error?error=0x80010137&tgt=NRF52840_DK -- MbedOS Error Info -- = System will be rebooted due to a fatal error = = Reboot count(=6) reached maximum, system will halt after rebooting =

Target(s) affected by this defect ?

nRF52840 DK

Toolchain(s) (name and version) displaying this defect ?

arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]

What version of Mbed-os are you using (tag or sha) ?

checked in both versions. result is same. (both tag version) Mbed OS version 6.0.0 release version Mbed OS version 6.2.0 release version

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

mbed-cli 1.10.0

How is this defect reproduced ?

define host_name isn't online in main.cpp, change network connectivity in mbed_app.json compile and run the code.

0xc0170 commented 4 years ago

cc @ARMmbed/mbed-os-ipcore

ciarmcom commented 4 years ago

Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers. Internal Jira reference: https://jira.arm.com/browse/IOTOSM-2158

ciarmcom commented 3 years ago

We closed this issue because it has been inactive for quite some time and we believe it to be low priority. If you think that the priority should be higher, then please reopen with your justification for increasing the priority.