bitbank2 / bb_spi_lcd

SPI LCD/OLED library which can be built for Arduino and Linux
GNU General Public License v3.0
89 stars 13 forks source link

Crash when trying to draw image on ESP32 #15

Closed rsiemens77 closed 5 months ago

rsiemens77 commented 7 months ago

I am using BB_SPI_LCD class on ESP32 with ST7789. I can fill and draw to the LCD, but haven't been able to successfully display an image.

I tried lcd.pushImage(0,0,154,190,alien_straight_bm); with my lcd-image-converter output as described in the below header. That results in this exception:

    ret=spi_device_polling_transmit(spi, &t);  //Transmit!
    assert(ret==ESP_OK);            //Should have had no issues.

assert failed: void myspiWrite(SPILCD, unsigned char, int, int, int) bb_spi_lcd.cpp:1579 (ret==ESP_OK)

0x400dd9ce: myspiWrite(tagSPILCD, unsigned char, int, int, int) at bb_spi_lcd/src/bb_spi_lcd.cpp:1579 (discriminator 1) 0x400dda5d: spilcdWriteDataBlock(tagSPILCD, unsigned char, int, int) at bb_spi_lcd/src/bb_spi_lcd.cpp:1646 0x400dfb4b: BB_SPI_LCD::pushImage(int, int, int, int, unsigned short*, int) at libraries/bb_spi_lcd/src/bb_spi_lcd.cpp:6011

/***

bitbank2 commented 7 months ago

It looks like it may have something to do with the SPI driver not liking to write data from FLASH memory. Can you try removing the 'const' and 'PROGMEM' labels and see if it works? Everything else looks ok.

rsiemens77 commented 7 months ago

Removing those does not make a difference. I did notice some log error I didn't report before (happens either way):

E (1559) spi_master: check_trans_valid(696): txdata transfer > host maximum

bitbank2 commented 7 months ago

Ah - that's the issue. Can you send me a complete example which reproduces the problem? I'll make sure it works and push a fix. Thanks.

rsiemens77 commented 7 months ago

The code is in the first message, it's just one call. If you need an image to test with, I attached it.

  BB_SPI_LCD lcd;
  lcd.begin( LCD_ST7789, FLAGS_SWAP_COLOR | FLAGS_INVERT, 27000000, 0, 21, 19, 0, 0, 22, 23);
  lcd.fillScreen(TFT_BLACK);
  lcd.pushImage(0,0,154,190,alien_straight_bm);

alien_straight.zip

rsiemens77 commented 6 months ago

Any word on fixing this?

rsiemens77 commented 6 months ago

It's unfortunate this is buggy and no longer being maintained.

bitbank2 commented 6 months ago

It's unfortunate that people can only complain about free software and not contribute.

bitbank2 commented 6 months ago

I pushed a fix for this, give it a try.

rsiemens77 commented 5 months ago

The problem was you initially responded in a timely fashion like you'd look into it, then no word for a month. I did my part, testing and providinig feedback. When I then heard nothing for a month, I had to move on, thus my furstrated post.

I may take another look when I have some updated requirements, I had to switch to something I could get working quicker for now.

bitbank2 commented 5 months ago

The problem was you initially responded in a timely fashion like you'd look into it, then no word for a month. I did my part, testing and providinig feedback. When I then heard nothing for a month, I had to move on, thus my furstrated post.

I may take another look when I have some updated requirements, I had to switch to something I could get working quicker for now.

I'm doing some refactoring of the code and adding new features. Your bug was being fixed as part of that rewrite, so I didn't respond to fix it "in a timely manor", whatever that means. You act as if you're doing me a favor by using my library. Use it if you want, use someone else's if you want.