Missing LTDC and DMA2D related core stuff

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: barthess, RoccoMarco

User avatar
TexZK
Posts: 57
Joined: Sat Sep 22, 2012 7:06 pm
Location: Lodi, Italy
Contact:

Missing LTDC and DMA2D related core stuff

Postby TexZK » Wed Jun 24, 2015 7:49 pm

Hi Giovanni,
while porting my LTDC and DMA2D demo from ChibiOS 2.6 to 3.0 I found that the current 3.0 trunk is still missing some STM32 core definitions to describe those peripherals.
You can find the modified files in the attachment. Since they are core features of the STM32 device, and not peripheral drivers, I guess they should be merged in the trunk instead of being patched by some community branch. Also, some board definitions are wrong and need to be updated.

I will upload the updated demoboard project to the community git repository soon, including peripheral drivers.
Attachments
LTDC_DMA2D_changed_files.zip
Changed files for LTDC and DMA2D support
(30.79 KiB) Downloaded 67 times

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

Re: Missing LTDC and DMA2D related core stuff

Postby Giovanni » Wed Jun 24, 2015 10:58 pm

Hi,

Thanks, putting this in queue.

Giovanni

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

Re: Missing LTDC and DMA2D related core stuff

Postby Giovanni » Fri Jun 26, 2015 9:16 am

Merged as-is, good work.

Giovanni

User avatar
TexZK
Posts: 57
Joined: Sat Sep 22, 2012 7:06 pm
Location: Lodi, Italy
Contact:

Re: Missing LTDC and DMA2D related core stuff

Postby TexZK » Fri Jun 26, 2015 9:23 am

Thanks ;) The ported demo project and peripheral drivers are currently available in my forked community repository at:

https://github.com/TexZK/ChibiOS-Contrib/tree/ltdc_dma2d

I'm moving some stuff to better places in order to finalize the pull request of the official community repository.

cosar
Posts: 1
Joined: Fri Jun 26, 2015 7:32 pm

Re: Missing LTDC and DMA2D related core stuff

Postby cosar » Fri Jun 26, 2015 7:41 pm

Hi TexZK. Good job! Have you tested the code on 429 discovery board. I couldn't get it to work. It seems it does not initialize ltdc correctly.

User avatar
TexZK
Posts: 57
Joined: Sat Sep 22, 2012 7:06 pm
Location: Lodi, Italy
Contact:

Re: Missing LTDC and DMA2D related core stuff

Postby TexZK » Sat Jun 27, 2015 1:07 pm

Ok, I've found the problem. In the patch I sent to Giovanni in the first post, I didn't include some old code from the 2.6 version, located in the board.c file.
What I'm writing here below is a quick patch taken from the old demo, which will be put into the community HAL files instead.

Include the needed files:

Code: Select all

#include "ili9341.h"
#include "stm32_ltdc.h"
#include "stm32_dma2d.h"

extern ILI9341Driver ILI9341D1;


Initialize the peripherals:

Code: Select all

/**
 * @brief   Board-specific initialization code.
 * @todo    Add your board-specific code, if any.
 */
void boardInit(void) {

#if STM32_LTDC_USE_LTDC
  ltdcInit();
#endif

#if STM32_DMA2D_USE_DMA2D
  dma2dInit();
#endif

  ili9341ObjectInit(&ILI9341D1);
}


Let me know if it works now. As written before, I'm including the LTDC driver into the community HAL source code, plus some household stuff, which are the way to go.

User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Re: Missing LTDC and DMA2D related core stuff

Postby barthess » Sun Jun 28, 2015 9:31 pm

@TexZK
Could you test your demo after merging? I have moved your linker script into
project directory because main chibios repository already contains SMT32F429xI.ld

@Giovanni
Is there way to elegantly redefine memory region defined in linker script? From Makefile
for example, or from tiny wrapper under the main linker script?

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

Re: Missing LTDC and DMA2D related core stuff

Postby Giovanni » Sun Jun 28, 2015 9:43 pm

LD scripts are not that flexible, if you need to do custom layouts probably it is better to copy the .ld in the project directory.

Giovanni

User avatar
TexZK
Posts: 57
Joined: Sat Sep 22, 2012 7:06 pm
Location: Lodi, Italy
Contact:

Re: Missing LTDC and DMA2D related core stuff

Postby TexZK » Sun Jun 28, 2015 10:17 pm

I've updated my community repository to remove dependencies on the ST peripheral library, and use the SDRAM by FSMC driver of the ChibiOS community instead.

Ok for the linker script, that's an easy fix, I'll move it too :)
Last edited by TexZK on Sun Jun 28, 2015 10:42 pm, edited 2 times in total.

User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Re: Missing LTDC and DMA2D related core stuff

Postby barthess » Sun Jun 28, 2015 10:25 pm

I've see your pull request. Did SDRAM code works as expected?


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 8 guests