ARM Development, Part 2

I have had some progress with development on the ARM Cortex-M3 STM32F103R8T6 MINI STM32 Development Board, aka “Cortex Study Board” by LC STUDIO. The simple blinking LED project was a breakthrough for my self education but I want a much more capable platform than a simplistic loop. Although I tested Nuttx, it is really to large for the STM32F103R8T6’s somewhat limited memory (128 Kbytes of Flash memory and 20 Kbytes of SRAM). I turned to FreeRTOS, which has a much smaller footprint. This unstripped demo, for example, occupies 39,896  of code space and 2,296 of data (not counting stack).

Finding an existing project that would compile turned out to be challenging. Virtually every web-available STM32 FreeRTOS project is (1) written for STMicroelectronics STM32VLDISCOVERY board; (2) written for Microsoft Windows; (3) is designed for use within Eclipse. I use only Linux, have an LC STUDIO board instead of the STM32VLDISCOVERY and, while I do have eclipse installed, I want to use a traditional Makefile for my ARM development.

After much searching and trial and error with other posted projects I came across a FreeRTOS demo project by ‘Yus of the Philippines that was configured specifically  for the STM32F103R8 cpu and the I/O configuration even matched that of the LC STUDIO board. Alas, it too would not compile. However, this time the error was obvious and fixable. The FreeRTOS code was trying to link to a standard library call “getpid()” that simply does not exist in the STM Standard Peripherial Library. Some additional web searching found a cure.  Geoffrey Brown a Professor of Computer Science  at Indiana University authored an excellent manual titled “Discovering the STM32 Microcontroller” that appears to be the origin or, at least the inspiration, for the solution that is on a Google site by “nano-age.co.uk”. He posts a file named “newlib_stubs.c” that, when placed in my FreeRTOS demo project folder, linked 100% and produced a usable demo of FreeRTOS running on the LC STUDIO board. Professor Geoffrey Brown also hosts a useful gtihub at https://github.com/geoffreymbrown.

I made a little YouTube that explains the FreeRTOS demo. You can view it at THIS-LINK. While very simple, the demo has four independent processes running. If you would like the code for this project, click the ‘Yus and nano-age links above.

Advertisements
This entry was posted in ARM, computer, Electronics. Bookmark the permalink.

3 Responses to ARM Development, Part 2

  1. Geoffrey Brown says:

    In fairness, I think the Nano-age site came first, although the solutions to this issue have been published by others too.

    Like

  2. LongQi says:

    you mean you only use text editor to write code, gcc to compile ? Then how can you download code to board without J-link or some other simulator?

    Like

    • celem says:

      As the blog post says “Since the board is configured to serial load via the serial port that is what I will use until, and if, I obtain a JTAG programmer.”

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s