pyocd with eclipse under Ubuntu18.04


Lawrence King
 

Dear All:

 

I am a bit of a newbie at Zephyr development, so I am just getting started. Last night my Nitrogen board arrived so I setup a development system on Ubuntu 18.04 following the instructions in the getting started guide here: https://docs.zephyrproject.org/1.13.0/getting_started/getting_started.html  and here: https://docs.zephyrproject.org/1.13.0/getting_started/installation_linux.html

 

All went well except for a couple small issues:

  1. The version of Cmake that apt-get installs is too old for the latest zephyr kernel so I had to download, build and install the latest cmake. No big problem, just annoying.
  2. I originally tried putting  the sdk in my bin directory, but no matter how many places I exported the ZEPHYR_SDK_INSTALL_DIR from cmake always insists on searching in /opt/zephyr-sdk. I gave up and simply installed the sdk in /opt and the problem went away.

 

I have successfully built the hello-world and created the zephyr.elf file. Now I want to setup Eclipse to load and debug it. “pyocd-flashtool -l”  successfully finds my Nitrogen board so that part is setup OK. Eclipse finds my project and builds it, the last step is getting eclipse to load the program to the Nitrogen and allow single-step/breakpoints in my code.

 

I have read the instructions for setting up Eclipse here: https://docs.zephyrproject.org/1.13.0/application/application.html#create-a-debugger-configuration most goes OK until I get to the “GDB Client Setup” step here I run into a small problem, I can’t find something equivalent to C:\gcc-arm-none-eabi-6_2017-q2-update\bin\arm-none-eabi-gdb.exe

 

Can someone point me to the correct executable for use under Ubuntu please? Is there something I didn’t install on Ubuntu?

 

Lawrence King

Principal Developer

Connected Transport Market Unit

https://www.Irdeto.com

+1(416)627-7302

 

1  2 - linkedin  3 - instagram  4 - youtube  6 - facebook  7

            

CONFIDENTIAL: This e-mail and any attachments are confidential and intended solely for the use of the individual(s) to whom it is addressed. It can contain proprietary confidential information and be subject to legal privilege and/or subject to a non-disclosure Agreement. Unauthorized use, disclosure or copying is strictly prohibited. If you are not the/an addressee and are in possession of this e-mail, please delete the message and notify us immediately. Please consider the environment before printing this e-mail. Thank you.

 

 

 


Andy Gross
 



On Fri, 15 Feb 2019 at 13:39, Lawrence King <lawrence.king@...> wrote:

Dear All:

 

I am a bit of a newbie at Zephyr development, so I am just getting started. Last night my Nitrogen board arrived so I setup a development system on Ubuntu 18.04 following the instructions in the getting started guide here: https://docs.zephyrproject.org/1.13.0/getting_started/getting_started.html  and here: https://docs.zephyrproject.org/1.13.0/getting_started/installation_linux.html


Welcome to Zephyr, Lawrence!
 

All went well except for a couple small issues:

  1. The version of Cmake that apt-get installs is too old for the latest zephyr kernel so I had to download, build and install the latest cmake. No big problem, just annoying.
  2. I originally tried putting  the sdk in my bin directory, but no matter how many places I exported the ZEPHYR_SDK_INSTALL_DIR from cmake always insists on searching in /opt/zephyr-sdk. I gave up and simply installed the sdk in /opt and the problem went away.

 

I have successfully built the hello-world and created the zephyr.elf file. Now I want to setup Eclipse to load and debug it. “pyocd-flashtool -l”  successfully finds my Nitrogen board so that part is setup OK. Eclipse finds my project and builds it, the last step is getting eclipse to load the program to the Nitrogen and allow single-step/breakpoints in my code.

 

I have read the instructions for setting up Eclipse here: https://docs.zephyrproject.org/1.13.0/application/application.html#create-a-debugger-configuration most goes OK until I get to the “GDB Client Setup” step here I run into a small problem, I can’t find something equivalent to C:\gcc-arm-none-eabi-6_2017-q2-update\bin\arm-none-eabi-gdb.exe

 

Can someone point me to the correct executable for use under Ubuntu please? Is there something I didn’t install on Ubuntu?


 <SDK INSTALL DIR>sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-gdb

Regards,

Andy Gross
Linaro



Lawrence King
 

Thanks Andy,

 

That gets me past one error and opens a new one: when I try to start the debugger I get a message: “pyOCD GDB Server failed with code (2).” I suspect I have the  Debug Configuration -> Debugger -> pyOCD Setup -> Executable set wrong. Should I be using “pyocd”, “pyocd-server”, or something else?

 

If you get a chance can you update the documentation page at https://docs.zephyrproject.org/1.13.0/application/application.html#create-a-debugger-configuration for linux users so other people don’t have the same issues.

 

P.S. Andy - we have met several times at various Linaro Connects, however I was wearing a different hat at that time.

 

Lawrence King

Principal Developer

+1(416)627-7302

 

From: Andy Gross <andy.gross@...>
Sent: Friday, February 15, 2019 2:46 PM
To: Lawrence King <lawrence.king@...>
Cc: Zephyr-users@...
Subject: Re: [Zephyr-users] pyocd with eclipse under Ubuntu18.04

 

 

 

On Fri, 15 Feb 2019 at 13:39, Lawrence King <lawrence.king@...> wrote:

Dear All:

 

I am a bit of a newbie at Zephyr development, so I am just getting started. Last night my Nitrogen board arrived so I setup a development system on Ubuntu 18.04 following the instructions in the getting started guide here: https://docs.zephyrproject.org/1.13.0/getting_started/getting_started.html  and here: https://docs.zephyrproject.org/1.13.0/getting_started/installation_linux.html

 

Welcome to Zephyr, Lawrence!

 

All went well except for a couple small issues:

  1. The version of Cmake that apt-get installs is too old for the latest zephyr kernel so I had to download, build and install the latest cmake. No big problem, just annoying.
  2. I originally tried putting  the sdk in my bin directory, but no matter how many places I exported the ZEPHYR_SDK_INSTALL_DIR from cmake always insists on searching in /opt/zephyr-sdk. I gave up and simply installed the sdk in /opt and the problem went away.

 

I have successfully built the hello-world and created the zephyr.elf file. Now I want to setup Eclipse to load and debug it. “pyocd-flashtool -l”  successfully finds my Nitrogen board so that part is setup OK. Eclipse finds my project and builds it, the last step is getting eclipse to load the program to the Nitrogen and allow single-step/breakpoints in my code.

 

I have read the instructions for setting up Eclipse here: https://docs.zephyrproject.org/1.13.0/application/application.html#create-a-debugger-configuration most goes OK until I get to the “GDB Client Setup” step here I run into a small problem, I can’t find something equivalent to C:\gcc-arm-none-eabi-6_2017-q2-update\bin\arm-none-eabi-gdb.exe

 

Can someone point me to the correct executable for use under Ubuntu please? Is there something I didn’t install on Ubuntu?

 

 <SDK INSTALL DIR>sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-gdb

 

Regards,

 

Andy Gross

Linaro

 

 


Andy Gross
 

On Fri, 15 Feb 2019 at 14:24, Lawrence King <lawrence.king@irdeto.com> wrote:

That gets me past one error and opens a new one: when I try to start the debugger I get a message: “pyOCD GDB Server failed with code (2).” I suspect I have the Debug Configuration -> Debugger -> pyOCD Setup -> Executable set wrong. Should I be using “pyocd”, “pyocd-server”, or something else?
I use pyocd-gdbserver. Once you spawn that, you can connect to it via
`gdb target remote localhost:3333`.


If you get a chance can you update the documentation page at https://docs.zephyrproject.org/1.13.0/application/application.html#create-a-debugger-configuration for linux users so other people don’t have the same issues.
I'll take a look. Those docs usually get updated pretty regularly.

P.S. Andy - we have met several times at various Linaro Connects, however I was wearing a different hat at that time.
Yeah I recognized the name. Small world, huh? =D

Regards,

Andy