Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usbus_cdc_ecm: failed assertion when host reboots #19663

Closed
benpicco opened this issue May 24, 2023 · 0 comments · Fixed by #19664
Closed

usbus_cdc_ecm: failed assertion when host reboots #19663

benpicco opened this issue May 24, 2023 · 0 comments · Fixed by #19664
Assignees
Labels
Area: USB Area: Universal Serial Bus Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Comments

@benpicco
Copy link
Contributor

benpicco commented May 24, 2023

Description

After a reboot I found my RIOT USB device unresponsive. It turns out it failed an assertion when the host rebooted.

Steps to reproduce the issue

Run the tests/sys/usbus_cdc_ecm application and reboot the host system.
In this case I had the Device USB port of the saml21-xpro connected to a Raspberry Pi and the Debug USB port connected to my laptop.

Expected results

Normal operation continues

Actual results

2023-05-24 18:12:34,954 - INFO # > sys/usb/usbus/usbus.c:285 => 
2023-05-24 18:12:34,956 - INFO # Context before hardfault:
2023-05-24 18:12:34,958 - INFO #    r0: 0x0000001d
2023-05-24 18:12:34,959 - INFO #    r1: 0x00000020
2023-05-24 18:12:34,961 - INFO #    r2: 0x00000019
2023-05-24 18:12:34,963 - INFO #    r3: 0x00000173
2023-05-24 18:12:34,964 - INFO #   r12: 0x00000019
2023-05-24 18:12:34,966 - INFO #    lr: 0x0000e867
2023-05-24 18:12:34,968 - INFO #    pc: 0x00000172
2023-05-24 18:12:34,969 - INFO #   psr: 0x21000000
2023-05-24 18:12:34,969 - INFO # 
2023-05-24 18:12:34,970 - INFO # Misc
2023-05-24 18:12:34,972 - INFO # EXC_RET: 0xfffffffd
2023-05-24 18:12:34,974 - INFO # Active thread: 3 "usbus"
2023-05-24 18:12:34,978 - INFO # Attempting to reconstruct state for debugging...
2023-05-24 18:12:34,979 - INFO # In GDB:
2023-05-24 18:12:34,980 - INFO #   set $pc=0x172
2023-05-24 18:12:34,981 - INFO #   frame 0
2023-05-24 18:12:34,982 - INFO #   bt
2023-05-24 18:12:34,984 - INFO # *** RIOT kernel panic:
2023-05-24 18:12:34,985 - INFO # HARD FAULT HANDLER
2023-05-24 18:12:34,985 - INFO # 
2023-05-24 18:12:34,994 - INFO # 	pid | name                 | state    Q | pri | stack  ( used) ( free) | base addr  | current     
2023-05-24 18:12:35,003 - INFO # 	  - | isr_stack            | -        - |   - |    512 (  488) (   24) | 0x20000000 | 0x200006a8
2023-05-24 18:12:35,012 - INFO # 	  1 | main                 | bl mutex _ |   7 |   1536 (  676) (  860) | 0x2000100c | 0x20001424 
2023-05-24 18:12:35,021 - INFO # 	  2 | ipv6                 | bl rx    _ |   4 |   1024 (  544) (  480) | 0x200016e8 | 0x200019cc 
2023-05-24 18:12:35,030 - INFO # 	  3 | usbus                | running  Q |   1 |   1024 (  892) (  132) | 0x200004dc | 0x2000075c 
2023-05-24 18:12:35,039 - INFO # 	  4 | cdcecm               | bl anyfl _ |   2 |    896 (  300) (  596) | 0x20002030 | 0x200022f4 
2023-05-24 18:12:35,046 - INFO # 	    | SUM                  |            |     |   4992 ( 2900) ( 2092)
2023-05-24 18:12:35,046 - INFO # 
2023-05-24 18:12:35,047 - INFO # *** halted.

-> https://github.com/RIOT-OS/RIOT/blob/master/sys/usb/usbus/usbus.c#L285

Versions

RIOT master

@benpicco benpicco added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: USB Area: Universal Serial Bus labels May 24, 2023
@bors bors bot closed this as completed in #19664 May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: USB Area: Universal Serial Bus Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants