Closed kellyjp closed 5 years ago
I did a bit more analysis of this issue and I think I have the root cause. When the pyocd-gdbserver is requested to list available targets in JSON by the Eclipse plugin it returns two strings for each target, one in upper case (part_number) and one in lower case (name). Here is an example:
$ pyocd-gdbserver --list-targets --json
{
"status": 0,
"version": {
"major": 1,
"minor": 0
},
"pyocd_version": "0.8.1a1",
"targets": [
{
"part_number": "KL25Z",
"name": "kl25z"
},
{
"part_number": "KL26Z",
"name": "kl26z"
....
The plugin is currently using the part_number when building the list of supported targets, and then passes the selected part_number (in upper case) when invoking pyocd-gdbserver which then fails.
A possible fix would be to change the plugin to use the name when building the list of supported targets instead of the part_number.
I'm not a Java person but here is a possible fix:
--- a/bundles/ilg.gnumcueclipse.debug.gdbjtag.pyocd/src/ilg/gnumcueclipse/debug/gdbjtag/pyocd/ui/TabDebugger.java
+++ b/bundles/ilg.gnumcueclipse.debug.gdbjtag.pyocd/src/ilg/gnumcueclipse/debug/gdbjtag/pyocd/ui/TabDebugger.java
@@ -1046,7 +1046,7 @@ public class TabDebugger extends AbstractLaunchConfigurationTab {
final ArrayList<String> itemList = new ArrayList<String>();
for (PyOCD.Target target : targets) {
- itemList.add(String.format("%s", target.fPartNumber));
+ itemList.add(String.format("%s", target.fName));
}
String[] items = itemList.toArray(new String[itemList.size()]);
Hi @kellyjp. I'm the pyOCD plugin owner. Thanks for the detailed report! I'll take a look at fixing this shortly.
@flit, any progress?
I plan for a new release in about one week, so if you have a fix, please let me know.
Hi @ilg-ul, sorry, I probably won't have a fix in time for your next release. I have to reinstall the plugin development environment first, for some reason it stopped working correctly when you made to change from ARM to MCU. I was planning on doing this and fixing bugs while I'm on vacation in December.
ok.
@flit, any progress?
@flit,
Thank you for fixing this issue !
James
A v4.5.1 beta release which includes these patches can be installed from
http://gnu-mcu-eclipse.netlify.com/v4-neon-updates-experimental
Please test it and let me know if everything is ok, since my test environment does not include pyOCD.
@ilg-ul,
I installed the v4.5.1 beta from the link provided above and can confirm that when I select NRF52
as the device in the debug configuration, pyocd-gdbserver is subsequently launched using the --target nrf52
option i.e. the chosen device is correctly mapped into a pyocd target with the correct case.
James
thank you, James, for taking the time to test.
if @flit has no further patches, this is it for now. it'll be out after 2018-12 goes public.
fixed since v4.5.1-201901011632
Description
When using the PyOCD debugging plug in with an unknown board it is necessary to override the target device as PyOCD cannot figure this out automatically. The target choices provided for the override target field in the debugger tab of the PyOCD debug configurations window are all in upper case, but the PyOCD GDB server expects the target to be specified in lower case with the result that the PyOCD GDB server fails to start. Manually overtyping in the override target field the desired target in lower case will result in the PyOCD GDB server successfully starting.
Steps to Reproduce
Connect an unknown DAPLINK board to the computer (I'm using a Red Bear Blend 2).
Expected behaviour:
The PyOCD GDB server starts and you are prompted to open the debug perspective (if not already open).
Actual behaviour:
A problem occurred message box is displayed stating that the pyOCD GDB server failed with code (2). If you look at the GDB PyOCD Debugging console you see a usage message for PyOCD GDB server along with the error message: "pyocd-gdbserver: error: argument -t/--target: invalid choice" along with a list of valid choices all in lower case (including nrf52).
If the plugin is querying pyocd-gdbserver for supported targets (which it appears to do) it is somehow do a case conversion somewhere along the way that it shouldn't do.
Versions
The only issue I could find that is related to this is issue #82 - the fix for that issue seems to be in the code so I expect this is something different.