Hello, some time ago I started to play with CortexM4,
I bought a Discovery Board with a STM32F407VG in order to be programmed with uVision from Keil.
I am developing a project where the money is very restricted, that's why I was using a free licence from Keil.
Everything was working fine until I exceed the program size of 32KB(now I need to pay the license if I want to continue for this way).
I started to look for other option, and gnu-arm-none-eabi with Eclipse seems to be the answer.
The big problem are the peripherals: I need to use UART(to output message on debugging time using the famous "printf()") and SDIO to log some variables from different sensors that require I2C.
In general terms: what are the aspects that I need to consider when I switch those IDEs: from uVision to "System Workbench for STM32" known as SW4STM32.
Hi Jens, my firs approach was just installing gnu-arm-none-eabi and the run a simple example. It was working fine until I call function "printf()".
"printf()" was redirected to USART6 on my DiscoveryBoard(it is working very nice if project is compiled under Windows using UVision IDE), By the time I took the same project and in order to built it under gnu-arm-none-eabi I got some messages from linker:
"undefined reference to `_exit'"
undefined reference to `_exit'
"undefined reference to `_sbrk'"
undefined reference to `_sbrk'
"undefined reference to `_write'"
undefined reference to `_write'
"undefined reference to `_close'"
undefined reference to `_close'
"undefined reference to `_fstat'"
undefined reference to `_fstat'
"undefined reference to `_isatty'"
undefined reference to `_isatty'
"undefined reference to `_lseek"
undefined reference to `_lseek
"undefined reference to `_read'"
undefined reference to `_read'
As I read, "printf()" make some system calls. In a Bare-Metal environment those function need to be implemented. At this moment I don't have idea how to do it and how to to test them.
Do you have a reference wiah can help me?
Thanks in advance,
Mariano
The problem is in your Makefile; you need to add a library, which provides those functions.
Fortunately, I've read somewhere on the net, that Eclipse provides an easy interface to add libraries.
From reading about Eclipse, I understand that it provides a way for you to receive the output from printf in the debugger.
This is probably what you would prefer the most, so I'll refer to the official Eclipse page:
Tutorial: Create a Hello ARM test project
Tutorial: Create a blinky ARM test project (this is the correct project, not the above one)
There's more here:
printf() and scanf() with GNU ARM Libraries | MCU on Eclipse
Alternatively, you can add your own libraries, that handles printf. This will require some editing, though:
g. printf to USART1 - Learning Eclipse & ARM
To add a new library:
C/C++ Build > Settings > Tool Settings > > GCC C++ Linker > Libraries > Libraries (-l)
Press the '+' button and add your library there.