Arduino error during upload

Dear friends,
I recently copied a schetch of a mobile dial VFO, as shown in the photo.
Moving Dial VFO 2

The original schetch included an ESP32-WROOM and a 1.8" 128x160 TFT RGB display (ST7735), and the entire schetch (sorry to send it compressed) is as follows:
ESP32_DigVFO_002.zip (32,5 KB)

I wanted to "overdo it" by trying to replace the display with a 4" Waveshare_ILI9486, with the catastrophic result of getting an error, during upload, that I cannot get over.

Lo sketch usa 285849 byte (21%) dello spazio disponibile per i programmi. Il massimo è 1310720 byte.
Le variabili globali usano 123748 byte (37%) di memoria dinamica, lasciando altri 203932 byte liberi per le variabili locali. Il massimo è 327680 byte.
esptool.py v3.3
Serial port COM5
Connecting.........
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: c8:c9:a3:c7:03:fc
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
WARNING: Failed to communicate with the flash chip, read/write operations will fail. Try checking the chip connections or removing any other hardware connected to IOs.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00055fff...
Flash params set to 0x022f
Compressed 18880 bytes to 12992...

A fatal error occurred: Packet content transfer stopped (received 8 bytes)
Caricamento non riuscito: errore durante il caricamento: exit status 2

Can you help me?

Thank you all, Roberto

When you disconnect everything and load a blank sketch does the issue go away?

Help us help you.

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

Please include the entire error message. It is easy to do. There is a button (lower right of the IDE window) called "copy error message". Copy the error and paste into a post in code tags. Paraphrasing the error message leaves out important information.

Please post a schematic.

Please post an image of your project.

Please describe the problem better then you just did.

@robymak

:warning: Thread opened in the wrong forum (Italian language) ... moved to English one.

Hi Shannon,
please excuse my unfamiliarity with the forum.
This is the diagram I adopted:

I removed the TFT display and both the compilation and the upload went without errors.

If I insert the display the compilation runs correctly but the upload crashes, giving the following error message:

Lo sketch usa 285849 byte (21%) dello spazio disponibile per i programmi. Il massimo è 1310720 byte.
Le variabili globali usano 123748 byte (37%) di memoria dinamica, lasciando altri 203932 byte liberi per le variabili locali. Il massimo è 327680 byte.
esptool.py v3.3
Serial port COM5
Connecting...........
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: c8:c9:a3:c7:03:fc
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
WARNING: Failed to communicate with the flash chip, read/write operations will fail. Try checking the chip connections or removing any other hardware connected to IOs.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00055fff...
Flash params set to 0x022f
Compressed 18880 bytes to 12992...

A fatal error occurred: Packet content transfer stopped (received 8 bytes)
Caricamento non riuscito: errore durante il caricamento: exit status 2

These are the images of my construction :
Digital 1


Digital 3

Clearly there is evidence that there is something incompatible in the wiring between the MCU and the display. But I have no idea what that might be.

I hope for your support,
Roberto

However, I also strongly suspect that the schetch and hardware are inappropriate to support a 4" display.
Thank you, Roberto

My guess is that the display is not playing nice on the SPI bus and is causing problems with the SPI FLASH that shares the bus. Does it help if you put a pull-up resistor on the TP_CS pin of the display?

You should probably be using level shifters to use a 5V peripheral on a 3.3V board.

The display is using 5V, does the display do 3V3 I/O or 5V I/O?

I'd not use GPIO_NUM_2. GPIO_NUM_2 is connected to the on board LED. Some devices do not play well with the LED.

If the TP pins are disconnected does the thing boot?

I find the ESP32 Arduino Core likes it best to use GPIO_NUM_5 as the first cs pin and GPIO_NUM_15 as the 2nd cs pin.

I reply to both Idahowalker and Johnwasser, and thank them for their suggestions.

From the display datasheet, all I/O accept both 5V and 3V3 levels.

I have removed all connections to the TPxx pins and both compiling and uploading go without errors, but without showing anything on the display.

In the DISPLAY.H file I have modified:
Xw from 128 to 320
Yw from 160 to 48
In the file DISPLAY.CPP I modified the inputs, following the diagram previously shown.

Compilation returns the following errors:

c:/users/lenovo/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\lenovo\AppData\Local\Temp\arduino-sketch-D27950D7B34467E49F688DE94F912081/ESP32_DigVFO_002.ino.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
c:/users/lenovo/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/lenovo/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/lenovo/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: region `dram0_0_seg' overflowed by 669896 bytes
collect2.exe: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

Since the files mentioned had been created for a 1.8" 128x160 TFT display, it was clearly impossible for them to work for a different, larger display.
I tried to tests :wink:

Gretings to you both,
Roberto

Sorry for my mistake....

I think you will need close a megabyte of RAM for that screen,

  327680 (maximum space available)
+ 669896 (amount of overflow)
  ------
= 997576 (Memory needed)

Dear Johnwasser,
I am too of the same opinion.... :fearful:
Implementation is not possible, as I supposed.
Roberto

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.