Jump to content

STM32F401 + ILI9341 + Eclipse (GNU MCU Eclipse) + CubeMX + uGFX <-- Working!


jano

Recommended Posts

After many hours reading data in the scope and comparing the behaviour of this with the Mbed library, I get it to work! :D

The main difference is the Mbed library after each sequence of data it puts the CS line to high level (releases the bus), that is not the case of the uGFX lib for ILI9341 (at least on the init sequence, which is what I used to compare), so I added the code at the end of the transmission function on the board file, and it works

For those who can be interested in using this combination of tools for this screen/microcontroller, I will attach the relevant files.

To generate the project I used CubeMX, enabling SPI1 and some pins for CS, RST, DC ( D10, D9, D8 on the right side of the nucleo board), mixed this with the project generated in Eclipse and followed the procedure on the uGFX wiki to import the library.

 

main.c

stm32f4xx_hal_msp.c

stm32f4xx_it.c

board_ILI9341.h

Link to comment
Share on other sites

Quote

you use Mbed OS with CubeMX and a ready Project from Eclipse?

no, a library I found in Mbed works out of the box (for a old version of Mbed OS), then I used this to compare his behaviour (measuring with the oscilloscope) with the behaviour of the project I generated with the GNU MCU Eclipse +  CubeMX and followed the instructions on the wiki of uGFX to integrate it on an Eclipse project.

I wanted to have this working on Eclipse because of the better debugging possibilities.

I was changing the parameters in the main.c (attached on the first post) on the init section of the SPI until the numbers I read on the oscilloscope where the same as in the init sequence for the screen (frequency, polarity, etc.), for that reason these parameter can differ from the ones in the ioc file I will attach now, the valid parameters are the ones in the main.c

Is important to have the right parameters in the SPI init, but even when this is correct and the numbers where the same all along the init sequence for the screen, it doesn't work until I added the order for releasing the bus at the end of each transmission. I think this should be corrected on the driver to avoid unnecessary instructions here, the driver I have of Mbed releases the bus between every data-cmd sequence.

 

spi_1-pb6.ioc

Edited by jano
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...