Olek's blog

To content | To menu | To search

Tag - CooCox

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.

Sunday, November 10 2013

STM32F429I FLASH driver for CooCox

I have recently bought STM32F429I-DISCO (or STM32F429I-DISCOVERY) board from ST. Unfortunately, as far as I know, it is not yet supported by any free IDE. I am trying to compile the project under CooCox (with moderate success, the test applications are working but the main payload with FreeRTOS is not). I was using ST-Link Utility for programming the FLASH memory so debugging was not possible. To enable debugging the application under CoIDE a dedicated FLASH programming code had to be prepared.

I have managed to adapt the sources of FLASH drver provided by CooCox for the STM32F429I microcontroller. I enclose the modified sources and binary driver. For quick and dirty installation, you can just copy the ELF file into the 'flash' subdirectory under your CoIDE / CoFlash application and point it in the project settings (last tab). I have verified my modifications by downloading the example application from ST to FLASH. Using the driver I am also able to download my compilation to the microcontroller and debug it. I cannot guarantee it is 100% correct but at least it works for me :-)

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.