-
Notifications
You must be signed in to change notification settings - Fork 1.1k
GDBStub feature from ESP32 #2820
Comments
Sure, we will include these missing sources into the aws projects for ESP32. To unblock yourself, have you tried to include these missing files yourself to see if the feature works for you as expected? |
Hi @yourslab, Thank you for the quick response, it is very much appreciated! I have indeed tried to include these lines of code myself in the existing files but did not manage to get it to work due to so many dependencies required (example: same variables being used differently, wrong variable type that is already being used for something else such as Thank You |
Happy to help! Could this be an issue for esp-idf then? |
well it is an issue specific to the esp32 boards but it is not an esp-idf issue because gdbstub.c builds perfectly normal with esp-idf alone without using aws freertos. Originally, |
Would it be possible for you to update |
Hi @yourslab , I updated all submodules couldn't find the file tasks.c under the folder /vendors/espressif/esp-idf/components/freertos. I even attempted to checkout at v4.2 esp-idf (even if we're not supposed to use this version) and couldn't find the file. EDIT: Adding the freertos folder manually and trying to build does not work as well even after pointing to |
Hello @MrMelon1232, While we investigate an approach to this functionality, it may be easiest for you to fork the FreeRTOS-Kernel repository, and apply Espressif's changes directly to the kernel, instead of modifying the build to bring in multiple FreeRTOS kernel's. For some background, the IDF SDK used in Amazon-FreeRTOS is different to to the standard IDF. It has been modified to work with the contents of Amazon FreeRTOS, which receives it's kernel version directly from https://github.com/FreeRTOS/FreeRTOS-Kernel. I am not sure what kind of technical challenges bringing this feature in would be, but due to where the kernel is defined in this repository, it seems contentious with this implementation, as the kernel is being pulled in from a separate location, and does not have the Espressif modifications. I will reach out to Espressif, and see if they have any advice on how to best approach this. Thanks, Carl |
Hi @lundinc2, Thank you for taking this feature into consideration, your efforts are appreciated. |
Hi @MrMelon1232, As @lundinc2 correctly mentioned, ESP-IDF maintains some patches on top of FreeRTOS kernel to support this feature. However, OpenOCD+GDB setup provides more control over device for debugging as compared to GDBStub. Is there any specific use-case to enable GDBStub? |
Well using GDBSTUB allows easy debugging without the use of JTAG and brings you to the point of program crash. However, you are correct that using OpenOCD+GDB is better and allows more features but as mentioned in post #2822, I was not able to get this JTAG OpenOCD+GDB feature to work. |
Hi @MrMelon1232 There is a solution for #2822. Thank you @shubhamkulkarni97. Could you try out the solution to see whether it enables you to use the JTAG debugger with your custom project? |
Did the solution in #2822 help you resolve the problems you are facing? Are you looking for any further help from us? |
Thank you for clarifying the differences between the 2 posts. I was of the impression that the summary from this post was that you are unblocked with OpenOCD+GDB debugging. I apologize for not noticing the feature request aspect of this post. I will reach out to Espressif about this feature request. |
Thank you for your patience. As already mentioned by @lundinc2 in this reply and @shubhamkulkarni97 in here, this feature needs some additional patches from Espressif to the FreeRTOS Kernel. We recommend you to request for this feature in either ESP32 forums or Espressif section of the FreeRTOS forums for better attention by Espressif engineers. |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
An option that the ESP32 toolchain offers is the GDB debugging tool. In menuconfig of the build folders, it is possible to enable a feature called "Panic handler behaviour (invoke GDBStub)", so if a crash occurs, the terminal brings the user to a gdb environment for debugging. However, it seems that the freertos kernel from aws is missing a few things that allow this feature to work in comparison to esp-idf freertos folder under esp-idf/components/freertos/
This is the error output when trying to build the application:
In the freertos folder from esp-idf under esp-idf/components/freertos/, the structure
TaskSnapshot_t
is defined inesp/esp-idf/components/freertos/include/freertos/task.h and looks like this:
and the function
uxTaskGetSnapshotAll
is defined in esp/esp-idf/components/freertos/include/freertos/task.h andesp/esp-idf/components/freertos/tasks.c and looks like this:
with 2 helper functions:
Thank you!
The text was updated successfully, but these errors were encountered: