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

esp_tinyuf2 firmware update (IDFGH-12092) #13150

Closed
3 tasks done
kaspernyhus opened this issue Feb 9, 2024 · 8 comments
Closed
3 tasks done

esp_tinyuf2 firmware update (IDFGH-12092) #13150

kaspernyhus opened this issue Feb 9, 2024 · 8 comments
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@kaspernyhus
Copy link

kaspernyhus commented Feb 9, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.1.2

Operating System used.

Linux

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

What is the expected behavior?

Use esp_tinyuf2 along features from the esp_tinyusb component

What is the actual behavior?

not compiling/linking

Steps to reproduce.

add to idf-component.yml

## IDF Component Manager Manifest File
dependencies:
  espressif/esp_tinyuf2: "^0.2.0"
  espressif/esp_tinyusb: "^1.4.3"

Build or installation Logs.

No response

More Information.

I am developing an appication that will use UF2 for firmware updates and other usb features found in the esp_tinyusb component. Is is possible to have these features at the same time? Booting between modes for UF2/non-UF2 is fine, if the tinyusb stacks have to be initialized with different paramters.

@kaspernyhus kaspernyhus added the Type: Bug bugs in IDF label Feb 9, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Feb 9, 2024
@github-actions github-actions bot changed the title esp_tinyuf2 and esp_tinyusb in the same project esp_tinyuf2 and esp_tinyusb in the same project (IDFGH-12092) Feb 9, 2024
@kaspernyhus kaspernyhus changed the title esp_tinyuf2 and esp_tinyusb in the same project (IDFGH-12092) esp_tinyuf2 firmware update (IDFGH-12092) Feb 9, 2024
@tore-espressif
Copy link
Collaborator

tore-espressif commented Feb 13, 2024

Hello @kaspernyhus thank you for the issue.

That is a very reasonable requirement, however, at the moment these two components do not work together.
What specific feature from esp_tinyusb do you need? It should be feasible to merge features from esp_tinyusb to esp_tinyuf2 as they are both based on TinyUSB

cc @leeebo

@kaspernyhus
Copy link
Author

Hi Tomas, thanks for getting back.

I need HID and USB Audio which I pulled into esp_tinyusb in a fork of idf-extra-components here

Which approach would you recommend:

  1. merge the features (hid and audio) from esp_tinyusb into esp_tinyuf2
  2. pick UF2 functionality from esp_tinyuf2 and build on top of MSC in esp_tinyusb

thanks a lot!

@leeebo
Copy link
Contributor

leeebo commented Feb 15, 2024

Is it possible to have these features at the same time?

@kaspernyhus Yes, I recommend you pick the esp_tinyuf2 code to your tinyusb project, just like what you have done for adding UAC class to esp_tinyusb. (add uf2 related source files and modify the descriptors and so on.)

Booting between modes for UF2/non-UF2 is fine

If you have enough flash space, it's a good idea to build a separate UF2-enabled APP then flash to a separate partition, in this case you don't need to merge the code. please refer boot-from-test-firmware and the esp-box chatgpt demo

@StevenMacias
Copy link
Contributor

Is it possible to have these features at the same time?

@kaspernyhus Yes, I recommend you pick the esp_tinyuf2 code to your tinyusb project, just like what you have done for adding UAC class to esp_tinyusb. (add uf2 related source files and modify the descriptors and so on.)

Booting between modes for UF2/non-UF2 is fine

If you have enough flash space, it's a good idea to build a separate UF2-enabled APP then flash to a separate partition, in this case you don't need to merge the code. please refer boot-from-test-firmware and the esp-box chatgpt demo

@leeebo thank you so much for your answer. I have checked the boot-from-test-firmware documentation. Is it only possible to boot from a test partition by using a GPIO pin? Is there any method that can be used to software reboot in a different partition? Thanks again!

@leeebo
Copy link
Contributor

leeebo commented Feb 20, 2024

@StevenMacias Sure, you can use API esp_ota_set_boot_partition to choose boot partition, please refer https://github.com/espressif/esp-box/blob/master/examples/chatgpt_demo/factory_nvs/main/main.c#L41C5-L41C31

@StevenMacias
Copy link
Contributor

@leeebo Thanks again for the fast and useful reply. Currently we are using the idf.py uf2-ota command to generate the .uf2 files. How we could include the UF2-enabled APP in the .uf2 firmware? We are interested on separating the stacks as you suggested but also on being able to update both the main application and the UF2-enabled APP.

@leeebo
Copy link
Contributor

leeebo commented Apr 22, 2024

@StevenMacias If using UF2-enabled APP + normal uf2 app, the UF2-enabled APP works as the special featured app / "bootloader", if you want to update it, an additional partition "UF2-enabled APP2" needs to be add.

Then you have to judge by the uf2 file name, and choose corresponding partition to write during the OTA process.

@kaspernyhus
Copy link
Author

Thanks for the help, we went the simple route with one uf2 partition. Will close this.

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new labels Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

5 participants