Author Topic: STM32F4 Discovery and arm-none-eabi-gcc  (Read 26957 times)

0 Members and 1 Guest are viewing this topic.

Offline McMonster

  • Frequent Contributor
  • **
  • Posts: 417
  • Country: pl
    • McMonster's blog
Re: STM32F4 Discovery and arm-none-eabi-gcc
« Reply #25 on: May 17, 2012, 10:55:51 pm »
I actually have STM32Discovery with Cortex-M3, and there are numerous problems with connecting this to IAR or Keil (as a matter of fact I didn't try Atollic IDE). I generally also thought that STLink is only for SWD interface, not classic JTAG, maybe I'll have to double-check that.

I've used this board with Atollic, worked flawlessly. And the built-in STLink is limited to SWD only on those boards, the full one can also do JTAG and SWIM (for 8-bit ST8 micros).

And I don't know about other ARM brands, but STM32s also have serial port bootloader built-in.

Offline Quiggers

  • Contributor
  • Posts: 28
Re: STM32F4 Discovery and arm-none-eabi-gcc
« Reply #26 on: June 24, 2012, 04:04:34 pm »
I just ordered one of these, a silly amount of number crunching for €14, I'm gonna try using eclipse but it's my first step into this, i've used keil for assembly and some ARM at uni but didnt get on with Keil's software so i'm looking for alternatives. XDA dev had an article about using eclipse with the STM32F0Discovery, hopefully that all applies to the F4 and i'm badgering the guy to doing more vids on the subject

Offline wireless

  • Newbie
  • Posts: 1
Re: STM32F4 Discovery and arm-none-eabi-gcc
« Reply #27 on: December 17, 2012, 01:40:11 am »
Okay I have installed the Linaro toolchain but I'm still getting an error message. It seems, that there is something wrong with one of the files included by the arm-none-eabi-gcc compiler that was shipped with Linaro:

Code: [Select]
make all
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mlittle-endian -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb-interwork  -Os  -DUSE_STDPERIPH_DRIVER -DSTM32F4XX -DMANGUSTA_DISCOVERY -DUSE_USB_OTG_FS -DHSE_VALUE=8000000 -I./ -I./ -I../../Utilities/STM32F4-Discovery -I../../Libraries/CMSIS/ST/STM32F4xx/Include/ -I../../Libraries/CMSIS/Include/ -I../../Libraries/STM32F4xx_StdPeriph_Driver/inc/ -I../../Libraries/STM32_USB_Device_Library/Class/hid/inc -I../../Libraries/STM32_USB_Device_Library/Core/inc/ -I../../Libraries/STM32_USB_OTG_Driver/inc/  -Wl,-T,stm32_flash.ld main.c stm32f4xx_it.c system_stm32f4xx.c ../../Utilities/STM32F4-Discovery/stm32f4_discovery.c ../../Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_syscfg.c ../../Libraries/STM32F4xx_StdPeriph_Driver/src/misc.c ../../Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c ../../Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c ../../Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_exti.c startup_stm32f4xx.S -o demo.elf
/opt/arm-none-eabi-gcc-4_6/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7e-m/fpu/libc.a(lib_a-exit.o): In function `exit':
exit.c:(.text+0x16): undefined reference to `_exit'
collect2: ld returned 1 exit status
make: *** [demo.elf] Error 1

According to arm-none-eabi-gcc this version does support HWFP. 

Thanks for the tip with Linaro though!

If you are using an stm32_flash.ld file as your load file, and you are using a .text section that looks like the one below, then this problem can most likely be resolved by adding an _exit line to the .text section (see the example below).
    _exit = .;

 /* The program code and other data goes into FLASH */
  .text :
    . = ALIGN(4);
    *(.text)           /* .text sections (code) */
    *(.text*)          /* .text* sections (code) */
    *(.rodata)         /* .rodata sections (constants, strings, etc.) */
    *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
    *(.glue_7)         /* glue arm to thumb code */
    *(.glue_7t)        /* glue thumb to arm code */

    KEEP (*(.init))
    KEEP (*(.fini))

    . = ALIGN(4);
    _etext = .;        /* define a global symbols at end of code */
    _exit = .;
  } >FLASH

Offline PeeweePete

  • Contributor
  • Posts: 10
Re: STM32F4 Discovery and arm-none-eabi-gcc
« Reply #28 on: December 21, 2012, 09:30:22 am »
This may help, it is basic ARM GCC code examples

Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo