Odd display behaviour after OTA upload #2789
-
I'm using an ESP-WROOM-32 chip with an ST7789 240x240 tft SPI display. There are two display layouts used, alternating between two or four lines of text, each display using a sprite for updating. The sprite is created and deleted at each update. Uploading the code from Platformio via USB compiles and loads successfully and the display is rendered as expected. Uploading the code using the ArduinoOTA library compiles and uploads successfully but the display rendering is changed. At each pushSprite the display changes colour, alternating between two colours, and the sprite appears to shift right one pixel, so both layouts slowly scroll to the right and wrap around. The rest of the data gathering code is working correctly for both upload methods. My guess is a memory issue of some sort, but I'm stuck on trying to figure out what things to try in order to resolve the issue. So far I have changed the ESP32 memory partition layout to use the min_spiffs layout which changed the ram usage from 68% down to 45% without any effect. The setup code is:
and the display code is:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Set the sprite colour depth before creating the sprite, otherwise a 16 bit sprite will be created first(requiring 115kbytes RAM!), then changed to 8 bit. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply Bodmer. I've tried as suggested but no change. I've pared down my code to just the display parts and have listed it below. With the pared down code, the issue remains that the sprite appears to be shifted right at every push command. I'm only creating the sprite once and not deleting it. For the layout, the best I've achieved is using Colour depth 2 and only enabling Font 1 and using White text. The issue doesn't exist if I upload via USB. There are no code changes between uploads of USB or Wifi.
|
Beta Was this translation helpful? Give feedback.
-
To close this off, the root cause was user error, my bad. I didn't realise that PlatformIO maintains a separate set of library folders for each environment, so the User_Setup.h for the environment using OTA firmware upload was different to the setup in the environment using USB upload. I think this is the first library I've used where settings are maintained in the actual library files themselves, although I see there is a mechanism to define settings in the platformio.ini file, which is what I'll use now. |
Beta Was this translation helpful? Give feedback.
To close this off, the root cause was user error, my bad. I didn't realise that PlatformIO maintains a separate set of library folders for each environment, so the User_Setup.h for the environment using OTA firmware upload was different to the setup in the environment using USB upload. I think this is the first library I've used where settings are maintained in the actual library files themselves, although I see there is a mechanism to define settings in the platformio.ini file, which is what I'll use now.