espressif / esp-hal-3rdparty

Apache License 2.0
17 stars 19 forks source link

ESP-IDF release v5.2 #3

Closed robotman2412 closed 6 months ago

robotman2412 commented 7 months ago

I have recently received an ESP32-P4 development kit and I would like to add support for this chip to our OS. Unfortunately, ESP-IDF v5.1 (the highest version on this repo) doesn't support the ESP32-P4.

rftafas commented 7 months ago

Hi.

Are you using sync or release branches as source? Or none yet?

Also, let me put some content context for you.

We don't plan to work on hal5.2 because the projects internally using this repo don't have plans to support P4-preview. That said... We can provide you a 'raw sync' of 5.2. I do NOT suggest using a Sync directly as source. Reason:

THIS IS NOT a public API.

Meaning, if it breaks all your stuff, you will need to fix it on your side. Always. CI and automated testing are highly advised. Users of syncs must 'prepare & test' for sync updates beforehand.

Read carefully the 'read me' as when files get added or removed, new syncs are created and history is rewritten. Same applies when we update the hal. It is a bit nightmarish for 'repo history freaks'.

It carries some dependencies on FreeRTOS that you must take out on your own and port it to your OS. Then, fork the sync, add your changes ( either replace FreeRTOS APIs with your OS APIs or somehow use the FreeRTOS APIs as wrappers to your OS APIs - your call). Initially, you should store it on your own repo, like Zephyr does (Ptal GitHub/zephyr_rtos/hal_espressif).

One thing: THIS IS NOT a public API. Meaning, if it breaks all your stuff, you will need to fix it on your side. Always. Did I already said that? Well, then I also mean that it won't accept feature requests, maybe bug reports.

Sync branches are removed from time to time (another reason to fork it under your control). If you are using a sync branch, let us know.

rftafas commented 7 months ago

Important: Also, not being a public API means 0 documentation. You can read ESP-IDF, NuttX and Zephyr code as example of usage.

Another thing: I suggest using MCUboot, Espressif port as bootloader. It can boot any OS on Espressif devices with minor adjustments out of the box. It doesn't support P4 yet, but if you manage to do it with your OS on any other device, it will be fairly simple to also make it work on P4.

robotman2412 commented 7 months ago

We can work around it by just importing ESP-IDF directly, though that comes with larger file size. And yes, I know there is no support for this. Make your own HAL and all. We just need register definitions for the hardware in the P4.

P.S.: we're currently just using ESP-IDF's bootloader.

rftafas commented 7 months ago

Hi!

Well, if you are aware of the dangers, I'll ask to have a 5.2 sync then. It will go to our task list.

I strongly recommend that you to use MCUboot. It offers great features and also an "OS Side" update app routines. Also, Espressif port is supported by Espressif, meaning you won't need to worry about it.

tmedicci commented 6 months ago

Hi @robotman2412 , please check the updated repo's README and https://github.com/espressif/esp-hal-3rdparty/tree/sync/release_v5.2.a. Closing this issue ;)