Page 1 of 1

Drawing functions for STM32F429 ILI9341 in ChibiOS

Posted: Mon Jan 26, 2015 11:04 pm
by kopanz
Hi thank you for developing this well functioning rtos library, I'm working with STM32F429 discovery board which has 2.4" ILI9341 tft screen. I'm using ARMCM4-STM32F429-DISCOVERY-DMA2D Chibios example project from TexZK's github to explore ChibiOS however I couldn't find out how to make some custom drawing like lines, rectangles, circles etc. I'm looking around for a week but LTDC and DMA stuff really confuses me. Can you please help me about how can I gain access to frame buffer per pixel. If I can access pixels as I like I can implement drawing functions.

Re: Drawing functions for STM32F429 ILI9341 in ChibiOS

Posted: Tue Jan 27, 2015 9:10 am
by Giovanni
Hi,

I don't have low level code for the display but you could give a look to uGFX which is well integrated into ChibiOS.

Giovanni

Re: Drawing functions for STM32F429 ILI9341 in ChibiOS

Posted: Tue Jan 27, 2015 3:24 pm
by Tectu
As Giovanni mentioned uGFX might be the easiest to use option here.
uGFX has a ready-to use example for ChibiOS/RT 2.x and 3.x for the STM32F429i-Discovery board.


~ Tectu

Re: Drawing functions for STM32F429 ILI9341 in ChibiOS

Posted: Tue Jan 27, 2015 7:03 pm
by kopanz
I looked at uGfx before and couldn't find the F429 demo now I looked again I found the demo and tried it. Is there a way I can loosely couple my application to uGfx ? I need display just for debugging purposes in the development phase, I don't want my timers and threads depend on uGfx because I want to remove uGfx dependency at the end of the embedded system development.

Re: Drawing functions for STM32F429 ILI9341 in ChibiOS

Posted: Tue Jan 27, 2015 9:18 pm
by Tectu
Yes you can. uGFX is just a piece of software that runs on top of your ChibiOS/RT system. You just have to call gfxInit() and from then you can use any of the ugfx API calls to output your data.
Just remove those when you're finished and you're ready to go.

But maybe I just don't understand your question correctly. What gave you the idea that uGFX would interfere with your ChibiOS/RT timers etc?

Some general note: It's a very bad habit to use an LCD just for debugging purposes. You're working on a real time embedded system where results will vary a lot whether you use or don't use such a framework & hardware.


~ Tectu

Re: Drawing functions for STM32F429 ILI9341 in ChibiOS

Posted: Tue Jan 27, 2015 9:59 pm
by kopanz
I just take a glance to main.c of your example and saw gtimerInit, gtimerStart and gfxSleepMilliseconds functions as I have not have experience with uGfx I thought that uGfx abstract ChibiOS system, sorry to have wrong assumptions about your library :) I will have LCD in my final device but I'm going to use something like HD44780 or 128x64 monochrome lcd.

Re: Drawing functions for STM32F429 ILI9341 in ChibiOS

Posted: Tue Jan 27, 2015 10:06 pm
by Tectu
Ah, sorry about that. GTIMER is a software timer module because not all underlying systems provide some. You don't need to use that at all. and gfxSleepMilliseconds() is just a wrapper macro to chThdSleepMilliseconds. The reason this is there is that the very same application code can run on ChibiOS, FreeRTOS and any other system that implements these interfaces (note that ChibiOS/RT is our recommended one - it's simply the best RTOS that is out there).

If you want to use a different (graphical) display in your final product that is no problem at all. One of the awesome features of uGFX is that the code is totally portable. We have many customers that develop using some cheap chinese 320x240 TFT module for 10$ and in the finished product they use a high quality 720p display - without changing any of the application code.
Same applies to your setup: You can develop using a TFT and choose a monochrome display afterwards. You don't have to change any application code, you don't even have to change the colors!


~ Tectu