9 years, 11 months ago.

Offline compile with arm-none-eabi-gcc toolchain

Hello,

I have tried to set up an arm-none-eabi-gcc toolchain to compile c code offline for STM32F401RE (Nucleo-F401RE) dev board. I used the source of the GPIO-IOToggle example provided by STM32Cube_FW_F4_V1.1.0 (http://www.st.com/web/en/catalog/tools/PF259243)

I have the arm-none-eabi-gcc toolchain installed (gcc version 4.8.3 20131129 (release) [ARM/embedded-4_8-branch revision 205641] (GNU Tools for ARM Embedded Processors)), which I also use to compile code for a STM32F429I on a STM32F4-Discovery board.

These two projects combined I managed to get the GPIO_IOToggle example compiled for the nucleo board. Flashing with st-flash also works (checked by flashing downloaded *.bin files of the online compiler by mbed)

BUT the program does not work. I started using nemiver to debug and figured that it crashes during SystemInit. It processes the startup code in startup_stm32f401xe.s and jumps to SystemInit in line 111.

Then, in SystemInit function (system_stm32f4xx.c) line 150 something is going wrong and it jumps to stm32f4xx_it.c to

stm32f4xx_it.c

void HardFault_Handler(void)
{
  /* Go to infinite loop when Hard Fault exception occurs */
  while (1)
  {
  }
}

I uploaded the source including Makefiles here: https://github.com/wiederma/nucleo_f401re_gcc

Maybe someone could give me some hint? Thx

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F401RET6 microcontroller.

You should stated this is not mbed related. I don't see any mbed sources in your shared repository.

posted by Martin Kojtal 13 May 2014

Well, that's true ... no direct mbed code in this project ... but since I started with the mbed online compiler to write my first code for my nucleo I thought someone in this forum also tried to go a step ahead and compile code using arm-none-eabi-gcc for nucleo I also saw the disabled feature for exporting source to ARM gcc ...

posted by Norbert Wiedermann 13 May 2014

Yes, true. Therefore to port it to GCC, just follow the folder structure as it's for example for KL25Z. Add a linker command file, startup. Seeing that you are familiar with a github, should not be a problem.

posted by Martin Kojtal 13 May 2014
Be the first to answer this question.