Page 1 of 1

Debugging Error of STM32f407 using Linux Ubuntu and openocd

Posted: Sat Aug 31, 2019 5:18 pm
by nami1216
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.

Re: Debugging Error of STM32f407 using Linux Ubuntu and openocd

Posted: Sat Aug 31, 2019 5:24 pm
by Giovanni
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

Re: Debugging Error of STM32f407 using Linux Ubuntu and openocd

Posted: Sat Aug 31, 2019 5:35 pm
by nami1216
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

Re: Debugging Error of STM32f407 using Linux Ubuntu and openocd

Posted: Sat Aug 31, 2019 5:39 pm
by Giovanni
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

Re: Debugging Error of STM32f407 using Linux Ubuntu and openocd

Posted: Sat Aug 31, 2019 5:50 pm
by nami1216
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.

Re: Debugging Error of STM32f407 using Linux Ubuntu and openocd

Posted: Sat Aug 31, 2019 6:07 pm
by nami1216
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?

Re: Debugging Error of STM32f407 using Linux Ubuntu and openocd

Posted: Tue Sep 03, 2019 9:44 am
by rew
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.

Re: Debugging Error of STM32f407 using Linux Ubuntu and openocd

Posted: Tue Sep 03, 2019 10:55 am
by Giovanni
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