Is chibiOS the right choice for me?

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess

NsN
Posts: 2
Joined: Sun Dec 09, 2012 7:31 pm

Is chibiOS the right choice for me?

Postby NsN » Sun Dec 09, 2012 7:50 pm

I hope this is the correct forum, I couldn't find a better fitting place.

I'm currently working on a project that will use an STM32F4 MCU with a variety of interfaces:

  • An external RAM connected via the FSMC
  • An LCD connected via the FSMC
  • A camera connected via the DCMI
  • Ideally DMA transfers for the Camera, LCD and RAM
  • A SD card via the SDIO interface
  • USB slave
  • RTC
  • ADC and PWM
  • I2C / SPI and UART
  • External interrupts and time based events

Since this project will be rather large and and I want to maintain a smooth GUI, while data transfers and computations happen in the background, my gut feeling is to go with a RTOS, to better manage the individual aspects.

But as far as I can tell a few of the interface I will need are not supported by chibiOS yet. I have gotten almost all all of them to work individually already. Can I use my existing code or a slight modification of it inside of chibiOS? If not, how much effort would it be for me to add support for these interface into chibiOS (In terms of LOC, relevant files, ...)?

Bye,
NsN

mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Location: Karlsruhe, Germany
Been thanked: 1 time
Contact:

Re: Is chibiOS the right choice for me?

Postby mabl » Sun Dec 09, 2012 7:58 pm

An external RAM connected via the FSMC

I'm not sure this has been done yet - but it will be simple, I guess.

An LCD connected via the FSMC

There is the ChibiOS/GFX subproject which might fit your requirements. Tectu is the man to ask here. Also for commercial aspects.

A camera connected via the DCMI

I don't think this has been done yet. But since you already have working code...

  • Ideally DMA transfers for the Camera, LCD and RAM
  • A SD card via the SDIO interface
  • USB slave
  • RTC
  • ADC and PWM
  • I2C / SPI and UART
  • External interrupts and time based events

All ChibiOS drivers use DMA where possible. SDIO, USB slave, RTC, ADC, I2C, SPI and UART are all directly supported by ChibiOS HAL - even with FAT support via FatFS. I can personally only recommend it for your project.

MaBl

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Is chibiOS the right choice for me?

Postby Giovanni » Sun Dec 09, 2012 8:02 pm

Hi,

The effort is hard to quantify, it depends on factors unknown to me.

ChibiOS supports already most of those features except the camera. About the camera there is a DMA bug on the STM32F4 that could affect the camera if used with DMA, see "DMA2 data corruption when managing AHB and APB peripherals in a concurrent way" on the F4 errata document.

Giovanni

NsN
Posts: 2
Joined: Sun Dec 09, 2012 7:31 pm

Re: Is chibiOS the right choice for me?

Postby NsN » Sun Dec 09, 2012 8:59 pm

Thank you for the quick answers!

mabl wrote:
An LCD connected via the FSMC

There is the ChibiOS/GFX subproject which might fit your requirements. Tectu is the man to ask here. Also for commercial aspects.

I've started to look into that yesterday night, it looks very promising. I will probably contribute to that project rather than write my own code. The only things that seem to lacking sofar are FSMC and double buffering, and those should be easy to add.

mabl wrote:
A camera connected via the DCMI

I don't think this has been done yet. But since you already have working code...

The main issue with this will probably be to make it play nice with the real time aspect of the OS, at the moment I'm just happy to get data from the camera and block any and all other data transfers, while I read it out. I have also heard about the camera bug, It seems to be most annyoing when you try to do a direct DMA transfer from the camera to an external RAM, so I might to work around that.


All ChibiOS drivers use DMA where possible. SDIO, USB slave, RTC, ADC, I2C, SPI and UART are all directly supported by ChibiOS HAL - even with FAT support via FatFS. I can personally only recommend it for your project.
MaBl


That sound great, just a heads up, I was looking at this list last night and was a bit concerend about these devices.

I guess I will get started with the tutorials now, thank you very much!

mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Location: Karlsruhe, Germany
Been thanked: 1 time
Contact:

Re: Is chibiOS the right choice for me?

Postby mabl » Sun Dec 09, 2012 10:36 pm

Hmm I think the feature matrix is "only" for the stable version. You might have to you the development branch - but it is generally quite stable. The problem is that there is no GPL exception for development code. But I'm sure you can figure something out with Giovanni.

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: Is chibiOS the right choice for me?

Postby Tectu » Mon Dec 10, 2012 5:12 pm

Hi there,

As mabl already told you, ChibiOS/GFX is there to drive displays and touchscreens. If you need more informations, check out here. There's also a dedicated forum on the sub-projects forum.
The project does support using FSMC to connect your displays. Setting up DMA is no problem as well. The SSD1963 driver does actually use that. It's the old, not yet ported driver, but the basic idea still works.
It would be nice seeing new people contributing to the project :)

Using external RAM over FSMC is no problem. It's the same as you do it with your LCD since the LCD controller is basically just an external memory itself.
I do have an external SDRAM here which can be connected over FSMC, but I didn't use it yet. But again, it's very simple. Just take a look at how ChibiOS/GFX does it. Thanks to ChibiOS, it's just a few lines :)


~ Tectu

EwanC
Posts: 4
Joined: Thu Nov 01, 2012 11:56 pm

Re: Is chibiOS the right choice for me?

Postby EwanC » Wed Dec 12, 2012 12:32 am

Hi,

I have had the DCMI working under ChibiOS 2.5 on an STM32F407, interfacing with a Toshiba TCM8230MD. ChibiOS doesn't have a driver for the DCMI, but isn't particularly difficult to get going anyway. PM me if you want some example code - I basically just configured the DCMI directly and configured the appropriate DMA channel/stream with the ChibiOS DMA driver. I wasn't using external SRAM via the FSMC though, was just using the internal SRAM. External SRAM will make your life much easier - I had to compress image data in real time with JPEG in order to be able to hold an entire frame in memory!

Cheers,
Ewan

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: Is chibiOS the right choice for me?

Postby Tectu » Wed Dec 12, 2012 7:56 am

@EwanC: Would it be possible that you'd just share your project / driver in the «User Projects» section?
Also, just for my personal interests, did you use an LCD to display the images? :D


~ Tectu

EwanC
Posts: 4
Joined: Thu Nov 01, 2012 11:56 pm

Re: Is chibiOS the right choice for me?

Postby EwanC » Wed Dec 12, 2012 11:12 pm

Tectu wrote:@EwanC: Would it be possible that you'd just share your project / driver in the «User Projects» section?
Also, just for my personal interests, did you use an LCD to display the images? :D


~ Tectu


Can do, but the code will need to be tidied up a bit before I'd let other people see it! It's not a general driver at this stage, just a few lines to configure the DCMI for my application, as per the reference manual, and to set up the required DMA streams + double buffering. Could be useful as example code though. Will try to post it in the next couple of weeks.

I didn't use an LCD to display the images, I used a Bluetooth module in order to upload them to a laptop. The idea was to have reasonably high framerate real-time video streaming from an R/C car (which was also controlled over the Bluetooth).


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 18 guests