-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
ESP32C6 design bootloader,gpio interrupt (IDFGH-14345) #15135
Comments
Hi @zzff-sys! It's also important to note that ESP-IDF does not officially support using the GPIO driver in the bootloader. The bootloader operates in a minimal environment without FreeRTOS or the full ESP-IDF framework. If you can share more about your goals, we can help explore other solutions that work within the constraints of the bootloader. |
@KonstantinKondrashov
2, use canfd driver chip, this chip is SPI to canfd protocol, need to receive external data through gpio interrupt
|
So in our own project, we tried to rework the gpio driver |
Hi @zzff-sys , Sadly to say, the bootloader of ESP-IDF is designed to reduce any possibility of requiring to be updated. Interrupt and multi-threading (RTOS) are relatively unstable and can become a common cause of bug. I can see in the near future there won't be support for them in the bootloader. If you want to add them into the bootloader, you will need to implement them yourself. But after adding them, there is no much difference between the bootloader and the app. Why not just do it in the app? As for the driver in ESP-IDF, including GPIO and TWAI, they are designed to depends on some app-specific utilities like interrupt and FreeRTOS. So they can't be used in bootloader either. If you want to implement your own driver that can be used in bootloader, the easiest way is to refactor from ESP-IDF drivers, removing all OS related code (and maybe the log also) and keep code from the HAL only. But again, then why not do it in the app? Our suggestion is to add a flashing mode at the beginning of your app, detect the download mode and do the OTA in the app. The download code itself (a kind of bootloader, but still part of the app) can also be updated this way. This way you can make full use of all IDF features without much effort. btw, we have a plan of allowing the app to upgrade the bootloader in progress. We can discuss about this below if you need it. |
@ginkgm flags |= ESP_INTR_FLAG_LOWMED; vd->flags = VECDESC_FL_NONSHARED; if (flags & ESP_INTR_FLAG_IRAM) { if (source>=0) { ret.vector_desc = vd; //Enable int at CPU-level; if (ret_handle != NULL) ESP_LOGI(TAG,"source1:%d,flags1:%d,handler1:%p,arg1:%p,ret_handle1:%p\n",source,flags,handler,arg,ret_handle); |
I think it makes a lot of sense to develop your own bootloader based on ESP32, although you need to modify the relevant functions in the idf, but it makes a lot of engineering sense |
Hard to tell what is wrong just from this snippet, but in general: supporting and debugging step-by-step how to implement X in the bootloader is a bit out of scope for github issues, as it would basically require us to re-explain every implementation detail in IDF. If you have a question about a very specific detail (and the question contains sufficient background details to actually be able to answer it) then we might be able to help, otherwise I suggest:
|
thank you for your reply |
Closing this one for now then. As already mentioned, if there is any questions about a specific technical detail then feel free to open another issue for it. Thanks for your understanding! |
The text was updated successfully, but these errors were encountered: