SPI woes - Ethernet shield vs. everything else

Thanks John and Tim,

All help to resolve these issues is very much appreciated!!



+1 John

I've used my Due with the ethernet shield and a 10DOF board (I2C), a Adafruit Ultimate GPS (serial), and a 16 channel servo controller (I2C), and had no problems, even with UDP, which is my favorite protocol. Don't know what to tell you.

To summarise what we did to reach this happy state of affairs :-

SdFat with UTFT_GHL works fine as relased, the DMA code used in UTFT_GHL is the same as that used in SdFat, so there is no real surprise this combination works without issue.

UTFT_GHL and Ethernet, not happy, ethernet hangs after access to the Font IC. SdFat and Ethernet, not happy, ethernet hangs after access to the SD card.

The solution here is to configure SdFat, in SdFatConfig.h change Line 81 to #define SD_SPI_CONFIGURATION 1.

This should fix your problems with Ethernet and SdFat.

To effect the same fix to UTFT_GHL,, in HW_ARM.h (currently line 39) change to #define USE_SAM3X_DMAC 0.

That's the end of the good news unfortunately, the result of these changes is significantly slower SPI performance.

I have an Ethernet R2 card now (THANKS, you know who you are), so this is not the end by any means, if we come up with another solution, it will be posted either in this thread or a new one.

Hope this will save people LOTS of time!!



Just as a final follow-up to Graham's note, I'm happy to be able to confirm that all three libraries are playing nicely now. My app is running quite large volumes of UDP inbound, rather less outbound, together with regular reads & writes to the SD card and updates to the display. There doesn't seem to be any particular order that's best for initialisation but I am doing it thus:

UTFT_GHL UTouch Ethernet SdFat

The Due is handling inbound UDP traffic at the rate of around 800kbit/s from my LAN without any problem at all, so even though the SPI is running more slowly than it might it seems to be coping well.

My thanks to Graham for his considerable assistance with this rather tricky problem.