[TOPST D3-G] SPI write issue

Hello I’m from Taiwan.

We were very fortunate to recently obtain the D3-G, and we’ve successfully ported our tiny e-paper to it, and it works!!

Below are our instructions!

However, we quickly noticed an issue: the SPI data write speed is extremely slow, causing the image refresh to take about one minute (while it only takes around five seconds on other platforms). During SPI writes, dmesg continuously reports the following error messages:

[ 662.625431] tcc-spi 16900000.spi: [ERROR][SPI] Exceeded maximum data length [max: 8188, req: 1]
[ 662.634244] tcc-spi 16900000.spi: [ERROR][SPI] Exceeded maximum data length [max: 8188, req: 1]
[ 662.643054] tcc-spi 16900000.spi: [ERROR][SPI] Exceeded maximum data length [max: 8188, req: 1]
[ 662.651866] tcc-spi 16900000.spi: [ERROR][SPI] Exceeded maximum data length [max: 8188, req: 1]
[ 662.660677] tcc-spi 16900000.spi: [ERROR][SPI] Exceeded maximum data length [max: 8188, req: 1]
[ 662.669488] tcc-spi 16900000.spi: [ERROR][SPI] Exceeded maximum data length [max: 8188, req: 1]
[ 662.678299] tcc-spi 16900000.spi: [ERROR][SPI] Exceeded maximum data length [max: 8188, req: 1]

Since I don’t have access to the kernel source code, I can’t identify the root cause. As we need to showcase this at an exhibition at the end of November, may I ask if you could help us resolve this issue? Thank you!

Hey! Nice to here your porting progress! THX for the update!

Regarding the issue, could you let us know which OS you are using to for D3-G?

I assume you are already familiar with our github(TOPST-Dev. · GitHub), where you can find the kernel for our OS(Ubuntu 22.04 for D3-G and Yocto). GitHub - topst-development/kernel-5.10 at release/d3/1.0.0

@topstdeveloper Thanks for your response!

I’m use Ubuntu 22.04 image which from your download page. it’s kernel 5.10.
Which kernel and dts is the suitable for my case, and any suggestion for the quickly issue fix?

Thanks.

hi wigcheng.

when examined the video clip from your github, it seemed like taking totally 15~17 seconds from the beginning.

for your information, the current spi max frequency of D3-G has been set to 20MHz.

according to googling, in case of other SBC, such as RPI4B, it supports up to 125MHZ and generally set to 50MHz.

i think, theoretically, it may take around 6 seconds on 50MHz.

however, unfortunately, D3-G supports up to 25Mhz for it. thus, i have to say it is our utmost.

if you want to set it to 25Mhz, i’ll guide you how to update and build it from kernel device tree.

in addition, you don’t have to concern the error message below.

[ 662.678299] tcc-spi 16900000.spi: [ERROR][SPI] Exceeded maximum data length [max: 8188, req: 1]

it was not caused by ‘exceeded somthing’, but the transmission was failed.

thanks.

kiyong

No, that video was recorded after waiting for almost a minute (you can think of it as an edited version), because the initial waiting time was too long and not suitable for a demo.

I’m not referring to the image refresh speed — the issue is that writing data to the e-paper through SPI takes about one minute, and only after that does the screen start refreshing.
During that one minute, it keeps reporting the “SPI Error” message mentioned above.

I’ll download the kernel and try to investigate the driver issue myself. If you have any suggestions or directions, please feel free to share them. Otherwise, it’ll be difficult for me to demo this to the customer. Thank you.

Update status:

I already fix this issue!
It seems that the D3-G indeed has poor performance when processing SPI data written one byte at a time (it appears to be a DMA issue). After I changed it to write 4096 bytes of data at once, the e-paper display worked normally. Anyway, thank you all!

1 Like