Segfault after moving from YAGARTO to GNU Tools for ARM Embedded Processors

Asked by CaCO3

Hi all

I am trying to move from the no longer maintained YAGARTO tools [1] to
GNU Tools for ARM Embedded Processors.
I am developing for an STM32F407.
My code compiles fine, how ever when running it, it crashes on the array initialization.
---------------------------------------
    char d[2]; //ok
    d[0] = 1;
    d[1] = 2;

    char e[2] = {1, 2}; //seg fault
---------------------------------------

The very same code and makefile work fine when using the YAGARTO toolchain!

Where could the issue be?
I can provide more information if required.

[1] http://www.yagarto.org/

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
CaCO3
Solved:
Last query:
Last reply:
Revision history for this message
Thomas Grieger (t-grieger) said :
#1

Hi,

could you provide some more information and/or a full code snippet?

I assume you get a hardfault or more likely a forced hardfault because the correct interrupt (bus fault) is not active?

Best regards,
Thomas

Revision history for this message
Joey Ye (jinyun-ye) said :
#2

Please provide a project to reproduce. The code piece you shared isn't
enough to diagnose
On Dec 11, 2013 9:26 PM, "CaCO3" <email address hidden>
wrote:

> New question #240624 on GCC ARM Embedded:
> https://answers.launchpad.net/gcc-arm-embedded/+question/240624
>
> Hi all
>
> I am trying to move from the no longer maintained YAGARTO tools [1] to
> GNU Tools for ARM Embedded Processors.
> I am developing for an STM32F407.
> My code compiles fine, how ever when running it, it crashes on the array
> initialization.
> ---------------------------------------
> char d[2]; //ok
> d[0] = 1;
> d[1] = 2;
>
> char e[2] = {1, 2}; //seg fault
> ---------------------------------------
>
> The very same code and makefile work fine when using the YAGARTO toolchain!
>
> Where could the issue be?
> I can provide more information if required.
>
> [1] http://www.yagarto.org/
>
> --
> You received this question notification because you are an answer
> contact for GCC ARM Embedded.
>

Revision history for this message
CaCO3 (caco3) said :
#3

Sorry for the late response.
I could sort out the problem.
For some non explainable reasons I had a wrong (not supported) FPU set in the Makefile.
After removed that flag, all works fine now.
Interestingly, the same wronge flag did not cause any trouble when using YAGARTO.