-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add new Espressif target esp32s3 for tinyUSB #783
Conversation
Hi @alisitsyn :) There seem to be changes included that need to be reverted, like submodules being removed. Also to make the changes more clear, is it possible to not include the new example? |
Hi @me-no-dev,
The branch update is in progress (rebase to the latest master) and will be ready after testing soon.
My intention is not addition of a new example but update the existing espressif examples to be able to compile them for new added board based on new esp32s3 chip - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your PR. It is great to have the new ESP32-S3 chip added. The changes look good, though I have a few feedback
- Please revert the submodules removal. They are important and needed to build for other platforms :)
- Can you move the esp32s3 into it own family
hw/bsp/esp32s3
similar to esps2, it will help to group similar driver such as board_init() and ws2812 driver.
CI also needs to be update to build with esp32s3, though I could help with that.
Since PR status is WIP, I converted it to Draft. Feel free to push new update, I will try to follow up with feedback. Whenever you think it is ready for a merge, just Mark is as ready to covert it back.
examples/rules.mk
Outdated
|
||
all: | ||
idf.py -B$(BUILD) -DBOARD=$(BOARD) build | ||
all flash monitor dfu-flash dfu : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, I didn't know we could do this
examples/rules.mk
Outdated
ifeq ($(findstring esp32s, $(BOARD)), esp32s) | ||
$(info Vendor: $(VENDOR), family: $(CHIP_FAMILY), target: $(CHIP_TARGET)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not all board has esp32s2 or esp32s3 in their name, we should just use the CHIP_FAMILY. It is good enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit I was based on contains the names of the espressif boards started with target prefix like esp32s2_saola_1
. This looked useful for me. This was updated accordingly as it is in latest master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name like Adafruit funhouse or tinyS2 etc. won't help esp32s2 or s3. It will cause issue with other boards in the future. The $(VENDOR) variable will probably be removed as well. I don't see the use of it in the make. Board name is already uniquely defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see now. The unique board name is enough to determine all required information as $(CHIP_TARGET), $(FAMILY)
and so on.
hw/bsp/esp32s2_kaluga_1/board.mk
Outdated
CFLAGS += \ | ||
"-DCFG_TUSB_MCU=OPT_MCU_ESP32S2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seem like this line isn't needed, I didn't see it on other board.mk
Thank you for your feedback and advices.
It seems that submodules were removed incidentally by script.
I am going to move it into the separated family folder
I updated the CI scripts to work with |
no problem at all, just make sure you revert it
I actually think it is better to keep family separated as
Great, I am looking forward your next push. |
49c9f8a
to
5873201
Compare
Actually the ESP32S (like F4 for STM) is the family and ESP32-S2, ESP32-S3 are actual chips inside this family. I personally think that this is logically correct. It is not an issue to follow your approach from make standpoint. As I understand the structure will be like below. Is this correct?
The CI test for |
@me-no-dev , Unfortunately I can not add you to reviewers. Could you take a look to update and give me your comments? Thank you. |
Yeah, this is correct. Normally MCUs within families is only slightly different in ram & rom, pinout (and maybe an extra peripheral). I thought esp32s3 is totally different with extra core. Though you guys at espressif apparently understand it better, if you think their cores and peripheral is similar enough to be in the same group. So yes, please go ahead with
In both cases, the dcd file should only be one file
This wouldn't an issue, can you tell me at which branch it works, I will see if I could quickly modify ci to get it build (also have some local testing as well). If it is not easy, we could temporarily disable its build. |
Hmm, that is weird, I am sure he is one of repo contributors, in any case, I have added him as reviewer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good already, please keep it that way. No need to separate s2 and s3. Ignore my previous comment, since I thought s2 and s3 are totally different due to addition of new core and ble 😅 . This look great already. I will try to have some hand-on testing and will provide more feedback soon.
@hathatch,
You are right about the ESP32-S3. It has enough differences (cores, different peripheral and memory changes) and I can see the reason to divide them into two different family folders. I think it is better to get team opinion about this, cc @me-no-dev.
The USB IP are almost the same, so agree it is better to keep the one device controller driver for them. I also saw the #382 but it is better to keep existing driver for now.
The branch with the required update is in the internal system. I can provide the patch to fix the actual hal/soc in esp-idf master. Thank you for your comments. I will contact you ASAP. |
Actually, it is not a big deal, this bsp family folder thing is just an way to organize boards for testing stock examples in tinyusb repo. It should not make much of differences. Since most end-user people will just IDF platform, arduino or micropython/circuitpython. It is not really that important and can be easily changes later on if needed. One of the tip to see if we should split or not is when you see lots of #ifdef in source/cmake etc .. I will leave it up to you to decide, I am fine with either way.
Yup, later on I would like to abstract the synopsys driver enough so that stm and esp32s can share functions (much like ehci, ohci). Currently stm32f receive lots of improvement and enhancement regarding iso, fifo scheme/optimization. But it doesn't apply to esp32s just yet due to lack of time for testing. But that is for later PRs.
Actually, I am fine with testing it, we can just comment out the build for esp32s3 in ci matrix board build for now, so that ci won't block other PRs. We could always enable later on by a flip of the comment. Our focus should only on the file changes. Give me a bit of time, I am still catching up with review :) |
add support of new esp32s3 target and the board update the roles.mk wrapper to allow dfu flashing of espressif chip update examples to allow compilation for esp32s3_addax_1 board once the code is tested the PR to original tinyusb repo will be submitted
c96f189
to
10cd6fd
Compare
`hw\bsp` separate one family folder to esp32s2, esp32s3 add board specific board.cmake file to override board specific options(features) fix examples and test scripts to use new family approach
10cd6fd
to
91e5740
Compare
I agree with your opinion and pushed new commit to update PR according to our discussion. Please take a look when possible.
This is a good idea and I can take a look to update later in order to apply changes to espressif driver.
I rebased on master and pushed new commit to this PR to group boards using the target name as family. The esp32s3 based board was commented out in board matrix. Still have issues with Thanks you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, everything look good now. I have a couple of minor comments. Since I have do a merge from (master) to fix rp2040 build, I take the chance to update the PR according to the comment as well. I think this PR is ready to merge, unless you still plan to push more update ( let me know if you do ).
Update: look like rp2040 still failed, I think we can safely ignore this. Will fix it later if it still failed when merged.
The updates look good to me do not have anything to add. Please merge this PR ASAP in spite of rp2040 failures. My esp-idf MR will be merged then. Thank you. |
Merged now, thank you very much for your PR 👍 👍 |
Thank you very much for your support. 👍 |
I am the one to say thank :) |
remove unused submodules rebese `merge pull request hathach#783`: Add new Espressif target esp32s3 for tinyUSB (esp-based_on_334e95f) These submodules are not needed when TinyUSB is built as an ESP-IDF component. We remove them to avoid fetching extra submodules when ESP-IDF is cloned with --recursive flag. Note: this is a local change, not for upstream.
Hello @hathach, There was the delay with merging of esp-idf tinyusb support on esp32s3 , but it was finally merged. Could you help to reenable CI test support for |
@alisitsyn no problem, done via #840 |
Thank you very much! 👍 |
No problem, you're welcome |
What happened in this PR
This PR adds support of a new Espressif chip ESP32-S3 into tinyusb project.
The chip peripheral is very similar compare to ESP32-S2 target and support is added as a family driver to allow following extension of the family and group the controllers with similar USB peripheral.
tinyusb/src/portable/espressif/esp32sx/dcd_esp32sx.c
hw/bsp/esp32s2
andhw/bsp/esp32s3/
(better from support standpoint) and new esp32s3 based board inhw/bsp/esp32s3/boards/espressif_addax_1/*
.hw/bsp/esp32s3/boards/espressif_addax_1/board.cmake
(example for esp32s3).hw/bsp/esp32s3/family.mk
is updated to specify target chip and add new make targets to flash the board using dfu-flash utility.hid_composite_freertos
,cdc_msc_freertos
,board_test
to allow selection of different target boards.make BOARD=espressif_addax_1
command.The compiled example can be flashed into the target board using the commands below:
make BOARD=espressif_addax_1 dfu
- generates the dfu image for softwaremake BOARD=espressif_addax_1 dfu-flash
-flashes the dfu image into target boarddfu-flash documentation for ESP32-S2
The
soc/hal
layers in ESP-IDF are already updated in esp-idf tinyusb support on esp32s3 to support the new chip.