I wonder if anyone can help with this issue.
I'm using the HSPI to write to a TFT display where I need high speed for a good refresh rate. I understand there is a maximum transfer size of 4096KB so I try breaking down the 115200KB into chunks and transfer however any chunk size larger than 32 bytes results in the following panic. I am running the SPI in a freeRTOS task, no other tasks have access to the HSPI - this is the only SPI peripheral. 32 bytes works fund but is very slow, 33 bytes and above is a crash.
Thank you!
Code: Select all
Guru Meditation Error: Core 0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x400d66f0: e51a0cfe f01dfefc 22006136
0x400d66f0: GC9A01_write_data at /Users/georgewaller/Projects/pocketmoon_sw/GC9A01_demo/GC9A01.c:25
Core 0 register dump:
PC : 0x400d66f6 PS : 0x00060530 A0 : 0x00000000 A1 : 0x3ffd81f0
0x400d66f6: GC9A01_write_data at /Users/georgewaller/Projects/pocketmoon_sw/GC9A01_demo/GC9A01.c:27
A2 : 0x3ffb2bfc A3 : 0x00000021 A4 : 0x80087fe5 A5 : 0x3ffb0b30
A6 : 0x00000003 A7 : 0x00060023 A8 : 0x800d66f6 A9 : 0x3ffd81d0
A10 : 0x00000001 A11 : 0x00000021 A12 : 0x8008a299 A13 : 0x3ffd3d30
A14 : 0x00000003 A15 : 0x00060023 SAR : 0x0000001b EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff
Backtrace:0x400d66f3:0x3ffd81f0
0x400d66f3: GC9A01_write_data at /Users/georgewaller/Projects/pocketmoon_sw/GC9A01_demo/GC9A01.c:26
Code: Select all
#include "driver/spi_master.h"
spi_device_handle_t spi;
void spi_init()
{
spi_bus_config_t buscfg = {
.miso_io_num = 2,
.mosi_io_num = 23,
.sclk_io_num = 18,
.quadwp_io_num = -1,
.quadhd_io_num = -1,
.max_transfer_sz = 256
};
spi_device_interface_config_t devcfg = {
.clock_speed_hz = 30000000,
.mode = 0,
.spics_io_num = -1,
.queue_size = 7,
.pre_cb = (void *)NULL,
};
spi_bus_initialize(HSPI_HOST, &buscfg, SPI_DMA_CH_AUTO);
spi_bus_add_device(HSPI_HOST, &devcfg, &spi);
}
void spi_tx(uint8_t * data, uint32_t len)
{
spi_transaction_t t = { 0 };
t.length = (size_t)(len * 8);
t.tx_buffer = data;
t.rxlength = 0;
t.flags = SPI_TRANS_USE_RXDATA;
spi_device_transmit(spi, &t);
}