Jump to content

STM32F429I-discovery working example?


baptistes

Recommended Posts

Hello,

I'm new to the world of 32bit mcus and trying to get familiar with RTOSes. I like ChibiOS very much but can't get STM32F429I-discovery work with ugfx and ChibiOS. Please do any of you have a complete working example of anything little bit more complex like e.g. ugfx notepad, with proper ChibiOS makefiles etc.?

I have managed to compile https://github.com/winfred-lu/stm32f429-freertos800 but I would prefer to experiment with ChibiOS rather than FreeRTOS and unfortunatelly did not find any complete, working ChibiOS example code.

I was also trying to adapt code of "bubbles" example from http://ugfx.org/demos but unfortunatelly without any luck. I tried to look at the code, changed some constants etc. but only got compile errors which are cryptic to me...

I have asked this question on ChibiOS forum already ( http://forum.chibios.org/phpbb/viewtopi ... 79&p=18205 ) and was told to ask here :)

I would be very grateful for any complete source code for STM32F429I-discovery I could start with.

Thank you very much for any suggestions, hints, etc.

P.S. I prefer to work with just vim & make. Examples for commercial IDEs which can't be compliled with simple make are troublesome for me...

Link to comment
Share on other sites

My primary problem is that I don't understand the links between the uGFX and ChibiOS - should ugfx use any chibios drivers for this board or does ugfx have it's own drivers and ChibiOS should only run the self-containing ugfx code - so in fact ugfx uses only chibios's make system, no header files, no object files?

The before-mentioned ugfx demo for FreeRTOS also uses some ST library (STM32F429I-Discovery_FW_V1.0.1/Libraries/STM32F4xx_StdPeriph_Driver and STM32F429I-Discovery_FW_V1.0.1/Utilities/STM32F429I-Discovery) which brings even more confusion for me :(

I don't grasp what I should set in the Makefile - there are at least four options:

1. include $(CHIBIOS)/boards/ST_STM32F429I_DISCOVERY/board.mk

2. include $(GFXLIB)/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/board.mk

3. include $(GFXLIB)/drivers/gdisp/ILI9341/driver.mk

4. GFXBOARD = Mikromedia-STM32-M4-ILI9341

...and also ST libraries and ChibiOS's USE_FWLIB option...

I've tried all of them and several combinations of them without luck... Hence I would really need complete working example to have something to start with...

The code in https://github.com/mprymek/bubbles-stm32f429 compiles with http://pastebin.com/HP16WZnR

The missing header file is found in boards/base/Mikromedia-STM32-M4-ILI9341/board_ILI9341.h but when I try to add it with

include $(GFXLIB)/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/board.mk

I get http://pastebin.com/2KmXTV1e -- from this I suppose this board file is for other hardware and is not usable for .

There was some discussion about STM32F429 board file (viewtopic.php?f=22&t=51) but I don't see any usable output of it...

So do I understand it well that to use ugfx with STM32F429 and ChibiOS, I would have to write a new board file? (It would be probably too hard for me as I am not experienced with either ChibiOS or ugfx...)

My other tries (maybe totally worng way) with compiler outputs can be seen at https://github.com/mprymek/bubbles-stm3 ... ommits/tmp

Link to comment
Share on other sites

To explain a little...

Chibios and other embedded operating systems don't provide lcd drivers or code to draw using those drivers.

ugfx provides those drivers and the drawing code. To make that work there are two levels of interfacing... One between ugfx and the operating system. This is provided by the GOS layer in ugfx. It enables ugfx to use freertos or chibios or even win32 for operating system services.

The other interface layer is between the ugfx driver and the physical hardware. This is required because the same graphics controller chip could be connected to two different boards in different ways. The board file provides this interface. That is why the board file from the Mikromedia board does not work with the 429 discovery. They are physically connected very differently.

For the 429 discovery it gets worse. Although it has a ILI9341 controller chip it is driven in a very strange way on the 429 discovery board. It appears to only be used for initialising the display with the cpu ltdc controller then taking over based on a frame buffer in sdram. The sdram is external to the cpu so it also requires special initialisation.

what this all means is that the normal ugfx ILI9341 driver cannot drive this board and neither can the ugfx frame buffer driver. What is needed is a custom driver that is a hybrid between the two with some special ltdc controller, dma and sdram code thrown in as well.

I am currently in the process of writing this special driver and if everything goes well I should have an example project in the ugfx repository that will work with chibios sometime in the next week.

The examples you have seen to date with the 429 discovery board are all based around freertos and use the STM32 firmware library to do all the heavy lifting of initialising the lcd. This firmware library is particularly "heavy" so the new driver I am currently writing will work without using it.

Please be patient, I am nearly there.

Link to comment
Share on other sites

The STM32F429i-Discovery is now in the current master repo along with an example makefile for chibios.

The gdisp display is now working. I haven't yet written the board file for touch support. That however should be very easy as I believe it uses one of our supported controllers for touch. When I next get some time I will get that working too.

Link to comment
Share on other sites

I have now added touch support for the STM32F429i-Discovery.

You will need to use the newmouse branch of the repository rather than the master branch in order to get this code.

The newmouse branch will soon become the master branch (we just need to finish porting some old board files) so there was little point adding touch for this board using the current master.

The full widgets demo should now run.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...