Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 6 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
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 2014Well, 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 2014Yes, 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