10 years, 9 months ago.

Adding gcc toolchain support for F401RE?

Hi all,

I'd like to use gcc toolchain for F401RE. I was poking around, comparing it with STM32FXX. There are just two files - STM32F407.ld and startup_.....s to change, so it shouldn't be that difficult. If I understand it well, only the ram size, processor and handlers should be changed to fit F401RE. But there may be more to it, so I'd like somebody more experienced push me into right direction/confirm. Thanks. Todor

4 Answers

10 years, 9 months ago.

Hello b C,

Theoretically they should be similar, so it can serve as a template for new nucleo boards. To test it, add it to exporters, a makefile template and to scripts (targets.py). After testing, send a pull request, we will review it then merge it to master. Thanks.

Regards,
0xc0170

Accepted Answer
b C
poster
10 years, 9 months ago.

Hi all,

thanks for answers. I've manaegd to do the changes so the compilation produces working binary. What I don't know, though, is where are the makefile templates and where to add the variant into exporters. Other changes mentioned in the Martin's post are done. Cheers, Todor

Look at workspace_tools, there'is a folder export. There is gcc.py where you add your target and then makefile template for it. Before you submit it on github, please test basic functionality, like interrupts, stack and heap and memory layout if everything is correctly set.

If I find time, I can write a guide how to add a toolchain ;)

Regards,
0xc0170

posted by Martin Kojtal 23 Mar 2014
10 years, 9 months ago.

HI b C. I have been looking at the .ld and .s files for the STM32Fx configuration. Could you let us know what it is exactly that needs to be changed in the files. In the .ld i can see the locations of FLASH, CCM and RAM and changed these accordingly for the NUCLEO L152RE ( think..) What else needs to be changed? Any help appreciated. Cheers. :) Steve.

Hi there, what I did was a diff between STM32Fx and NUCLEO_F401RE of file startup_xxxxx.s which gave me handlers that should be replaced with .long 0 /* Reserved */ into nucleo (and there was like one handler to add) gcc_arm xxxxx.s file. The stmxxxxxx.sct file gave me memory ranges for nucleo that went to nucleo xxxxx.ld file.That's all I did. Cheers, Todor

posted by b C 23 Mar 2014

Do you have working version of gcc toolchain support ? CAn you send a pull request on github? If you have any problems, let me know.

We can then enable gcc exporters ;)

0xc0170

posted by Martin Kojtal 24 Mar 2014

Hi Martin, I've created the pull request. It compiles a working blinking test program. I don't have anything else to test it with at the moment. Cheers, Todor

posted by b C 24 Mar 2014

Thanks for sharing guys, and especially Todor for the pull request. Hope that helps me build offline with Eclipse and the GCC toolchain. Cheers.

posted by Josh N 24 Mar 2014

@Josh - you are welcome. The exporters/makefile template is still missing though. :)

posted by b C 24 Mar 2014
10 years, 9 months ago.

I just did this very thing for the F103RB board. I can now compile the blinky test app using my offline gcc arm compiler and it loads and runs on target. From what I can tell, (as Todor mentioned), it indeed seems that the only difference between the boards is the layout and size of the ISR vector and memory. In my case, I simply cloned the files from TARGET_STM32F4XX and updated the ISRs and the memory layout/sizing specific to the F103RB and that was essentially it.