Olek's blog

To content | To menu | To search

Tag - CoIDE

Entries feed

Monday, November 11 2013

Example project for STM32F429I under CooCox

I have prepared a simple demo project for STM32F429I that compiles under CooCox. It is a stripped down version of demo project from ST. It isn't very nice but shall be enough to provide a quick start with the STM32F429I microcontroller.

What is included:

  • StdPeriph libraries
  • LCD handling functions
  • touch panel support
  • external SDRAM test
  • gyroscope test

What is not included:

  • FreeRTOS
  • USB support
  • Widgets drawing library
  • DSP library

Download link: STM32F429I demo project CooCox

See my previous post for 2 MB FLASH programming algorithm for CooCox.

Thursday, March 21 2013

STM32F4 C++ project in CooCox

For some time I have been struggling with compilation of C++ code for the STM32F4-DISCOVERY development kit - finally, it works. Here are some tips on preparing your own C++ project in CoIDE (version 1.7.0):

  • Include from repository the following components: C Library, M4 CMSIS Core, CMSIS Boot, and whatever else your application needs
  • In linker settings add the stdc++ and supc++ libraries, but be careful to select the 'right' version. In my case the full path to those files was C:\Program Files (x86)\arm-none-eabi-gcc-4_6\arm-none-eabi\lib\armv7-m (notice the last directory on path)
  • Do not rename files from .c to .cpp using F2 - it will not rename them on disk. Instead remove the files from project, rename them manually and add again.
  • With current CooCox and arm-none-eabi-gcc-4_6 compiler you do not have to write a single line of code more (especially, do not need to rewrite the 'new' operator nor modify the linker script, you also do not need to modify the project file - .cpp sources will be properly recognized by default)

Selecting the wrong version of libraries results in rising an exception during allocation of memory using the 'new' operator. In case you receive the "undefined reference to 'assert_param'" error, add the 'USE_STDPERIPH_DRIVER' to the 'Defined Symbols' list in project configuration.

My example project with abstract class, virtual methods and memory allocation with 'new' operator is available here: STM32F4 C++ example.