Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glcd not working..... #4

Closed
amjadali56 opened this issue Oct 26, 2022 · 5 comments
Closed

Glcd not working..... #4

amjadali56 opened this issue Oct 26, 2022 · 5 comments

Comments

@amjadali56
Copy link

First of all Great Project and work.... Thanks a lot for such good job and sharing.
I'm using Devkit V1 ! No matter what I do, stuck on no-display LCD.... I'm using ST7902, tried both HW-SPI and SW-SPI but no luck...
LCD is driven by 5V also the LCD-IO pins are connect directly without any extra components.
Only LCD is connected to board, SD, POT and BTN are not connected.
No Change in Code. Except "platform = espressif32@3.5.0" and for SW-SPI "U8G2_ST7920_128X64_F_SW_SPI u8g2{U8G2_R3, 16, 2, 15, 22}; "_
Checked the LCD and board with both SW-SPI and HW SPI example code which worked fine....

@positron96
Copy link
Owner

Hi. I can provide limited advice only, since I do not have access to your hardware.

  1. Add debug UART output to the code and see what it does and what is does not. Maybe it hangs somewhere at the start.
  2. Gradually transform example code that works into project code and see where it stops working. Or the other way around.

Off the top of my head I can suggest looking at display bus speed (it's set to 600000 in main.cpp)

@amjadali56
Copy link
Author

amjadali56 commented Oct 27, 2022

looks like the problem is here

C:/Users/Amjad Ali/.platformio/packages/framework-arduinoespressif32@3.10006.210326/cores/esp32/esp32-hal-spi.c: In function 'spiTransferBytesNL':
C:/Users/Amjad Ali/.platformio/packages/framework-arduinoespressif32@3.10006.210326/cores/esp32/esp32-hal-spi.c:922:39: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
                 uint8_t * last_out8 = &result[c_longs-1];
                                       ^
C:/Users/Amjad Ali/.platformio/packages/framework-arduinoespressif32@3.10006.210326/cores/esp32/esp32-hal-spi.c:923:40: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
                 uint8_t * last_data8 = &last_data;

@amjadali56
Copy link
Author

OK.... Problem solved :) The issue is in the Espressif@^3.5.0 library esp32-hal-spi.c file where there is an incompatible pointer.
...../platformio/packages/framework-arduinoespressif32@3.10006.210326/cores/esp32/esp32-hal-spi.c
The ‘result’ and ‘last_data’ are initialized as uint32_t.

The original code:
uint8_t * last_out8 = &result[c_longs-1];
uint8_t * last_data8 = &last_data;

To this:
uint32_t * last_out8 = &result[c_longs-1];
uint32_t * last_data8 = &last_data;

I made this change and it worked for me. Hope it help someone else..... Cheers and many many thanks for such a good project....

@positron96
Copy link
Owner

I'm very glad that you've fixed it! On a side note, I probably need to pin the version of ESP SDK to one that worked for me.

@amjadali56 amjadali56 reopened this Nov 1, 2022
@amjadali56
Copy link
Author

Please do mention ESP SDK which worked for you......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants