Closed xwct closed 6 years ago
Interesting, I didn't even know SPI write can fail. Can you try doing a write yourself, without using the library?
import machine
spi = machine.SPI(1, baudrate=32000000)
spi.write(b'abc')
update: upgraded my pyboard to 1.9.2-123-gbdc6e86e while changing to network support firmware, now they both don't work with the same error message, while getting no error messages when doing manual write.
That's interesting, because it should be pretty much the same code.
I had the same error. It's caused by writing a zero length buffer to the SPI HAL C code. It seems the DMA code doesn't like zero length buffers and errors. Its easy to fix by adding a single line of code to the following file ..../ports/stm32/spi.c
if(len == 0) return;
It goes here.
STATIC void spi_transfer(const pyb_spi_obj_t self, size_t len, const uint8_t src, uint8_t *dest, uint32_t timeout) {
HAL_StatusTypeDef status;
if(len == 0) return;
...
Its possible to do the same in the MicroPython code and may be a better solution but you would need to test it.
This has been tested with builds 1.9.1, 1.9.2 & 1.9.3 as they all have the same issue.
Hi i had the same Error With SSD1331 , On pyboard V1.1, Firmware version v1.9.3-500-gbc3a5f19 . i removed the content from line 37-46 from ssd1331.py And used "Spi = SPI(mosi = Pin('X8'), sck = Pin('X6'), miso = Pin('X7'), polarity = 1, phase = 1) ", and display = ssd1331.SSD1331(spi, dc = Pin('X4'), cs = Pin('X5'), rst = Pin('X3')) declaring pins as mosi = 'X8' should yield the same result.
Regards Gashax. And thank you so much for having spent time on writing this driver . !!!
using a pyboard v1.1 with a 2gb micro sdcard for the files, and the adafruit ili9341, 2.8" captouch breakout same thing happens when i use machine.Pin for the pins.
d/c --- 'x4' cs --- 'x5' /ss clk --- 'x6' sck mosi -- 'x8' mosi vin --- vin