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

Port ft90x #1768

Merged
merged 15 commits into from
Jan 30, 2023
Merged

Port ft90x #1768

merged 15 commits into from
Jan 30, 2023

Conversation

brtchip-gdm
Copy link
Contributor

@brtchip-gdm brtchip-gdm commented Nov 30, 2022

Describe the PR
This PR will add FT9xx support for more of the USB device examples.
There are fixes for the FT9xx MCU port. Fixes for properly handling back-to-back transactions on the control endpoint as EP0 must always be enabled and receiving - extended to all OUT endpoints. Prevent interrupt endpoints from transmitting ZLPs.
Signal xfer completions correctly (multiple for OUT transfers). Remove unnecessary volatile qualifiers.
Build flags and function names renamed to ft9xx/ft90x/ft93x to indicate target MCU support.
LED and BUTTON definitions added for mm900evxb boards (LED on CN2 pin 4 and BUTTON on CN2 pin 6).
Current device examples tested board_test, cdc_dual_ports, cdc_msc, dynamic_configuration, hid_boot_interface, hid_multiple_interface, msc_dual_lun, uac_headset, webusb_serial.
Update FT9xx SDK to the v2.6.0 release (submodule Bridgetek/ft90x-sdk).
Add an implementation for chip_reboot when hardware library is not included.
Additional Context
A newer version of the FT9xx SDK is available.
More testing has been performed with other examples resulting in bug fixes.
Hardware lacks an LED and a button. This has been implemented using the CN1 connector. Instructions for adding the requried hardware have been added to the readme for the board.

brtchip-gdm and others added 11 commits November 24, 2022 12:17
The SetLineCoding would fail as host would send the SETUP OUT phase before tinyUSB had setup a transaction for it. ft9xx port would ignore the transfer since there was no valid transaction setup for it. One SETUP data phase packet is cached now.
Correct USB FIFO use for setup data phases (OUT transfers). We cannot stop traffic on the control endpoint so we set a flag and pull data from host when tinyUSB requests it from the USB FIFO. Extend this for all endpoints although currently not required.
Rename all instances of ft90x which can apply to ft93x as ft9xx.
Add support for the cdc_dual_ports example for ft9xx.
Add LED pin definition for board LED in a simple to access place on the Bridgetek MM900EVx boards.
Fix handling of interrupt endpoints. i.e. no ZLPs.
Fix the assignation of endpoint types.
Add button support for MM900evx boards.
On board support do not block for UART input.
$(FT90X_TOOLCHAIN) or even $(TOP) may have spaces. Quote to fix.
Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR and sorry for the delay. I still haven't set up my PC to actually compile ft90x port yet. Therefore I could only review the code-only, it looks good except for the include of tinyprint.h whose path is missing from family.mk. Please double check.

#define GPIO_ETH_LED1 62
#define GPIO_REMOTE_WAKEUP_PIN 18
#define USBD_VBUS_DTC_PIN 3
#include <tinyprintf.h>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"tinyprintf.h" is included but its path ($(TOP)/$(FT9XX_SDK)/3rdparty/tinyprintf" is not added to INC +=. I still haven't compile with ft90x yet, please double check to see if path is needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, indeed. Sorry, that file was used for debugging and was included in recent work on the sdk as you found. It's not required in TinyUSB and I've updated the PR to reflect this and tested against the latest code.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no problem at all, this is why including port build in the ci is important. We should try to this in the future. ( I still need to get my PC setup to give this port a try).

Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look good now, thank you for the PR and your patient

@hathach hathach merged commit b03a688 into hathach:master Jan 30, 2023
@brtchip-gdm brtchip-gdm deleted the port-ft90x branch January 30, 2023 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants