Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Hardware debugging Teensy with J-Link (Read 2100 times)
Lee Buckland
Newbies
*
Offline


Posts: 5
Joined: May 22nd, 2024
Hardware debugging Teensy with J-Link
Jul 2nd, 2024 at 9:06pm
Print Post  
I have developed a custom Teensy board, which exposes JTAG, for the purposes of hardware debugging, using a SEGGER J-Link debugger. However, I am unable to attach to the process within VS and would welcome any guidance anyone can offer.

Launching the GDB server using the following command, shows a successful connection to my board and indicates waiting for connection.
Code
Select All
JLinkGDBServer.exe -select USB=0 -device "MIMXRT1062xxx6B?BankAddr=0x60000000&Loader=QSPI" -endian little -if JTAG -speed 4000 -noir -LocalhostOnly -nologtofile -port 2331 -SWOPort 2332 -TelnetPort 2333 



Launching MIDebugger with the following command line successfully connects to the server:
Code
Select All
arm-none-eabi-gdb.exe <path to ELF file> -ex "target remote localhost:2331" 



Finally, I've attached the debugger_launch.json file I'm using (renamed to txt), which does launch the GDB server, which again indicates a successful connection to my board, before VS displays the error "Unable to start debugging. Debug server process failed to initialize."

Any thoughts on next steps of things I can try?
« Last Edit: Jul 2nd, 2024 at 9:22pm by Lee Buckland »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Hardware debugging Teensy with J-Link
Reply #1 - Jul 3rd, 2024 at 7:42am
Print Post  
Thanks for the report and that sounds like a very interesting Teensy based board!

It may be worth enabling the debug logging within Visual Studio, to see the entire conversation between VS and GDB:
1) Open the Command Window (View > Other Windows > Command Window)
2) Enter the command Debug.MIDebugLog /On /OutputWindow

Now when you try to attach the debugger you should see much more verbose output in the Output > Debug window, which may give further clues as to what is happening....
  
Back to top
IP Logged
 
Lee Buckland
Newbies
*
Offline


Posts: 5
Joined: May 22nd, 2024
Re: Hardware debugging Teensy with J-Link
Reply #2 - Jul 5th, 2024 at 6:21pm
Print Post  
Thank you for taking the time to provide some guidance. Unfortunately, after executing the procedure you outlined, the Debug window remains blank.

If you have any additional thoughts, I would appreciate the suggestions.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Hardware debugging Teensy with J-Link
Reply #3 - Jul 6th, 2024 at 1:14pm
Print Post  
Thanks for the update.

Re-reading the initial report, it seems its before GDB even gets spawned, as the error is with the DebugServer (which is the JLinkGDBServer.exe process in the launch json).

One element that seems different is the quoting of the -device parameter, in your command line it has double quotes around it, but in your JSON it doesn't.

Could you try the attached JSON which has the -device parameter quoted as you command line does?
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Lee Buckland
Newbies
*
Offline


Posts: 5
Joined: May 22nd, 2024
Re: Hardware debugging Teensy with J-Link
Reply #4 - Jul 6th, 2024 at 2:29pm
Print Post  
Thank you again for taking time to look at this; however, the same issue remains. There is no problem launching the GDB Server and as you can see from the screen capture (attached), it shows waiting for connection. When the connection times out, it all closes down again.
« Last Edit: Jul 6th, 2024 at 2:31pm by Lee Buckland »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Hardware debugging Teensy with J-Link
Reply #5 - Jul 6th, 2024 at 8:53pm
Print Post  
Thanks for the update, and it looks virtually identical to the documentation and YouTube video we have on this, which I'm sure led you to post when it didn't work.....

Does removing the additional options for the Telnet and SWO port make any difference? (I'm not sure why it would but know they aren't consumed via vMicro currently).

Can you enable the below options and then perform the build and upload, and then try attaching the debugger again?
  • vMicro > Compiler > Verbose
  • vMicro > Compiler > Show Build Properties
  • vMicro > Uploader > Verbose


If you could then attach the complete output from the Output > Micro Build Window it will let us check any other elements which could be an issue.
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Hardware debugging Teensy with J-Link
Reply #6 - Jul 19th, 2024 at 2:43pm
Print Post  
Did you make any progress with this?
  
Back to top
IP Logged
 
Lee Buckland
Newbies
*
Offline


Posts: 5
Joined: May 22nd, 2024
Re: Hardware debugging Teensy with J-Link
Reply #7 - Jul 21st, 2024 at 6:37pm
Print Post  
Attached is the output from the Micro Build window with the suggested settings.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Hardware debugging Teensy with J-Link
Reply #8 - Jul 23rd, 2024 at 4:35pm
Print Post  
Thanks for the update.

Can you try adding in the GDB Command to connect in the JSON's MIDebuggerArgs:
  "MIDebuggerArgs": "-ex \"target remote localhost:2331\""

This should then mean more output is displayed in the Output > Debug window where GDB can be seen starting up...
  
Back to top
IP Logged
 
Lee Buckland
Newbies
*
Offline


Posts: 5
Joined: May 22nd, 2024
Re: Hardware debugging Teensy with J-Link
Reply #9 - Jul 25th, 2024 at 6:31pm
Print Post  
After making the change, the Output \ Debug window remains blank, with no additional information.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint