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
Normal Topic Support for Portenta M4 hardware (JLink) debugging (Read 1015 times)
Sid Price
Junior Member
**
Offline


Posts: 54
Location: Tijeras
Joined: Jun 28th, 2021
Support for Portenta M4 hardware (JLink) debugging
Nov 17th, 2021 at 6:30pm
Print Post  
Just checking in to see if there has been any progress on this.
Sid
« Last Edit: Nov 17th, 2021 at 6:30pm by Sid Price »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2175
Joined: Feb 13th, 2019
Re: Support for Portenta M4 hardware (JLink) debugging
Reply #1 - Nov 25th, 2021 at 3:58pm
Print Post  
Finally there is, and both cores can be debugged separately, and at the same time if desired, manual instructions are below:

To debug just the M4 Core in isolation:
1) Create a project for the Portenta H7 M4, and select this board 
2) Add a custom launch.json to the project from vMicro > Add Code > Add Custom GDB Debugger (Advanced)
3) Select the Debug: Hardware, and then the Manual/Custom option
3) Overwrite the contents of the file with the ones attached (Example in ZIP\SingleCoreAtATime\PORTENTA_H7_M4.Debug.debugger_launch.json)
4) Amend the MIDebuggerPath, to match your GDB Location
5) Save the file, build and upload
6) Debug > Attach to process should now allow the M4 core to be debugged via the JLink and OpenOCD

Tip: The paths for GDB above can be obtained by trying to attach the debugger with the M7 board selected, and the JLink debugger option.
(See "Getting Current Settings" section on this page)

If you want to debug both cores at the same time, then two instances of Visual Studio will need to be open, one for each project 
1) Complete the process above on BOTH projects to add the custom JSON files, with path configurations, and the Manual/Custom option selected.
2) Remove the debugServerPath, and debugServerArgs elements from the M4 projects launch.json  (Example in ZIP\DualCore)
3) Build and upload both projects
4) M7 Core Project: Debug > Attach to process (this spawns the shared OpenOCD instance in the background)
5) M4 Core Project: Debug > Attach to process (this latches onto the same instance  of OpenOCD as above, for CPU1)
6) Stop debugging on the M4 core first, then the M7 core.

Hopefully this makes sense, and we will add configurations to allow this to work out of the box.



  

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


Posts: 2175
Joined: Feb 13th, 2019
Re: Support for Portenta M4 hardware (JLink) debugging
Reply #2 - Nov 25th, 2021 at 7:09pm
Print Post  
This has now been integrated in the latest version (21.11.08-06) available from the top of the board below:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

The documentation has also been updated to reflect how to use either a single core debugging setup, or the dual core setup:
https://www.visualmicro.com/page/PortentaM7-Debugging.aspx
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint