free toolchain for stm32f405/407

I was always doing PIC stuff, now decided to move to arm.

I will be working with stm32f103, but then mostly with stm32f405 MCUs.

I was wondering which combination of free toolchain would support both chips? i made a search and i mostly see support for stm32f103 series… just wondering would that also work for f405 series?

so, who knows of a good universal and free toolchain which would allow utilize all program memory of mentioned MCUs?

The codesourcery free toolchain will work. BUT, there are the required startup and linker scripts that have to be made.

The STM32F4 demos that come with the Discovery board are all for $$$ compilers. I was going to start from the STM32M3 (aka stm32f10x) tools and try to get to F4, but have not gotten it going yet.

warning: stm32 is a completely different animal from pic, and free tools are the hardest way to get there. Rowley Crossworks is the cheapest way to start, $150 for a personal, non-commercial license. Pro licenses start usually around $2000 a seat.

I picked up a STM32F4-Discovery board last month to play with and I am using the GNU tools. This was the easiest path for me since I pretty much only run Linux. It has worked pretty well but I am avoiding the ST provided standard peripheral libraries like the plague. Which isn’t a big deal as so far it has been easier to deal with the hardware directly. So far I have blinking LEDs, interrupt driven serial port, and I am now working on a driver for the SDIO port. Which is the reason behind this project.

I started [here.](https://github.com/texane/stlink/blob/master/doc/tutorial/tutorial.pdf?raw=true)

Thanks UhClem for the reference.

I will have to see how their examples are setup.

I am curious how you are using the usb, ethernet and other advanced stuff without their libs?

I am using the mthomas code setups for M3, which I understand after using it a long time, but this means we have to make linker and startup codes for the new proc.

motopic:
I am curious how you are using the usb, ethernet and other advanced stuff without their libs?

I'm not using USB or Ethernet, just SDIO. The stm32f4xx.h include file has all the necessary register definitions.

ok thanks for the responses, now here is the thing:

  1. i am not looking forward to use that discovery board, i will be using just that STM32F405 chip on a custom board, and on that tutorial i see that the software talks to STLINK usb chip located on discovery board which translates commands via JTAG to STM32.

  2. as far as i know every STM32 chip comes with internal bootloader, and it is possible to program it via RS232, so now question is: is it possible to fully program STM32F405 chip using those tools WITHOUT any STLINK stuff?

actually i think it should…because all the GNU toolchain does is generating a HEX file isnt it? and then it turns out that i can put in that HEX file into STM32 even via the free FlashLoader program?

the only thing is, i wont be able to do in-circuit debugging.

am i right?

another questions are:

  1. does it mean that this software will work with separate ST-LINK hardware debugger connected via JTAG cable to custom board with stm32f405?

  2. and can it debug peripherals? or IO port states etc? SFRs?

You can be up and running in less than 30 minutes by going with the Rowley Crossworks IDE/Compiler/Debugger - they offer a 30 day FREE evaluation with no limits.

You can debug (single step, breakpoints, examine/change/watch registers, etc.) and program your custom board with the separate $25 ST-Link. Or you can use the ST-Link on any of the Discovery boards. All you need is 4 connections (PWR, GND, SWDIO, SWCLK) for the SWD (not JTAG) interface on your board.

im not interested in time/code limited software at all.

ColdStart:
im not interested in time/code limited software at all.

Fair enough, if you do not place any value on your time.

motopic:
stm32 is a completely different animal from pic, and free tools are the hardest way to get there.

Very good advice.

rmteo1,

that was not advice that was just statement of fact, yes everyone knows that setting this thing up is hard, but that doesnt answer my questions. if you know how to solve things and wish to bring it on then go ahead, if no then saying its hard is pointless.

right now i am messing with Eclipse, i have already success of tying it to sourcery g++. So i solved that problem.

and from my investiogation today, it seems that those debuggers DO NOT support ST-LINK.

so, i’ll be looking for a way to tie ST-LINK part from tutorial provided by a uhClem, to the development tools which i set up.

another problem is creating the right linker script for STM32F405/407 devices, looking at it now

What about the free/lite version of [Atollic TrueSTUDIO

It is without any time or code limitations and can be used with both the F1, F2, F3 and F4 series of the STM32 microprocessor family.

I have been using [Ride7for quite some time, but in the beginning of the new year they released an update which requires you to buy their software and pay for updates on a yearly basis. So unfortunately this is not free anymore. But I still have their debugger hardware which is only supported by their IDE :(](RAISONANCE, MCU application development solutions)](http://www.atollic.com/index.php/download/downloadstm32)

Most Linux tools use OpenOCD. OpenOCD does not support ST-Link or SWD. So if you use open source GNU tools, you will have to use JTAG. I am using the lite version of Atollic TrueSTUDIO for programming a STM32F103. Have not had any problems. It supports ST-Link.

hello dschlic1

i’m still figuring things out with free toolchain.

But i decided download Atollic and give it a try, well i set up a project for stm32f103re, i added simple program with just while loop.

i just tried to build it all and it gave me an error:L

target CPU does not support ARM mode

i checked its settings, all seems fine, any ideas why would it do that?

p.s. i also tried adding stm32f10x.h, startup_stm32f10x_hd.s, system_stm32f10x.h files to a project. but it didnt help. same error.

so what could be a reason?

one more thing.

in the project build options, settings. Assembler and C compiler Target, i see that Software Implementation is selected for Floating Point. And i cant change it. those menus are disabled. Maybe thats the problem? and why cant i change that?

ColdStart:
one more thing.

in the project build options, settings. Assembler and C compiler Target, i see that Software Implementation is selected for Floating Point. And i cant change it. those menus are disabled. Maybe thats the problem? and why cant i change that?

You can't change these options in the Lite version of the software.

Software Implementation for the Floating Point is also right for the STM32F103, as it doesn’t have any Floating Point Unit.

How did you set up the project? Did you just create a totally blank project, or did you use the project wizard to create a blank project for the STM32F103 including system header files and startup script?

yes…sorry for a second i was confused. yea right now im using f103 just for test.

i created totally blank project…but i guess thats what wizard does no?

File->new->C project then entering name of project, in the toolchains i see tollic arm tools.

then next, i see debug and release checked, then finish. now project created.

now i click on that project on the left, then go to Project->Properties, then to C/C++ Build, Settings. and set

Evaluation board: none,

Microcontroller family: STM32 high density devices

Microcontroller: STM32f103re

code location: FLASH

press Apply. it says that appropriate new linker script will be generated, i press ok. done, then press OK

on the left i see a Includes tree. thats it. now i just add simple main.c which has only this:

//#include <stdio.h>
#include "stm32f10x.h"



int main () {
 // int i;
 // int n;


	//GPIOA->CRL = 0x0;



  while(1) ;
  return 0;
}

and then i see that error:

target CPU does not support ARM mode.

i wonder what did i miss?

i accidentally pressed SOLVED button, but problem still not solved :stuck_out_tongue:

ColdStart:
i accidentally pressed SOLVED button, but problem still not solved :stuck_out_tongue:

Well I have no problems at all.

I have just created a blank project for you and attached a zip-file with it.

ok i was doing wrong, i just had to choose new c project, and then embedded c project. it compiles now.

havent tested with board yet though.

thank you for advice.