Jump to content

STM32F429i-Discovery & example_chibios_3.x & screen rotation


Recommended Posts

Posted

Hi all,

I tried the demo as described in the title with the /gwin/graph setup in the make file. Everything went fine to that point.

Then i added a screen rotation i.e. 90, or 270 or Landscape as needed in my application.

Doing this, I get a corrupted display, i.e. basically showing the expected display w/ missing dots, where the missing dots seem to appear in their 0°-rotation position.

BTW: 180° Does it too

gdisp_lld_draw_pixel doesn't look suspicious to me, unless PIXIL_POS or PIXEL_ADDR or driverCfg are faulty

Anybody experienced this? Any explanation?

Setup: Tectu-ugfx-69de17687c30 dated 2015-11-01 and ChibiStudio Preview14

Thanks for looking into this,

best regards

~Wolf

Posted

Hello wolf,

Thank you for the very detailed bug report. Can you please disable the DMA2D support in the driver configuration file and see whether the issue persists?

You can do that by setting LTDC_USE_DMA2D to FALSE in /drivers/gdisp/STM32F429iDiscovery/gdisp_lld_config.h.

~ Tectu

Posted

Hello Tectu,

OK - with LTDC_USE_DMA2D set to FALSE the problem is gone!

I.e. I tried all possible rotations - they are all OK!

I didn't dig too deep into the driver yet - bur what is the tradeoff in disabling this DMA2D?

Best regards

BTW: With the initial setting in the original gwin/graph demo, some of the the grid lines are not displayed entirely, i.e. only about half or a third from their respective start point!

~wolf

Posted

Hello wolf,

Thank you for testing this.

The DMA2D is a periphery inside the STM32F429 that offers hardware acceleration which can hugely improve performance. For example, when you fill a rectangle (let's say you clear the display) you would normally have to setPixel() every single pixel. With the DMA2D you can just give the coordinates of a rectangle and the color that you would like to have in that window. The DMA2D periphery will automatically fill the rectangle as fast as the LTDC driver periphery allows it (eg. display panel timings) and you CPU stays free.

The DMA2D also allows blitting bitmaps (the same thing but with each pixel having a different color) and other features.

I just checked - we haven't implemented rotation support for the DMA2D so far, how embarrassing!

For the generic STM32LTDC driver we have added the support only for the fillArea(): https://bitbucket.org/Tectu/ugfx/src/5d ... LTDC.c-375

but for the STM32F429iDiscovery driver there is no orientation support at all: https://bitbucket.org/Tectu/ugfx/src/5d ... very.c-438

Would you have the time and motivation to look into this and adding the missing cases so that gdisp_lld_fill_area() and gdisp_lld_blit_area() would work for all four orientation modes?

As you can see in gdisp_lld_fill_area() of the generic STM32LTDC driver it is "just a matter" of changing three register values of the DMA2D depending on the rotations.

The three registers specify the position and the size of the rectangle by providing the start address, the end address and the number of pixels per line.

~ Tectu

Posted

Hi Tectu,

OK - obviously this should be done in order to get the best out of the uC.

I'll have a look into it, but can't promise as spare time is scarce at the moment.

I'll come back to the forum, once I'll had a look in the manual.

Best regards

Wolf

Posted

Hi all,

just a thought:

Wouldn't it make sense to make PIXIL_POS a function and handle orientation there?

This would concentrate all calculations in one place!

~wolf

  • 2 weeks later...
Posted

Hi all,

i got the screen rotation right on a.m. board.

Pls. find my solution attached. This needs verification of course. gdisp_lld_blit_area is not tested, as it probably needs some modification in MADCTL (see below) to get it right.

During debugging i found a general problem w/ the DMA2D:

In function gdisp_lld_draw_pixel you need to wait for the DMA2D to be finished before writing to the display RAM too!

Otherwise an ongoing DMA2D transfer will overwrite the pixe you intend to draw. This is also the reason, why in some demos not all the contents is visible.

Try it with the graph demo.

Apart from this, i try to find a more elegant solution in setting up the ILI9341 display driver correctly and thus doing away w/ all the calculations.

This means: setting the MADCTL register in the right way. I succeeded for 0° and 180° so far, the others need to be done.

I'll come back to the forum once it's done

Best regards

~wolf

Posted

Hello wolf,

Thank you very much for your contribution. It is very appreciated!

However, it seems like you forgot to actually attach your file(s) :)

Please upload the files as a ZIP archive as *.h and *.c extensions are not directly allowed.

Please keep up the good work!

Kind regards,

~ Joel Bodenmann

Posted

Thank you for showing your results. We will have a look at this some when during the next week.

Right now we are very busy. We are currently improving the code-generator of the µGFX-Studio as we want to focus on getting a working version 1.0 out soon.

~ Tectu

Posted

The changes have been integrated into the STM32LTDC driver in the repository along with other orientation and DMA2D fixes.

The special STM32F429i-Discovery driver is now gone as the more general (and complete) STM32LTDC driver now works with this board too.

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...