Adafruit_ILI9341_STM - improvements

Working libraries, libraries being ported and related hardware
User avatar
RogerClark
Posts: 7485
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Adafruit_ILI9341_STM - improvements

Post by RogerClark » Thu Aug 17, 2017 10:25 pm

As Steves latest code seems to work OK, I was planning to update the repo with his copy of this library and also his updated SPI lib.

But I have been too busy with other things to do it yet

victor_pv
Posts: 1750
Joined: Mon Apr 27, 2015 12:12 pm

Re: Adafruit_ILI9341_STM - improvements

Post by victor_pv » Thu Aug 17, 2017 10:46 pm

stevestrong wrote:
Thu Aug 17, 2017 5:14 pm
Guys, im on holliday currently, will be back in a week or so.
Steve, when you are back, if you haven't already you can remove this line, is a leftover from when the DMA transfers were done directly in the library, before adding dmaSend:
https://github.com/stevstrong/Arduino_S ... STM.cpp#L7

One more thing, wouldn't using dmaSendAsync here cause problems since the CS line may be toggled before the transfer is over?
https://github.com/stevstrong/Arduino_S ... M.cpp#L243

Since we can use DMA callbacks with the SPI, perhaps we could instead have a function toggle the CS pin when when called?

User avatar
Manny
Posts: 41
Joined: Wed Dec 09, 2015 3:15 pm

Re: Adafruit_ILI9341_STM - improvements

Post by Manny » Thu Aug 17, 2017 11:13 pm

RogerClark wrote:
Thu Aug 17, 2017 10:25 pm
As Steves latest code seems to work OK, I was planning to update the repo with his copy of this library and also his updated SPI lib.

But I have been too busy with other things to do it yet
l had compile errors with Steve's SPI lib and SDfat, other libraries might be affected.

User avatar
RogerClark
Posts: 7485
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Adafruit_ILI9341_STM - improvements

Post by RogerClark » Thu Aug 17, 2017 11:30 pm

OK.

I only tested Steve's code with the ILI9341 lib. It needs to be tested with a wider range of libs e.g. SD

stevestrong
Posts: 1829
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Adafruit_ILI9341_STM - improvements

Post by stevestrong » Fri Aug 18, 2017 6:49 am

Victor, I corrected the things you mentioned.
However, because I am not at home, I cannot test it.

If you discover some bugs or have compile/build errors, please report it on github.

stevestrong
Posts: 1829
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Adafruit_ILI9341_STM - improvements

Post by stevestrong » Fri Sep 01, 2017 2:37 pm

Manny wrote:
Thu Aug 17, 2017 11:13 pm
l had compile errors with Steve's SPI lib and SDfat, other libraries might be affected.
Manny, can you please post here what kind of error messages do you get?

User avatar
Manny
Posts: 41
Joined: Wed Dec 09, 2015 3:15 pm

Re: Adafruit_ILI9341_STM - improvements

Post by Manny » Sun Sep 17, 2017 5:35 pm

stevestrong wrote:
Fri Sep 01, 2017 2:37 pm
Manny, can you please post here what kind of error messages do you get?
Better late than never

Code: Select all

I:\Users\Manny\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\SdFat\SdSpiSTM32F1.cpp: In member function 'void SdSpi::send(const uint8_t*, size_t)':

I:\Users\Manny\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\SdFat\SdSpiSTM32F1.cpp:91:20: error: call of overloaded 'write(const uint8_t*&, size_t&)' is ambiguous

   SPI.write (buf, n);

                    ^

I:\Users\Manny\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\SdFat\SdSpiSTM32F1.cpp:91:20: note: candidates are:

In file included from I:\Users\Manny\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\SdFat\SdSpi.h:124:0,

                 from I:\Users\Manny\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\SdFat\SdSpiSTM32F1.cpp:23:

I:\Users\Manny\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\SPI\src/SPI.h:274:10: note: void SPIClass::write(uint16, uint32) <near match>

     void write(uint16 data, uint32 n); 

          ^

I:\Users\Manny\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\SPI\src/SPI.h:274:10: note:   no known conversion for argument 1 from 'const uint8_t* {aka const unsigned char*}' to 'uint16 {aka short unsigned int}'

I:\Users\Manny\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\SPI\src/SPI.h:281:10: note: void SPIClass::write(void*, uint32) <near match>

     void write(void * buffer, uint32 length);

          ^

I:\Users\Manny\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\SPI\src/SPI.h:281:10: note:   no known conversion for argument 1 from 'const uint8_t* {aka const unsigned char*}' to 'void*'

stevestrong
Posts: 1829
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Adafruit_ILI9341_STM - improvements

Post by stevestrong » Mon Sep 18, 2017 12:08 pm

Manny, I see that you are using non-DMA transfers. Is there any reason why you don't use DMA transfers?

Anyway,I posted two PRs to Greiman's repo to solve this issue. https://github.com/greiman/SdFat/pulls

User avatar
Manny
Posts: 41
Joined: Wed Dec 09, 2015 3:15 pm

Re: Adafruit_ILI9341_STM - improvements

Post by Manny » Mon Sep 18, 2017 7:27 pm

stevestrong wrote:
Mon Sep 18, 2017 12:08 pm
Manny, I see that you are using non-DMA transfers. Is there any reason why you don't use DMA transfers?

Anyway,I posted two PRs to Greiman's repo to solve this issue. https://github.com/greiman/SdFat/pulls
Good spot on the DMA...anyway, downloaded Greiman's repo and its all working with the Adafruit_ILI9341_STM and SPI libs from your repo.

Post Reply