Issue configuration

Firmware/software/electronics/mechanics
Hada Hamdi
Beginner
Posts: 28
Joined: Wed Jul 22, 2020 4:19 am

Issue configuration

Post by Hada Hamdi »

Hi,

Please I need your help! I am trying to debug using st LINK /v2. So, I used this page, https://www.bitcraze.io/documentation/r ... debugging/.
When, I do this 'sudo apt-get install arm-none-eabi-gcc', it returns 'E: Unable to locate package arm-none-eabi-gcc'. I tried to fix this issues but it still the same problem.

and when I tried to debug, it returns this issue ''OpenOCD GDB executable "arm-none-eabi-gdb" was not found.
Please configure "cortex-debug.armToolchainPath" correctly''


Help please! Thanks!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Issue configuration

Post by arnaud »

Hi,
what operating system are you using?
Hada Hamdi
Beginner
Posts: 28
Joined: Wed Jul 22, 2020 4:19 am

Re: Issue configuration

Post by Hada Hamdi »

Hi,

I am using Ubuntu 18.04.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Issue configuration

Post by arnaud »

Hi, thanks for the information, I can reproduce your problem on my side.

The problem seems to be a typo in the doc: you need to install gcc-arm-none-eabi instead.

The full dependency list then becomes:

Code: Select all

sudo apt-get install -y gcc-arm-none-eabi make python3 git
With that installed, it is possible to clone and build the Crazyflie firmware on Ubuntu 18.04 and 20.04.

I will update the documentation.
Hada Hamdi
Beginner
Posts: 28
Joined: Wed Jul 22, 2020 4:19 am

Re: Issue configuration

Post by Hada Hamdi »

Hi Arnaud,

Thank you for your answer!

I did it, I can't debug. It still this issue ''OpenOCD GDB executable "arm-none-eabi-gdb" was not found. Please configure "cortex-debug.armToolchainPath" correctly''

I am using vs code, I added the "cortex-debug.armToolchainPath" to my settings.json file:

Code: Select all

 {
"cortex-debug.armToolchainPath": "/usr/bin/arm-none-eabi-gcc",
"cortex-debug.openocdPath": "/usr/bin/openocd"
}
And my launch.json is as follows:

Code: Select all

{
            "name": "Cortex Debug",
            "cwd": "${workspaceRoot}",
            "executable": "./build_crazyflie/crazyflie/example/sample-crazyflie.elf",
            "request": "launch",
            "type": "cortex-debug",
            "device": "STM32F405",
            "svdFile": "STM32F405.svd",
            "servertype": "openocd",
           "configFiles": ["interface/stlink-v2.cfg", "target/stm32f4x.cfg"],
            "runToMain": true,
            "preLaunchCommands": [
                "set mem inaccessible-by-default off",
                "enable breakpoint",
                "monitor reset"
            ]
        },
        
Here, I didn't understand what's ''configFiles''.

I would like also to check with you, for the installation of Cortex-Debug: https://marketplace.visualstudio.com/it ... rtex-debug, using vs code, I have to do just ext install marus25.cortex-debug, or I have to install the tools in section ''Installation Requirements'' in the page that I mention.

Help please. Thank you.
Last edited by Hada Hamdi on Thu Oct 29, 2020 7:22 pm, edited 2 times in total.
Hada Hamdi
Beginner
Posts: 28
Joined: Wed Jul 22, 2020 4:19 am

Re: Issue configuration

Post by Hada Hamdi »

Hi,

Also, I tried to fix this issue by using this documentation https://blog.csdn.net/qq_40833810/artic ... /106713462 , it seems that for st link/v2, I have to install https://developer.arm.com/tools-and-sof ... /downloads.
and openocd https://sourceforge.net/projects/openocd/files/openocd/.

I put the correct path in the seeting.json file:

Code: Select all

"cortex-debug.armToolchainPath": "/home/student/Documents/gcc-arm-none-eabi-9-2020-q2-update/bin",
"cortex-debug.openocdPath": "/home/student/Documents/openocd-0.10.0" 
and for interfaces I need stlink-v2.cfg and stm32f4x.cfg, I put them in "configFiles": ["interface/stlink-v2.cfg", "target/stm32f4x.cfg"],

is it correct !!
Always the same problem. ""OpenOCD GDB executable "arm-none-eabi-gdb" was not found. Please configure "cortex-debug.armToolchainPath" correctly.""""

Thanks a lot !!
Attachments
issue config.png
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Issue configuration

Post by kristoffer »

I'm happy it worked out for you!

For anyone else that might have similar problems, there is information about how to set up a debugger in the repo docs. There is also a VsCode section https://www.bitcraze.io/documentation/r ... ng-vs-code
Hada Hamdi
Beginner
Posts: 28
Joined: Wed Jul 22, 2020 4:19 am

Re: Issue configuration

Post by Hada Hamdi »

Hi,

No, I said that I have the issue in the screenshot that I put previously.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Issue configuration

Post by arnaud »

It seems that you are just missing gdb. On Ubuntu there is a package called "gdb-multiarch" that seems to replace all platform specific gdb.

On my machine I could get vs-code cortex debug to work by adding a link to gdb-multiarch:

Code: Select all

sudo apt install gdb-multiarch
sudo ln -s /usr/bin/gdb-multiarch /usr/local/bin/arm-none-eabi-gdb
This allows vs-code to find gdb. You should just have openocd installed and then debugging should work using the st-link.

Most of the procedures found online will link to the arm-embedded gcc website. It should not be needed anymore to install gcc from there since the ubuntu package is working. Moreover, if you can update to Ubuntu 20.04, the gcc-arm-none-eabi now actually comes from the arm-embedded project.

Please us if my procedure above worked so that I can update the procedure on the howto page.
Hada Hamdi
Beginner
Posts: 28
Joined: Wed Jul 22, 2020 4:19 am

Re: Issue configuration

Post by Hada Hamdi »

Hi Arnaud,

Thank you for your reply.

To solve the problem, I follow this page in stack overflow https://stackoverflow.com/questions/534 ... urses-so-5.

Code: Select all

 sudo apt-get install build-essential libncurses5-dev libexpat1-dev texinfo-doc-nonfree
pushd /tmp
wget -qO- ftp://ftp.gnu.org/gnu/gdb/gdb-8.2.tar.xz | tar Jxv
mkdir gdb
cd gdb
../gdb-8.2/configure  --enable-tui --with-expat --prefix=/usr/local  --target=arm-eabi --program-prefix=arm-eabi-
make all
sudo make  install
popd 
And it's okay.
Post Reply