-
-
Notifications
You must be signed in to change notification settings - Fork 212
New ThreadDebug Commit - g++ not found in %PATH% #46
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
Comments
Current 'workarounds': In boards.txt: added: Manually created arduinobeta.mbed.envie_m7_thread_debug directory and copied build into that. Getting this now: |
--==-- Plus - this or something close needs to be added: envie_m7_thread_debug.upload.tool=dfu-util |
Hi John, |
Hello Martino & Dario, Is debug supposed to happen on a different pid? (Other than the download pid?) Just wondering. When doing the above - it does make a thread_debug directory: C:\tmp\demo-web-server\build\arduinobeta.mbed.envie_m7_thread_debug and it uses that file - demo-web-server.ino.elf in this case for the debug session. So, I vote for making this a 'feature' so debug builds can be differentiated from regular release (non-debug) types Unfortunately - I'm still getting this: (8/28/20 nightly build): And two com ports listed under IDE: Thanks! |
The IDE2 does not do any magic when it comes to running the debugger but executes:
Executing the
Unlike with the Zero board, nothing happens:
Can someone please help how to run gdb properly from a terminal using the CLI only, then I can fix the behavior in the IDE2. Thank you! From here:
This does not work for me either. |
Akos, In the 0.1.2 IDE - I'm getting this: GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.20171128-git I'm not sure when you say IDE2 - what that means. Thanks, |
Sorry for the confusion, @jwestmoreland; they are the same. |
OK Akos. From the command line - it runs: C:\tmp2\Display\build\arduinobeta.mbed.envie_m7_thread_debug>C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\bin\arm-none-eabi-gdb -ex "set pagination off" --baud 230400 -ex "set target-charset ASCII" -ex "set print pretty on" -ex "set remotelogfile mri.log" -ex "target remote COM8" Display.ino.elf Thread 5 "" received signal SIGINT, Interrupt.
Quit anyway? (y or n) y C:\tmp2\Display\build\arduinobeta.mbed.envie_m7_thread_debug> |
Thank you for writing this down. It does not work for me. I am going to add the steps I have used, but let me add some remarks first:
I did the followings:
|
Hello Akos, First - are you including this at the top of your file: #include <ThreadDebug.h> UsbDebugCommInterface debugComm(&SerialUSB); And, I've attached the files I'm using - note, this deals with the issue in the OP and we're talking about something related now. I'm compiling in the IDE(2) - and then running from the command line. The debugger disconnects when trying to run in the IDE(2). Regards,
That was I thought the 'main' issue here - to distinguish in a clear way 'release' builds from 'debug' builds. |
Akos, Also - this is just something I type in from the command line: C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\bin\arm-none-eabi-gdb -ex "set pagination off" --baud 230400 -ex "set target-charset ASCII" -ex "set print pretty on" -ex "set remotelogfile mri.log" -ex "target remote COM8" Display.ino.elf That's not in any of the .txt files. Regards, |
Thank you so much for helping me with this issue, John. I will try to run the debugger the way you did; once it works from the terminal, I can make the IDE adjustments. I'll keep you posted. |
Akos, No problem. @adamgreen thought a monitor reset command was being issued that was causing the disconnect in the IDE but I didn't find that - could be in the source someplace maybe. Note there was some discussion here as well: #19 . Thanks, |
Akos, Also - please try this: USBSerial SerialUSB1(false, "DebugPort"); Thanks, |
I can confirm, it works from the terminal, once I have overridden the files under My sketch looks like this: #include <ThreadDebug.h>
//
// UartDebugCommInterface debugComm(SERIAL1_TX, SERIAL1_RX, 230400);
// ThreadDebug threadDebug(&debugComm, DEBUG_BREAK_IN_SETUP);
UsbDebugCommInterface debugComm(&SerialUSB);
// ThreadDebug threadDebug(&debugComm, DEBUG_NO_BREAK_IN_SETUP);
ThreadDebug threadDebug(&debugComm, DEBUG_BREAK_IN_SETUP);
// the setup function runs once when you press reset or power the board
void setup()
{
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop()
{
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
} And here is the command I have executed:
I will try to get this run from the IDE. |
This does not compile on my side. |
Here are the diffs (excluding the line endings
13c13,21
< stlink.program.extra_params=
\ No newline at end of file
---
> stlink.program.extra_params=
>
> jlink.name=SEGGER JLINK
> jlink.communication=USB
> jlink.protocol=
> jlink.program.protocol=swd
> jlink.program.tool=openocd
> jlink.program.extra_params=
>
7a8,13
> # envie_m7_thread_debug.name=Arduino Portenta H7 (M7 core)
> envie_m7_thread_debug.build.core=arduino
> envie_m7_thread_debug.build.crossprefix=arm-none-eabi-
>
> envie_m7_thread_debug.build.compiler_path={runtime.tools.arm-none-eabi-gcc.path}/bin/
>
42a49,61
> ### WIP! Note, this may not be able to coexist - proceed accordingly! --- jcw
>
> ## for jlink - REM: Must use WINUSB w/jlink (Zadig good utility for this under win10.)
>
> envie_m7.debug.tool=gdb
> envie_m7.bootloader.tool=openocd
> envie_m7.bootloader.config=-f target/stm32h7x_dual_bank.cfg
> envie_m7.bootloader.programmer=-f interface/jlink.cfg
> envie_m7.bootloader.extra_action.preflash=stm32h7x option_write 0 0x01c 0xb86aaf0
> envie_m7.bootloader.file=PORTENTA_H7/portentah7_bootloader_mbed_hs_v2.elf
>
> ## for stlink
>
48c67,107
< envie_m7.bootloader.file=PORTENTA_H7/portentah7_bootloader_mbed_hs.elf
---
> envie_m7.bootloader.file=PORTENTA_H7/portentah7_bootloader_mbed_hs_v2.elf
>
> envie_m7_thread_debug.build.variant=PORTENTA_H7_M7
> envie_m7_thread_debug.build.mcu=cortex-m7
> envie_m7_thread_debug.build.fpu=fpv5-d16
> envie_m7_thread_debug.build.float-abi=softfp
> envie_m7_thread_debug.build.extra_flags=
> envie_m7_thread_debug.build.architecture=cortex-m7
> envie_m7_thread_debug.build.ldscript=linker_script.ld
> envie_m7_thread_debug.compiler.mbed.arch.define=
> envie_m7_thread_debug.compiler.mbed.defines={build.variant.path}/defines.txt
> envie_m7_thread_debug.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
> envie_m7_thread_debug.compiler.mbed.cflags={build.variant.path}/cflags.txt
> envie_m7_thread_debug.compiler.mbed.cxxflags={build.variant.path}/cxxflags.txt
> envie_m7_thread_debug.compiler.mbed.includes={build.variant.path}/includes.txt
> envie_m7_thread_debug.compiler.mbed.extra_ldflags=-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
> envie_m7_thread_debug.compiler.mbed="{build.variant.path}/libs/libmbed.a"
>
> envie_m7_thread_debug.debug.tool=gdb
> envie_m7_thread_debug.name=Arduino Portenta H7 (ThreadDebug)
> envie_m7_thread_debug.vid.0=0x2341
> envie_m7_thread_debug.pid.0=0x025b
> envie_m7_thread_debug.descriptor.0=DebugPort
> envie_m7_thread_debug.hide=true
> envie_m7_thread_debug.build.board=PORTENTA_H7_M7
> envie_m7_thread_debug.file=C:/tmp/demo-web-server/build/arduinobeta.mbed.envie_m7_thread_debug/demo-web-server.ino.elf
>
> envie_m7_thread_debug.upload.tool=dfu-util
> envie_m7_thread_debug.upload.protocol=
> envie_m7_thread_debug.upload.vid=0x2341
> # envie_m7_thread_debug.upload.pid=0x035b
> envie_m7_thread_debug.upload.pid=0x025b
> # envie_m7_thread_debug.upload.pid=0x045b
> envie_m7_thread_debug.upload.address=0x08040000
> envie_m7_thread_debug.upload.interface=0
> envie_m7_thread_debug.upload.use_1200bps_touch=true
> envie_m7_thread_debug.upload.wait_for_upload_port=true
> envie_m7_thread_debug.upload.native_usb=true
> envie_m7_thread_debug.upload.maximum_size=786432
> envie_m7_thread_debug.upload.maximum_data_size=523624
>
127c127
< tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" {bootloader.programmer} {bootloader.config} -c "telnet_port disabled; init; reset init; halt; adapter speed 10000; {bootloader.extra_action.preflash}; program {{runtime.platform.path}/bootloaders/{bootloader.file}}; reset run; shutdown"
---
> tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" {bootloader.programmer} {bootloader.config} -c "telnet_port disabled; init; reset init; halt; adapter speed 10000; transport select swd; {bootloader.extra_action.preflash}; program {{runtime.platform.path}/bootloaders/{bootloader.file}}; reset run; shutdown" |
Hmmm, it was added here: |
|
Akos, Also - for the explanation of the different bootloader files - please look here: #32 . Regards, |
Hello All (Martino),
Trying your latest commit with the ThreadDebug lib - getting this:
Compilation error: Error: 2 UNKNOWN: exec: "g++": executable file not find in %PATH%.
Probably an easy one to fix - just wanted to report it - I'll see if I can do a workaround since I really want to see this run.
Compiling...
{
"sketchUri": "file:///c%3A/tmp/demo-web-server/demo-web-server.ino",
"fqbn": "arduinobeta:mbed:envie_m7_thread_debug", <=== is that a possible reason?
"optimizeForDebug": true
}
Also seeing:
Error during Debug: Cannot get command line for tool: cannot get programmer tool: undefined 'debug.tool' property
It does appear to be running from the command line:
C:\tmp\demo-web-server\build\arduinobeta.mbed.envie_m7>C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\bin\arm-none-eabi-gdb -ex "set pagination off" --baud 230400 -ex "set target-charset ASCII" -ex "set print pretty on" -ex "set remotelogfile mri.log" -ex "target remote COM4" demo-web-server.ino.elf
GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.20171128-git
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from demo-web-server.ino.elf...done.
Remote debugging using COM4
setup () at c:\tmp\demo-web-server/demo-web-server.ino:28
28 void setup() {
(gdb) finish
Run till exit from #0 setup () at c:\tmp\demo-web-server/demo-web-server.ino:28
Note: automatically using hardware breakpoints for read-only addresses.
[New Thread 604075640]
[New Thread 604081468]
main () at C:\Users\john\AppData\Local\Arduino15\packages\arduinobeta\hardware\mbed\1.2.2\cores\arduino\main.cpp:47
47 loop();
Also - in ThreadDebug 'mode' - two identical COM ports are listed:
Thanks!
John W.
The text was updated successfully, but these errors were encountered: