Skip to content

GIGA: Faults when I remove a device that has connected. #38

Closed
@KurtE

Description

@KurtE

I am experimenting trying to create a USBSerial object that supports other adapters other than just CDC ACM. Such as FTDI, PL2303... Also will probably support CDC as well.

I was using version 0.2.0 of the library with USBHostConfig.h updated:

//#undef MBED_CONF_PLATFORM_CALLBACK_NONTRIVIAL
//#define MBED_CONF_PLATFORM_CALLBACK_NONTRIVIAL  0
//#include "Callback.h"

And some stuff is working. Although running into several other issues, such as failing to read in 18 byte device descriptor when the device is configured for 8 byte control endpoint #32 and that one hits in several different ways.

However, when I do succeed in having a device connect, when I unplug the device, the GIGA goes into the RED led blink of a crash.

I have now synced up to your current stuff which includes #35 and it still occurs. Also if I put those three lines mentioned above back in, the code faults on startup.

I ran the binary using hardware debugger under Ozone, and when I unplugged the adapter (PL2303), the fault happened at the address:

The target stopped in HardFault exception state.

Reason: A fault with configurable priority has been escalated to a HardFault exception at 0x0805E144.

For more information about analyzing faults on Cortex-M, refer to:
https://wiki.segger.com/Cortex-M_Fault.

image

I objdump the elf file and looked:

0805e144 <_ZZN4mbed8CallbackIFvvEE8generateIZNS2_C4IP19USBHostSerialDeviceMS5_FvvELi0EEET_T0_EUlvE_vEEvOS9_E3ops>:
 805e144:	080418bf 	stmdaeq	r4, {r0, r1, r2, r3, r4, r5, r7, fp, ip}
 805e148:	08041699 	stmdaeq	r4, {r0, r3, r4, r7, r9, sl, ip}
 805e14c:	08041587 	stmdaeq	r4, {r0, r1, r2, r7, r8, sl, ip}
 805e150:	4253555b 	subsmi	r5, r3, #381681664	; 0x16c00000
 805e154:	464e495f 			; <UNDEFINED> instruction: 0x464e495f
 805e158:	25203a4f 	strcs	r3, [r0, #-2639]!	; 0xfffff5b1
 805e15c:	64253a73 	strtvs	r3, [r5], #-2675	; 0xfffff58d
 805e160:	5355205d 	cmppl	r5, #93	; 0x5d
 805e164:	736f4842 	cmnvc	pc, #4325376	; 0x420000
 805e168:	72655374 	rsbvc	r5, r5, #116, 6	; 0xd0000001
 805e16c:	446c6169 	strbtmi	r6, [ip], #-361	; 0xfffffe97
 805e170:	63697665 	cmnvs	r9, #105906176	; 0x6500000

I have a lot of the debug outputs enabled. Last parts:


[,U,S,B,_,T,R,ANSFER: c:\Users\kurte\Documents\Arduino\libraries\Arduino_USBHostMbed5\src\USBHost\USBHost.cpp:1115]----- BULK READ [dev: 0x2400c914 - Serial - hub: 0 - port: 1 - addr: 1 - ep: 83]------
READ SUCCESS [8 bytes transferred - td: 0x240018AF] on ep: [0x2400c39c - addr: 83]: 2C 2A 31 45 0D 0A 24 47 

[,U*S1BE_
T
R$AGNSFER: c:\Users\kurte\Documents\Arduino\libraries\Arduino_USBHostMbed5\src\USBHost\USBHost.cpp:1115]----- BULK READ [dev: 0x2400c914 - Serial - hub: 0 - port: 1 - addr: 1 - ep: 83]------
READ SUCCESS [8 bytes transferred - td: 0x240018CB] on ep: [0x2400c39c - addr: 83]: 50 52 4D 43 2C 2C 56 2C 

[PURSMBC_,T,RVA,NSFER: c:\Users\kurte\Documents\Arduino\libraries\Arduino_USBHostMbed5\src\USBHost\USBHost.cpp:1115]----- BULK READ [dev: 0x2400c914 - Serial - hub: 0 - port: 1 - addr: 1 - ep: 83]------
READ SUCCESS [7 bytes transferred - td: 0x240018AF] on ep: [0x2400c39c - addr: 83]: 2C 2C 2C 2C 2C 2C 2C 

[,U,S,B,_,T,R,ANSFER: c:\Users\kurte\Documents\Arduino\libraries\Arduino_USBHostMbed5\src\USBHost\USBHost.cpp:1115]----- BULK READ [dev: 0x2400c914 - Serial - hub: 0 - port: 1 - addr: 1 - ep: 83]------
READ SUCCESS [8 bytes transferred - td: 0x240018CB] on ep: [0x2400c39c - addr: 83]: 2C 2C 4E 2A 35 33 0D 0A 

[,U,SNB*_5T3R
A
NSFER: c:\Users\kurte\Documents\Arduino\libraries\Arduino_USBHostMbed5\src\USBHost\USBHost.cpp:1115]----- BULK READ [dev: 0x2400c914 - Serial - hub: 0 - port: 1 - addr: 1 - ep: 83]------
[USB_DBG: c:\Users\kurte\Documents\Arduino\libraries\Arduino_USBHostMbed5\src\USBHost\USBHost.cpp:507]FREE INTF 0 on dev: 0x2400c91c, 0x2400c914, nb_endpot: 2, Serial
[USB_INFO: c:\Users\kurte\Documents\Arduino\libraries\Arduino_USBHostMbed5\src\USBHost\USBHost.cpp:524]Device disconnected [0x2400c914 - Serial - hub: 0 - port: 1]

I am running the USBHostSerialToSerial example sketch. The code is up at:
https://github.com/KurtE/GIGA_USBHostMBed5_devices

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions