I think I’m facing one of those RF22 interrupt problems.
I’m using this code to check that my HW works. Normally I use C and Eclipse/OpenOCD (on another machine) and I wonder if
– there are debugging tools built in Arduino
– or what should I do to be able to debug the code with Eclipse/OpenOCD
I think using just debug-prints is quite laborous way to debug unfamiliar code.
Then I use Rowley Crossworks to debug the “Externally built executable”.
I have a hobbyist licence for Rowley.
This means that I am debugging the actual genuine Arduino project.
David.
[david.prentice – Sun Jul 22, 2018 6:21 am] –
I just add debug flag to the Arduino IDE build recipe. And copy the ELF to a visible directory as part of the recipe.Then I use Rowley Crossworks to debug the “Externally built executable”.
I have a hobbyist licence for Rowley.This means that I am debugging the actual genuine Arduino project.
David.
How does it work with that?
Is there really enough info in the ELF that you can debug in source level?
For assembly level debugging, GDB is fine, but debugging unfamiliar library, like RF22, in assembly level…
And I’m not very familiar with STMduino cores either… It took me more than an hour to find out what’s the stm32 GPIO for “interrupt 0”.
use a hardware debugger, like stlink / jlink / cmsis-dap…
[dannyf – Sun Jul 22, 2018 2:10 pm] –
now i need to debug the library, but what’s the simplest way to do it?use a hardware debugger, like stlink / jlink / cmsis-dap…
I use ST-LINK V2 mini (a cheap clone, but works fine). That’s what the OpenOCD is for, actually.
I was rather wondering how to debug using Arduino or how to set up the sketch + stuff to be able to debug with GDB, rather in source level.
[turboscrew – Sun Jul 22, 2018 2:48 pm] –
I was rather wondering how to debug using Arduino or how to set up the sketch + stuff to be able to debug with GDB, rather in source level.
If you are using Roger’s libmaple based core, it is already including the ‘-g’ flag which adds the symbol table to the .elf file. Is that the core you are using? If you aren’t seeing the source code and you are using the Roger’s core, make sure you are using a recent version of arm-none-eabi-gdb and a recent version of openocd.
You might take a look at this if you are on linux or OS/X
[Rick Kimball – Sun Jul 22, 2018 4:42 pm] –[turboscrew – Sun Jul 22, 2018 2:48 pm] –
I was rather wondering how to debug using Arduino or how to set up the sketch + stuff to be able to debug with GDB, rather in source level.If you are using Roger’s libmaple based core, it is already including the ‘-g’ flag which adds the symbol table to the .elf file. Is that the core you are using? If you aren’t seeing the source code and you are using the Roger’s core, make sure you are using a recent version of arm-none-eabi-gdb and a recent version of openocd.
You might take a look at this if you are on linux or OS/X
Yes, I’m using Roger’s core.
And I have another machine (my development machine) with Eclipse, gdb and OpenOCD already in use.
I guess I have to bring Arduino and the SW there or install the debugging stuff in this machine (where I have the Arduino now).
Arduino needs to be running, otherwise the stuff from /tmp disappears?
You can, of course, export the binary, but then the paths are gone.
Thanks, I’ll dig into the link you gave.
One note on my earlier comments, I modified my original post and added a zip file that has the changes to the board.txt and platform.txt along with the script I’ve tested, so you select upload with debug directly from Roger’s libmaple core.
I stored the link in my bookmarks toolbar.
(I copied the bash-script and the gdb-script.)
I think I’m getting closer to the problem, and it’s not the RF22 library, but blue pill interrupt handling.
The interrupt line is active (low), but the interrupt handler is – suddenly – not called.
And about the sources: it’s not about saving changes, but debugging on a different machine than compiling.
perhaps the updated source is being looked for on the target?
srp
https://www.gnu.org/software/ddd/
i’m not too sure if this would work with arm / but if it does it may well be pretty useful
There’s also Nemiver. It works better than DDD and is not a front end to gdb. I’m not sure about its cross-debugging capabilities, but on native environment it works fine.
[turboscrew – Sun Jul 22, 2018 8:55 pm] –
I think I’m getting closer to the problem, and it’s not the RF22 library, but blue pill interrupt handling.
The interrupt line is active (low), but the interrupt handler is – suddenly – not called.
You’re very close. I had the very same issue on a different driver library for my own comms framework.
TL;DR: Current solution: after each interrupt, call and check if any interrupt is pending before moving on.


