0

"File not found" when loading bitmaps from SD card on 2.4" T
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

"File not found" when loading bitmaps from SD card on 2.4" T

by mapavetic on Sun Apr 15, 2018 5:24 am

Hi! I'm having trouble loading bitmaps from a micro SD card to 2.4" TFT FeatherWing. I'm using fulltest_featherwing example from ILI9341 library as described here Drawing Bitmaps. The problem is that images cannot be found on the SD card and the error message says "File not found". Microcontroller I'm using is Sparkfun ESP32 Thing and it's basically the same as HUZZAH32 – ESP32 Feather Board.

I noticed some warnings while uploading sketch to my board:

Code: Select all | TOGGLE FULL SIZE
C:\Users\Marko\AppData\Local\Temp\arduino_modified_sketch_337946\fulltest_featherwing.ino: In function 'void setup()':

C:\Users\Marko\AppData\Local\Temp\arduino_modified_sketch_337946\fulltest_featherwing.ino:94:29: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

   bmpDraw("purple.bmp", 0, 0);

                             ^

C:\Users\Marko\AppData\Local\Temp\arduino_modified_sketch_337946\fulltest_featherwing.ino: In function 'void bmpDraw(char*, uint8_t, uint16_t)':

C:\Users\Marko\AppData\Local\Temp\arduino_modified_sketch_337946\fulltest_featherwing.ino:148:40: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]

   if ((bmpFile = SD.open(filename)) == NULL) {

                                        ^

Sketch uses 198527 bytes (15%) of program storage space. Maximum is 1310720 bytes.
Global variables use 11732 bytes (3%) of dynamic memory, leaving 283180 bytes for local variables. Maximum is 294912 bytes.
esptool.py v2.1
Connecting........_
Chip is ESP32D0WDQ6 (revision 0)
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...

Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 4681.1 kbit/s)...
Hash of data verified.
Compressed 12304 bytes to 8126...

Writing at 0x00001000... (100 %)
Wrote 12304 bytes (8126 compressed) at 0x00001000 in 0.1 seconds (effective 871.1 kbit/s)...
Hash of data verified.
Compressed 199680 bytes to 112822...

Writing at 0x00010000... (14 %)
Writing at 0x00014000... (28 %)
Writing at 0x00018000... (42 %)
Writing at 0x0001c000... (57 %)
Writing at 0x00020000... (71 %)
Writing at 0x00024000... (85 %)
Writing at 0x00028000... (100 %)
Wrote 199680 bytes (112822 compressed) at 0x00010000 in 2.2 seconds (effective 718.3 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 122...

Writing at 0x00008000... (100 %)
Wrote 3072 bytes (122 compressed) at 0x00008000 in 0.0 seconds (effective 1365.3 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting...


Serial monitor message:

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:812
load:0x40078000,len:0
load:0x40078000,len:11392
entry 0x40078a9c
FeatherWing TFT
Touchscreen started
Initializing SD card...OK!

Loading image 'purple.bmp'
File not found


I successfully did other examples: TFT Graphics Test, Touchscreen Paint Demo and SD card test from my microcontroller library. SD test completed with no errors, it successfully created, deleted, renamed and wrote data to textual file. So I think there is nothing wrong with my SD card. I followed instructions and formatted the card to FAT32 and loaded purple.bmp bitmap from the link in the description.

What could I be doing wrong?

mapavetic
 
Posts: 1
Joined: Fri Apr 13, 2018 2:43 am

Re: "File not found" when loading bitmaps from SD card on 2.

by rengelking on Fri Jun 01, 2018 10:54 pm

Change the file path, prepend a forward slash to the name: bmpDraw( "/purple.bmp",0,0 );

rengelking
 
Posts: 7
Joined: Wed Dec 30, 2015 10:50 am

Please be positive and constructive with your questions and comments.