Weird SPI errors, speed

Moderators: mdrjr, odroid

Weird SPI errors, speed

Unread postby briansm » Wed Jul 11, 2018 5:47 am

Hi again.
More help please? Having got SD card access working now (yay), I'm trying to do a simple menu screen, which involves writing characters.

I've done a simple 'print' function to write a string of characters to the screen, but even doing that is causing problems.
The send_reset_drawing() API function seems to be extremely slow relatively speaking, is there any way to speed it up? Overall, compared to the Arduino environment, using esp-idf to write to the screen generally seems slower... perhaps because of the RTOS side of things or something.

Also, writing to screen seems very brittle just now, I keep hitting an error:

E (701) spi_master: spi_device_queue_trans(764): rx length > tx length in full duplex mode

which reboots the device. Is this a known thing? I can probably provide a short example that generates this if required.
briansm
 
Posts: 16
Joined: Wed Jun 27, 2018 3:35 am
languages_spoken: english
ODROIDs: Ordoid GO, Ordoid-W

Re: Weird SPI errors, speed

Unread postby crashoverride » Wed Jul 11, 2018 11:22 am

The LCD API for the emulators are "fragile". To achieve maximum speed, they operate multithreaded and DMA buffered.

I recently published a set of LCD routines that are synchronous and do not have the constraints of the emulator functions:
https://github.com/OtherCrashOverride/odroid-go-firmware/blob/feature-lcd/main/odroid_display.h
https://github.com/OtherCrashOverride/odroid-go-firmware/blob/feature-lcd/main/odroid_display.c

A 3rd party GUI library is also available for use:
https://github.com/OtherCrashOverride/odroid-go-firmware/tree/feature-lcd/components/ugui

Documentation for it can be found at the author's home page:
http://embeddedlightning.com/ugui/
crashoverride
 
Posts: 3689
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Weird SPI errors, speed

Unread postby mad_ady » Thu Jul 12, 2018 1:51 am

Would be nice if ugui were accessible from micropython. Would allow quick writing of gui apps.
User avatar
mad_ady
 
Posts: 4009
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Weird SPI errors, speed

Unread postby briansm » Thu Jul 12, 2018 3:02 am

In the end I had a look at the code generating the error (esp-idf/components/driver/spi_master.c) and found the line doing the check:

SPI_CHECK((handle->cfg.flags & SPI_DEVICE_HALFDUPLEX) || trans_desc->rxlength <= trans_desc->length, "rx length > tx length in full duplex mode", ESP_ERR_INVALID_ARG);

and just commented it out, everything is working perfectly now.
briansm
 
Posts: 16
Joined: Wed Jun 27, 2018 3:35 am
languages_spoken: english
ODROIDs: Ordoid GO, Ordoid-W


Return to Arduino Coding Camp

Who is online

Users browsing this forum: No registered users and 1 guest