Latest main doesn't seem to work on my ESP32
:
esp32_usb_soft_host/usb_test$ git status
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
esp32_usb_soft_host/usb_test$ idf.py set-target esp32
...
esp32_usb_soft_host/usb_test$ idf.py flash monitor
...
<several warnings, see below>
...
Hello world end!
b=0x4008ba0c
a=0x3ffafadc
c=0x3ffafb3c
setDelay =0x400d4d1c
0x400d4d1c: setDelay at esp32_usb_soft_host/usb_test/build/../main/usb_host.c:163
pins 16 17 is OK!
READ_BOTH_PINS = 0000
READ_BOTH_PINS = 0000
READ_BOTH_PINS = 0000
READ_BOTH_PINS = 0000
cpu freq = 160 MHz
TIME_MULT = 77
D= 0 4800 bits in 1935.000000 uSec 2.480620 MHz 6 ticks in 2.418750 uS
D= 126 4800 bits in 5651.000000 uSec 0.849407 MHz 6 ticks in 7.063750 uS
D= 63 4800 bits in 3751.000000 uSec 1.279659 MHz 6 ticks in 4.688750 uS
D= 31 4800 bits in 2801.000000 uSec 1.713674 MHz 6 ticks in 3.501250 uS
D= 47 4800 bits in 3271.000000 uSec 1.467441 MHz 6 ticks in 4.088750 uS
D= 39 4800 bits in 3031.000000 uSec 1.583636 MHz 6 ticks in 3.788750 uS
D= 43 4800 bits in 3161.000000 uSec 1.518507 MHz 6 ticks in 3.951250 uS
D= 45 4800 bits in 3210.000000 uSec 1.495327 MHz 6 ticks in 4.012500 uS
D= 44 4800 bits in 3181.000000 uSec 1.508959 MHz 6 ticks in 3.976250 uS
D= 44 4800 bits in 3191.000000 uSec 1.504231 MHz 6 ticks in 3.988750 uS
TRANSMIT_TIME_DELAY = 46 time = 3.988750 error = -0.281250%
pins -1 -1 is Errors !
pins -1 -1 is Errors !
pins -1 -1 is Errors !
USB0: Ack = 0 Nack = 0 00 pcurrent->cb_Cmd = 0 state = 0 epCount = 0
USB0: Ack = 0 Nack = 44 02 pcurrent->cb_Cmd = 2 state = 3 epCount = 0
USB0: Ack = 0 Nack = 268 02 pcurrent->cb_Cmd = 1 state = 3 epCount = 0
USB0: Ack = 0 Nack = 372 00 pcurrent->cb_Cmd = 0 state = 0 epCount = 0
USB0: Ack = 0 Nack = 372 00 pcurrent->cb_Cmd = 0 state = 0 epCount = 0
USB0: Ack = 0 Nack = 536 02 pcurrent->cb_Cmd = 2 state = 2 epCount = 0
USB0: Ack = 0 Nack = 760 02 pcurrent->cb_Cmd = 2 state = 2 epCount = 0
USB0: Ack = 0 Nack = 764 00 pcurrent->cb_Cmd = 0 state = 0 epCount = 0
I tried with a couple different USB devices and none of them worked - kept seeing only Nack
s.
Any pointers on how to troubleshoot this?
I did see a lot of warnings, many about unused var, discarding volatile
, and packed
attribute being ignored:
[1011/1026] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/usb_test.c.obj
In file included from ../main/usb_test.c:32:
../main/usb_host.h:47:1: warning: 'packed' attribute ignored [-Wattributes]
} sDevDesc;
^
../main/usb_host.h:59:1: warning: 'packed' attribute ignored [-Wattributes]
} sCfgDesc;
^
...
../main/usb_test.c: In function 'kscan0':
../main/usb_test.c:67:10: warning: unused variable 'unum' [-Wunused-variable]
int unum= msg.src / 4;
^~~~
[1016/1026] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/usb_host.c.obj
In file included from ../main/usb_host.c:22:
...
../main/usb_host.c:102:7: warning: initialization discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]
{&GPIO.out_w1tc,&GPIO.out_w1ts},
^
../main/usb_host.c:102:22: warning: initialization discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]
{&GPIO.out_w1tc,&GPIO.out_w1ts},
^
...
../main/usb_host.c: In function 'parseImmed':
../main/usb_host.c:342:15: warning: unused variable 'sIntfCount' [-Wunused-variable]
static int sIntfCount = 0;
^~~~~~~~~~
../main/usb_host.c:341:15: warning: unused variable 'cfgCount' [-Wunused-variable]
static int cfgCount = 0;
^~~~~~~~
...
I tried replacing __packed
with __attribute__((packed))
which made those warnings go away, but still to no avail.