arduino / arduino/ArduinoCore-mbed
Unable to source level debug code in libmbed using IDE 2.3.3.
- Dominant language
- C
- Stars
- 411
- Forks
- 225
- PR merge metrics
- No merged PRs in 30d
Description
In my case, I am trying to debug some OV5640 camera code I am trying to make work on the GIGA and thought it would be
easier if I could debug the code using the Arduino IDE debugger.
Took me a while to figure out how to build the debug version of the libmbed.a. More details about this are in the issue I created
#993
A lot more details about this is in the forum thread:
https://forum.arduino.cc/t/building-debug-libmbed-a/1315845/28
My WIP (more like Play in progress) sketch which includes the camera code is up at:
https://github.com/KurtE/Arduino_GIGA-stuff/tree/main/sketches/GigaCameraDisplay_GFX_OV5640
Warning it uses some of the libraries I have in same github project and others.
I am able to start up the debugger and set breakpoints and the like, and get to the line that tries to call into the HAL layer as seen:

However I can not step into this function, as I am guessing it can not find any source file for it.
That is, the sources I believe in the mbed-os project is contained in the file:
`/home/kurte/github/mbed-os/targets/TARGET_STM/TARGET_STM32F7/STM32Cube_FW/STM32F7xx_HAL_Driver/stm32f7xx_hal_dcmi.c`
Or when generating the debug version of the libmbed.a a similar path in /tmp
I noticed at the end of the mbed-os-to-arduino run there were some copies that were done, I believe from this:
```
copy_core_files () {
echo -n "Copying generic MbedOS headers to core... "
rsync -zar --exclude="targets/" --exclude="*TEST*/" --include="*/" --include="*.h" --exclude="*" \
mbed-os/ "$ARDUINOCOREMBED"/
rsync -zar --exclude="targets/" --exclude="*TEST*/" --include="*/" --include="mstd_*" --exclude="*" \
mbed-os/ "$ARDUINOCOREMBED"/
echo " done."
}
```
Which makes sense, as the only *.c* file located under the cores/arduino/mbed directory is: mstd_mutex.cpp
Question is: how should it work?
Should I try to copy the .c files into where the header file is?
`/home/kurte/Arduino/hardware/arduino-git/mbed/cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/STM32H7xx_HAL_Driver/stm32h7xx_hal_dcmi.h
`
Or is it simply not expected to work?
Thanks
Kurt
Contributor guide
No contributing guide indexed for this repository
Research direction
Read issue #993 and the mbed-os-to-arduino copy_core_files routine first, then inspect the referenced STM32 HAL source path and the generated libmbed.a debug setup. Reproduce the IDE 2.3.3 debugging flow with the OV5640 sketch; done means the debugger can step from the call into the HAL function and locate its source, or the expected limitation is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- devtools, embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100