0

I am wondering if it is possible to port an OS into STM32 discovery board so that I can interface a touch screen and later make this project into MP3 player or Internet Radio.

So considering that I am a beginner in programming STM32 controller so is it doable to do this in 2 months of stipulated time..or is this project way above my league.

This project is for my diploma course

I would like to use only C programming.

Michael
  • 11
  • 5
  • 1
    Of course, the question is more what operating system, and for what benefit. It sounds like what you might really want are interface libraries (which do not necessarily imply an OS) and possibly a lightweight scheduler, which starts to. Your constraints on the platform, in the order you will likely feel them, will be limited RAM, limited FLASH, and lastly limited CPU speed. You'll probably end up with an SD card hanging off the SPI for storage. Note for the internet radio you don't have any very direct Ethernet or WiFi options, though there are serial or SPI interfaced adapters. – Chris Stratton Feb 07 '14 at 16:26
  • You might also look at the STM32F4 Discovery, which has some greater capabilities (more memory, half a network interface, and the possibility of being a USB **host**), with a cost that would be insignificantly higher for a project you'll invest weeks to months in. – Chris Stratton Feb 07 '14 at 16:29
  • Is there a FreeRTOS port? – Martin James Feb 07 '14 at 17:49
  • None seem to have a 'real' 4-bit SD-card controller:( – Martin James Feb 07 '14 at 17:52
  • Chris thank you for your reply..Unfortunately I have ordered STM32F100RB which seems to be the cheapest in line for discovery board. I am thinking of using any Free RTOS or CHIBIos but my main motive is to apply skills that I have learnt in my course ..Is it not possible to dump OS into SD CARD which is configured in I2c. – Michael Feb 07 '14 at 19:11
  • You would not put the OS on the SD card STM32 is optimised to run code from on-chip flash - it has a separate bus for flash and RAM. Running code from RAM will be slower because instruction and data fetches cannot occur concurrently. Iy is possible to write a bootloader that will read code from SD and program the flash. – Clifford Feb 07 '14 at 22:03

1 Answers1

1

[...] so that I can interface a touch screen and later make this project into MP3 player or Internet Radio.

Neither of those things necessarily require an OS, and while an OS may make development easier there is little in an OS that will "do that for you". Touchscreen support is likely to be entirely down to you, though there are a number of GUI libraries for small screens and microcontrollers (few are free however).

A typical RTOS is provided as a library statically linked to your application code. It provides services for task scheduling, timing, synchronisation, and messaging. Some RTOS may provide higher level "middleware" such as a network stack, USB support, and a filesystem, but you might also use third-party libraries for those.

However to answer your question directly, certainly you can run an RTOS. Any Cortex-M3 supporting RTOS will run, because the Cortex-M3 core provides all the critical support for an RTOS (NVIC, SYSCLK), there is very little "porting" to do as such to get a basic RTOS scheduler working.

What you should certainly investigate other than an RTOS is ST's STM32 Standard Peripheral Library which provides support for all the peripherals and GPIO available on your device.

Here's a list of open-source RTOS libraries with STM32 ports.

FreeRTOS's site has a page specifically for the STM32 discovery.

For C programming Cortex-M (the core used in STM32) is ideal; it supports C execution from reset and interrupt service routines can be coded directly in C with no assembler glue or special compiler extensions whatsoever.

And sure if you are smart, two months is plenty of time, but the OS is not the biggest issue - support for networking and a file system is likely to be key in the applications you have suggested, and integrating those with your RTOS is critical.

Clifford
  • 88,407
  • 13
  • 85
  • 165