Hello,
I have written a (correct/well formed) program that triggers error messages in the depths of esp-idf. These parts of esp-idf are located in "esp-idf/components" and can therefore be changed in the source code before compiling. Since the called functions are called via callbacks, debugging is not possible or very difficult. A pure examination of the source code is too tedious.
Is there a call in esp-idf that works like the calls "backtrace_symbols" and/or "backtrace_symbols_fd" under linux?
Thanks in advance,
Michael
Function call backtracing with esp-idf
Function call backtracing with esp-idf
Nobody is perfect!
My name is NOT Nobody...
Nobody lives forever to correct his mistakes someday in the future, if not right now!
Covid-19 is not responsible for any human failures!
My name is NOT Nobody...
Nobody lives forever to correct his mistakes someday in the future, if not right now!
Covid-19 is not responsible for any human failures!
Re: Function call backtracing with esp-idf
This may be an excellent opportunity to get to grips with JTAG debugging. If I had your puzzle, I'd engage JTAG and set a breakpoint where I wanted to gather information. When the breakpoint is reached deep in the bowels, the JTAG debugger can show my call path.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Function call backtracing with esp-idf
What you want is not trivial. But, here are some notes which may help:
1. There are no symbols in the .bin file in flash. But, if your running App outputs something that looks like an address, the 'make monitor' part of esp idf will convert it to a symbol and show it.
2. As an alternative to [1], the xtensa tools have a utility to convert an address to a symbol. It is not very accurate on the line number, but close enough:
3. See panic.c doBacktrace() for how to do a backtrace.
4. If you can trigger the issue yourself, then gdb is your friend. Make menuconfig and set the gdbstub option. Use abort() in your code, and you'll be in gdb with a full backtrace and examination capability.
There is also jtag...
1. There are no symbols in the .bin file in flash. But, if your running App outputs something that looks like an address, the 'make monitor' part of esp idf will convert it to a symbol and show it.
2. As an alternative to [1], the xtensa tools have a utility to convert an address to a symbol. It is not very accurate on the line number, but close enough:
Code: Select all
xtensa-esp32-elf-addr2line -pfiaC -e build/<MYAPP>.elf 0x<ADDRESS>
4. If you can trigger the issue yourself, then gdb is your friend. Make menuconfig and set the gdbstub option. Use abort() in your code, and you'll be in gdb with a full backtrace and examination capability.
There is also jtag...
Re: Function call backtracing with esp-idf
As I see, using an JTAG would be the best way. According to the esp-idf docs it's possible to connect an JTAG adapter to the Feather.
My handycap is, I don't have anyone and I don't know which one and where to buy it!
Can you give me some advices?
My handycap is, I don't have anyone and I don't know which one and where to buy it!
Can you give me some advices?
Nobody is perfect!
My name is NOT Nobody...
Nobody lives forever to correct his mistakes someday in the future, if not right now!
Covid-19 is not responsible for any human failures!
My name is NOT Nobody...
Nobody lives forever to correct his mistakes someday in the future, if not right now!
Covid-19 is not responsible for any human failures!
Who is online
Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 152 guests