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 J-Link as programmer (Read 3293 times)
darkhawk
Newbies
*
Offline


Posts: 3
Joined: Apr 18th, 2021
J-Link as programmer
Apr 20th, 2021 at 12:53am
Print Post  
Hello!
I'm working with the following : 
1. Visual Studio 2019 with Visual Micro installed and working
2. Adafruit Metro M4 Grand Central development board (ATSAMD51P20A based)
3. Segger J-Link EDU

I'm able to debug fine, however, I am unable to program via the J-Link.
I would prefer to NOT have to use the WinUSB drivers, and would prefer to stick to the Segger utilities for programming and debugging. 
I managed to get the debugging functioning just fine, and it works as expected, using the included tutorials online. However, I haven't seen anything presented on how to use the Segger J-Link to program as well, instead of the USB cable (which also always requires putting the board into bootloader mode). 
Is there a guide or a tutorial on how to set that up in some way?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: J-Link as programmer
Reply #1 - Apr 20th, 2021 at 8:20am
Print Post  
The programming via JLink can be enabled from:
vMicro > Uploader > Hardware Programmer

The J-Link Over OpenOCD (vMicro) is our configuration for JLink, the one without (vMicro) is the standard one included in the board package.

This will still require the WinUSB Drivers by default, though it should be possible to override the pattern to use the J-Link flashing tools so this is not needed....

Do you have an example of your upload command for this board using the J-Link tools?
« Last Edit: Apr 20th, 2021 at 8:22am by Simon@Visual Micro »  
Back to top
IP Logged
 
darkhawk
Newbies
*
Offline


Posts: 3
Joined: Apr 18th, 2021
Re: J-Link as programmer
Reply #2 - Apr 21st, 2021 at 10:54am
Print Post  
Simon@Visual Micro wrote on Apr 20th, 2021 at 8:20am:
The programming via JLink can be enabled from:
vMicro > Uploader > Hardware Programmer

The J-Link Over OpenOCD (vMicro) is our configuration for JLink, the one without (vMicro) is the standard one included in the board package.

This will still require the WinUSB Drivers by default, though it should be possible to override the pattern to use the J-Link flashing tools so this is not needed....

Do you have an example of your upload command for this board using the J-Link tools?

I wasn't sure how to set it up. I don't want to use the WinUSB drivers, and as I'm not familiar with setting up the IDE on how to use the J-Link flashing tools, that is why I'm here asking.

Most of my experience comes from just using Arduino. Formally, I'm an electrical engineer, and software has always been something I played around with. 
However, this time I'd like to actually use the correct tools and set them up correctly. However, there really wasn't any tutorial or knowledge anywhere on how to set it up to use the Segger tools directly for programming, only for debugging.

Thanks!

EDIT: As a side note, when the window to reply in is resized, it doesn't resize the page, so it will cover the "Post Message" and "Preview" buttons on the page until you resize it smaller.....just something I noticed. Most other forums I've visited resize things properly to prevent that from happening.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: J-Link as programmer
Reply #3 - Apr 21st, 2021 at 11:28am
Print Post  
Thanks for explaining, and the JLink software can be used via Atmel Studio in conjunction with Visual Micro, which will use the JLink native software:
https://learn.adafruit.com/how-to-program-samd-bootloaders?view=all#flashing-a-s...

The SAMD Boards have additional steps for unlocking the bootloader before/after flashing, which makes it more tricky than flashing some boards.

Is there a reason the WinUSB Drivers + OpenOCD are not a suitable option for code upload out of interest?
  
Back to top
IP Logged
 
darkhawk
Newbies
*
Offline


Posts: 3
Joined: Apr 18th, 2021
Re: J-Link as programmer
Reply #4 - Apr 21st, 2021 at 7:39pm
Print Post  
Simon@Visual Micro wrote on Apr 21st, 2021 at 11:28am:
Thanks for explaining, and the JLink software can be used via Atmel Studio in conjunction with Visual Micro, which will use the JLink native software:
https://learn.adafruit.com/how-to-program-samd-bootloaders?view=all#flashing-a-s...

The SAMD Boards have additional steps for unlocking the bootloader before/after flashing, which makes it more tricky than flashing some boards.

Is there a reason the WinUSB Drivers + OpenOCD are not a suitable option for code upload out of interest?

I don't like the WinUSB solution. It's not preferable. ie I hate  having to constantly switch back and forth with the drivers, and I'm not a fan of the OpenOCD solution (it's never worked as many times as I've tried, it's too convoluted and clumsy.....it either works, or it didn't, and in this case it didn't, but Segger's software did with no issues......)

Unfortunately, atmel studio is a relic of the past, and I've been unable to find a suitable download for it anymore (ever since Microshit....I mean, microchip bought them, they've taken a HUGE downward dive.....).
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: J-Link as programmer
Reply #5 - Apr 21st, 2021 at 8:05pm
Print Post  
Atmel Studio has recently been renamed to Microchip Studio. The download link is here, you need to scroll down the page to the Microchip Studio avr/sam download section.

https://www.microchip.com/en-us/development-tools-tools-and-software/microchip-s...

Sorry but we can only recommend the solutions that are supported by each IDE/GDB solution. Changing the USB driver might be the easiest route.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint