Page 1 of 1
[TODO] Missing SPI4/5/6 (+DMA) for STM32F429/439
Posted: Thu Nov 21, 2013 10:23 am
by TexZK
Hello! I'm trying to write a simple driver for
STM32F429I-DISCO's
ILI9341 LCD controller to test my ongoing
LTDC driver, but I've found that it requires the SPI5, which is missing from Chibi's F4xx bindings.
I've done a plain copypasta of the SPI1/2/3 code, but it won't compile until valid DMA mask values are assigned, and I don't know where to find this information (I'm new to this DMA stuff)...
Can somebody help me?
PS: Is there a way to use SPI in half-duplex mode? ST's demo is using only MOSI, but I would like to read registers from the ILI9341, which works in half-duplex mode.
Re: Missing SPI4/5/6 (+DMA) for STM32F429/439
Posted: Thu Nov 21, 2013 10:51 am
by tinito
Hi TexZK,
you can find the description of DMA streams and channels in the reference manual (table 43-44 of RM0090), you should add the default values for SPI4-5-6 streams and channels in spi_lld.h:
Code: Select all
#if !defined(STM32_SPI_SPI1_RX_DMA_STREAM) || defined(__DOXYGEN__)
#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0)
#endif
and then update the macros in spi_lld.c:
Code: Select all
#define SPI1_RX_DMA_CHANNEL \
STM32_DMA_GETCHANNEL(STM32_SPI_SPI1_RX_DMA_STREAM, \
STM32_SPI1_RX_DMA_CHN)
Re: Missing SPI4/5/6 (+DMA) for STM32F429/439
Posted: Thu Nov 21, 2013 11:01 am
by tinito
ps: for the half-duplex operation, I guess it is selected by configuring bits BIDIMODE and BIDIOE in SPI_CR1
Re: Missing SPI4/5/6 (+DMA) for STM32F429/439
Posted: Thu Nov 21, 2013 12:12 pm
by Giovanni
The whole SPI driver requires an update with changes also in mcuconf.h and stm32_rcc.h. Adding this thread to the TODO list.
Giovanni
Re: [TODO] Missing SPI4/5/6 (+DMA) for STM32F429/439
Posted: Thu Nov 21, 2013 1:09 pm
by TexZK
Here are my updated files + current untested LTDC driver.
Re: [TODO] Missing SPI4/5/6 (+DMA) for STM32F429/439
Posted: Tue Dec 03, 2013 3:29 pm
by Giovanni
Hi,
I only merged the SPI-related changes, there was a minor issue with SPI6 DMA defaults. The SPI changes have been compile-tested here, some real world testing would be appreciated. I merged it both in trunk and 2.6.x.
The LTDC will have to wait because:
1) You made changes to old hal_lld.c/.h so there were merging issues (the new settings were also missing from the hal_lld.h settings section).
2) I have to review it being new code.
Please review your code using the latest trunk code then resubmit the changed files.
thanks,
Giovanni
Re: [TODO] Missing SPI4/5/6 (+DMA) for STM32F429/439
Posted: Sat Mar 21, 2015 1:19 pm
by chibby
I have this hardware, so would be able to test.