There must be an easier way for this? Yes, indeed, there is 🙂
The plugin actually is pretty clever: it remembers the last used settings and uses that for new debug configurations. So once I made the settings (and I do not switch the microcontroller), everything is set up correctly.
But for a new workspace or for a new device I need to find out that device name.
If in the plugin I keep the field empty, then I get an error:
💡 I proposed a feature to have the dialog populated by default with ‘Unspecified’ instead of an empty text, more about this later in this article.
For this the plugin provides a link to the Segger web site which lists all the device names supported:
But what if I’m travelling and do not have internet connection, and do not remember the device name used by Segger?
Using a wrong name
The first trick is to use a device name not recognized by Segger:
Then the Segger library will prompt a dialog that it does not know that device:
Pressing ‘Yes’, I can select the device from a list:
❗ Unfortunately, this dialog is open only for a about 10 seconds, not sure why?
As a tip, another way to get that dialog is to launch the JLinkGDBServer and then browse for the device name:
Only using the Core Name
The solution is just to use the name of the supported CPU core which is pretty easy to remember: The list of supported cores is listed at http://www.segger.com/jlink_supported_devices.html#SupportedCPUCores.
“Note that a device has not to be known by name to be supported. This means that J-Link can be used with any device, using a standard core listed in Supported CPU Cores even if it is known by name.” (Source: Segger Web Site)
So instead of
I can simply use
💡 Be aware that just specifying the core (Cortex) means that the debugger has no knowledge about the peripherals and specifics of the device (flash security, etc). It might work, but that really depends on the device used! Better specify the exact device name used.
The other thing I have found is to use ‘Unspecified’:
It seems that the Segger interface is pretty smart and finds out what core it is talking too? I can see this if I launch the JLink.exe:
It is best to specify the exact microcontroller device name to the Segger J-Link. But for when I don’t know it or I’m lazy, ‘Unspecified’ or ‘Cortex-M4’ or ‘Cortex-M0+’ likely will do it. No guarantee, but better than nothing 🙂
Happy Seggering 🙂