Commit Graph

9020 Commits

Author SHA1 Message Date
hathach
42d4f7c81e remove the old attach duplicated logic, debouncing skip should take care of it. 2025-04-28 15:10:03 +07:00
hathach
2c1414b4c1 usbh: add roothub debounncing flag to ignore attach/remove event on the roothub that is currently doing debouncing delay 2025-04-28 14:59:32 +07:00
Ha Thach
a22e45b816 Merge pull request #3100 from wavenumber-eng/get_deps_fix
Fixed broken deps on a fresh clone
2025-04-28 10:36:29 +07:00
Eli Hughes
f392b4c91d Added initial support for FRDM-MCXA156 and fixed up a crash with MCXN947
I will be porting tinyuf2 to MCXA156 and N947 and need this work in place.

This is the 1st step before bringing in support for other MCX devices.

We had previous patched https://github.com/hathach/mcux-sdk.git'  for MCX support as it was not pulically available

I updated get_deps to point to the mcux-sdk version 2.16.10 from NXP. I repointed the entry in the get_deps script to use NXP MCU repo.  The existing current code couldn't build as the MCUXpresso SDK was old.

- For now, I put a copy of fsl_spc.c in the drivers folder for the mcx family.  None of the ports could build with the version in the mcux github sdk.  The sdk on github has version 2.4.0.   The SDK package that can be downloaded with the SDK generator uses 2.4.2.  All of the clock_config routines use versions of the datastructure from 2.4.2.  For now, keeping an updated copy in hw/bsp/mcx/drivers so we can build against the latest mcuxpresso sdk and enable MCXA156.  I'll file an issue on the nxp github.

- Cleaned up the MCX family.c a little bit.  the MCXA/N these chips don't have SCT so I removed the neopixel code.

- fixed a clock init issue w/ N947 that was causing it to crash when initializing the uart.

- I tested the cmake and make scripts on the A153,A156 and N947 using the CDC/MSC sample.  All worked OK.

- Patched get_deps so it will do a fetch/check on a new folder.  Some of the deps were failing on a fresh clone of tinyusb

- Fixed  lpc51,54 and lpc55 make/cmake files to build with mcuxpresso sdk 2.16.10  The folder structure for flexcomm/uart changed a little bit

- lpc55s59 libpower_hardabi.a no longer is included in mcuxpressosdk, (fsl_power.c is replacement). remove of libpower_hardabi.a from the linker config.  LPC55 still works as expected.

- Using tinyuf2 get deps
2025-04-27 09:42:42 -04:00
Eli Hughes
0937a2b2d3 using get-deps from tinyuf2 2025-04-27 09:38:18 -04:00
Ha Thach
b5d4d0f623 Merge pull request #3096 from hathach/usbh-improve-hub
Usbh improve hub
2025-04-24 23:02:18 +07:00
hathach
b5b7a4be60 hub check status before get 1st device descriptor 2025-04-24 22:21:38 +07:00
hathach
093720f60b fix build 2025-04-24 18:08:00 +07:00
hathach
0f784e8a07 refactor hub driver and move port reset on connection change to usbh.
hub: add hub_port_get_status_local(), ignore resp in hub_port_get_status(pot != 0)
usbh properly deboucning with hub/rootport accordingly to usb specs, also add 10ms of reset recovery
2025-04-24 17:59:45 +07:00
Ha Thach
1afe8a0039 Merge pull request #3095 from fenugrec/ex_cmake_CM0
examples cmake: fix gcc flag -mcpu=cortex=m0
2025-04-24 10:46:14 +07:00
hathach
89f8d0cffb add tuh_address_set() API
minor rename and move code around
2025-04-24 10:41:00 +07:00
fenugrec
736b1d50bc examples cmake: fix gcc flag -mcpu=cortex-m0 2025-04-23 16:04:42 -04:00
Ha Thach
8b3c558881 Merge pull request #3093 from hathach/refactor-usbh-bus-info
refactor(usbh) improve the usage of bus info
2025-04-23 20:08:38 +07:00
hathach
9a1f690ec4 move usbh ctrl_xfer into usbh_data 2025-04-23 16:50:58 +07:00
hathach
a2da575793 rename and expose tuh_bus_info_get() to application 2025-04-23 16:03:40 +07:00
hathach
741cb3cf02 rename hcd_devtree_info_t to tuh_bus_info_t, hcd_devtree_get_info to hcd_bus_info_get
streamline bus info to usbh_devies, also replace dev0 (renamed to dev0_bus)
2025-04-23 12:35:32 +07:00
Ha Thach
b632686f54 Merge pull request #3080 from HiFiPhile/enum_racing
host: fix enumerate racing
2025-04-23 10:41:14 +07:00
HiFiPhile
b6170c965f Compile fix.
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-04-22 21:14:04 +02:00
hathach
8f9ef7dfbe reduce ENUM_DEBOUNCING_DELAY_MS to 200ms
replace dev0.enumerating by enumerating_daddr for better clean up on unplugging while enumerating
move controller_id & enumerating_daddr into _usbh_data struct
2025-04-22 22:09:06 +07:00
hathach
940fe43e68 move removing dev0 to process_removing_device() 2025-04-22 17:33:37 +07:00
HiFiPhile
7ba63a6302 Also cleanup unaddressed device.
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-04-22 16:58:13 +07:00
HiFiPhile
3c4e6a779d Move decouncing delay before USB reset.
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-04-22 16:58:12 +07:00
HiFiPhile
9f096ac56b host: fix enumerate racing
- if a previous enumeration failed _ctrl_xfer status could stuck, it needs to be cleared before next attempt.
- after _dev0.enumerating is reset in hcd_event_handler(), if an attach event arrived before _ctrl_xfer clean up in remove event, a racing condition will happen.

Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-04-22 16:58:10 +07:00
Ha Thach
18d7a993be Merge pull request #3075 from maximevince/dwc2-proper-attach-debouncing
dwc2/host: attach debouncing fixes
2025-04-21 22:46:15 +07:00
hathach
5725d33121 improve usbh stability with failed setup send, prevent control stage locked out 2025-04-21 20:39:23 +07:00
Ha Thach
56ed51c8fb Merge pull request #3088 from HiFiPhile/intv
Fix 1st nak retry one frame shorter.
2025-04-21 18:31:43 +07:00
HiFiPhile
b3a9b6e37f enable SOF interrupt only if not already enabled
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-04-19 11:43:28 +02:00
Ha Thach
5572168994 Merge pull request #3077 from HiFiPhile/ping_out 2025-04-19 00:03:51 +07:00
hathach
d51863d1a0 - correctly do_ping if received nyet as transfer complete e.g msc 31 byte command
- correctly carry out OUT transfer when PING is ack
2025-04-18 22:46:37 +07:00
HiFiPhile
1efc9007b2 Merge branch 'dwc2-proper-attach-debouncing' of github.com:maximevince/tinyusb into dwc2-proper-attach-debouncing 2025-04-18 14:58:59 +02:00
HiFiPhile
b3d20442e2 Fix usbh racing later.
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-04-18 14:57:53 +02:00
HiFiPhile
4c6736c277 Merge branch 'master' into dwc2-proper-attach-debouncing
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-04-18 14:54:20 +02:00
hathach
8111e53ff0 minor rename 2025-04-18 18:21:42 +07:00
hathach
2fd0301f0e Merge branch 'master' into fork/HiFiPhile/ping_out
# Conflicts:
#	src/portable/synopsys/dwc2/hcd_dwc2.c
2025-04-18 17:59:38 +07:00
HiFiPhile
b7a26cc33c Fix 1st nak retry one frame shorter.
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-04-18 12:46:20 +02:00
Ha Thach
e44f556a95 Merge pull request #3072 from maximevince/dwc2-retry-in-token-immediately
dwc2/host: immediately retry IN token for bInterval=1
2025-04-18 17:12:07 +07:00
HiFiPhile
ee1a5dbac0 Merge pull request #3084 from joelpmichael/hcd-template-comments
note potential issues using ep_desc in hcd_edpt_open()
2025-04-18 11:25:59 +02:00
HiFiPhile
91163c9217 Merge pull request #3067 from maximevince/dwc2-host-fix-disconnect
dwc2/host: enable disconnect interrupt + handle it
2025-04-18 11:24:23 +02:00
hathach
1b888a3311 clean up, remove halted_sof_schedule flags since channel_xfer_in_retry() is only called when channel is halted. 2025-04-18 16:17:35 +07:00
HiFiPhile
b6abc9022a Merge remote-tracking branch 'upstream/master' into hcd-template-comments
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-04-18 11:13:15 +02:00
HiFiPhile
7134109973 Update hcd_edpt_open() note.
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2025-04-18 11:12:14 +02:00
Ha Thach
3fd7854a91 Merge pull request #3081 from hathach/usbh-enum-get-string-desc-first
usbh enum get string descriptor length first
2025-04-18 15:24:42 +07:00
hathach
ba45625ea4 minor ci update 2025-04-18 14:29:06 +07:00
hathach
5c7ca2acad change gh ci iar to push event 2025-04-18 12:07:08 +07:00
hathach
e8a84f9076 enum For string descriptor (langid, manufacturer product, serila): always get the first 2 bytes to determine the length first. otherwise, some device may have buffer overflow. 2025-04-18 10:53:12 +07:00
Ha Thach
edbea218b9 Merge pull request #3086 from hathach/ci-add-picow-host
Ci add picow host test
2025-04-17 23:51:50 +07:00
hathach
46d2d4199e run arm-iar with non-forked PR 2025-04-17 21:36:09 +07:00
hathach
0220852a6e - hil test max retry = 3
- fix h7 unused function
2025-04-17 16:58:26 +07:00
hathach
d4983acd3a github ci support setup/install iar toolchain 2025-04-17 16:50:25 +07:00
hathach
3851c7c97a - run arm-iar using github action
- add skip_ci.txt to family folder to skip boards in ci run
2025-04-17 16:07:10 +07:00