Debugging Error of STM32f407 using Linux Ubuntu and openocd

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

nami1216
Posts: 9
Joined: Wed Aug 21, 2019 5:05 pm
Has thanked: 2 times

Debugging Error of STM32f407 using Linux Ubuntu and openocd

Postby nami1216 » Sat Aug 31, 2019 5:18 pm

Hi friends,
May you please give me some times to help.
I am trying to debug stm32f407 using Eclipse, openocd, and stlink.
During the debug, I got that error (image file)
Do you know the reason for that problem, I think problem is in halInit() function.
Thank you so much.
Attachments
Screenshot from 2019-09-01 01-06-50.png

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Debugging Error of STM32f407 using Linux Ubuntu and openocd

Postby Giovanni » Sat Aug 31, 2019 5:24 pm

I think, you are using GDB for x86, this is why it fails.

Not sure, are you using ChibiStudio or a self built toolchain? You may try our pre-configured VM and verify differences.

Giovanni

nami1216
Posts: 9
Joined: Wed Aug 21, 2019 5:05 pm
Has thanked: 2 times

Re: Debugging Error of STM32f407 using Linux Ubuntu and openocd

Postby nami1216 » Sat Aug 31, 2019 5:35 pm

Giovanni wrote:I think, you are using GDB for x86, this is why it fails.

Not sure, are you using ChibiStudio or a self built toolchain? You may try our pre-configured VM and verify differences.

Giovanni


Hello Giovanni.
I am not using ChibiStudio. I am using Eclipse Luna, Openocd 0.10 and Chibios 3.0.2. So, I built toolchain by myself.
Yesday, when I tried to program for led blink, but the program did work incorrectly. In this program, for thread function, I just blink 1 led, and in the main loop, just checked button status. Then the led could not blink. So, I think there are some problem in configuration or init, but I did not know where.

How can I use your pre-configured VM?
Thanks

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Debugging Error of STM32f407 using Linux Ubuntu and openocd

Postby Giovanni » Sat Aug 31, 2019 5:39 pm

Self-built toolchains are a common cause of problems, we recommend using GCC built by ARM, they do patching on top of release code:

https://launchpad.net/gcc-arm-embedded

The VM is available here, all you need is VirtualBox, user/pass are chibios/chibios, launchers are in the task bar:

https://osdn.net/projects/chibios/releases/71386

You need to combine the 3 files in a single file:

cat VM_*.7z.* > VM_LinuxMint19.2_with_ChibiStudioP2.7z

Please see the whole discussion here, there are hints: viewtopic.php?f=3&t=5176

Giovanni

nami1216
Posts: 9
Joined: Wed Aug 21, 2019 5:05 pm
Has thanked: 2 times

Re: Debugging Error of STM32f407 using Linux Ubuntu and openocd

Postby nami1216 » Sat Aug 31, 2019 5:50 pm

Giovanni wrote:Self-built toolchains are a common cause of problems, we recommend using GCC built by ARM, they do patching on top of release code:

https://launchpad.net/gcc-arm-embedded

The VM is available here, all you need is VirtualBox, user/pass are chibios/chibios, launchers are in the task bar:

https://osdn.net/projects/chibios/releases/71386

You need to combine the 3 files in a single file:

cat VM_*.7z.* > VM_LinuxMint19.2_with_ChibiStudioP2.7z

Please see the whole discussion here, there are hints: viewtopic.php?f=3&t=5176

Giovanni


Thank you so much for your rapid reply.
how can I install VM in VirtualBox? Do you have any tutorial?
I will try VM.

nami1216
Posts: 9
Joined: Wed Aug 21, 2019 5:05 pm
Has thanked: 2 times

Re: Debugging Error of STM32f407 using Linux Ubuntu and openocd

Postby nami1216 » Sat Aug 31, 2019 6:07 pm

Giovanni wrote:Self-built toolchains are a common cause of problems, we recommend using GCC built by ARM, they do patching on top of release code:

https://launchpad.net/gcc-arm-embedded

The VM is available here, all you need is VirtualBox, user/pass are chibios/chibios, launchers are in the task bar:

https://osdn.net/projects/chibios/releases/71386

You need to combine the 3 files in a single file:

cat VM_*.7z.* > VM_LinuxMint19.2_with_ChibiStudioP2.7z

Please see the whole discussion here, there are hints: viewtopic.php?f=3&t=5176

Giovanni


Before I use ChibiOS. I tried to program stm32f407 for led blink using Eclipse, openocd, and arm-none-eabi-gcc. And it worked well. But for now, I made that error.
So I think the the problem is from gcc.
what do you think about that?

rew
Posts: 380
Joined: Sat Jul 19, 2014 12:59 pm
Has thanked: 2 times
Been thanked: 13 times

Re: Debugging Error of STM32f407 using Linux Ubuntu and openocd

Postby rew » Tue Sep 03, 2019 9:44 am

That is a real possibility. There is a wide range of compilers that Giovanni is not happy with because they mess up the "task switching code" or something like that.

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Debugging Error of STM32f407 using Linux Ubuntu and openocd

Postby Giovanni » Tue Sep 03, 2019 10:55 am

In the past it happened several times that self-built GCCs or GCCs included in various Linux distros repositories didn't work very well.

This is why ChibiStudio exists, we are not interested in creating a toolchain, its purpose is to provide a known starting point for everybody.

Anyway, better start from a known compiler: https://launchpad.net/gcc-arm-embedded , it is maintained by ARM developers so it is the safest choice.

Giovanni


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 17 guests