RP2040 and TFT, Mini GIF player "Error opening file" (black screen)

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
Laila_Mestari
 
Posts: 50
Joined: Wed Oct 12, 2022 8:00 pm

Re: RP2040 and TFT, Mini GIF player "Error opening file" (black screen)

Post by Laila_Mestari »

Here is something new.
Now the code uploaded successfully on my RP2030 (no error message) and my screen is blue!
I get this message on my Serial monitor:

Adafruit SPIFlash Animated GIF Example
Flash chip JEDEC ID: 0xC84017
Mounted filesystem!
86526 2022-11-21 16:10 badger-172.gif
0 2020-01-01 00:00 .Trashes
22 2020-01-01 00:00 code.py
0 2020-01-01 00:00 lib/
115 2020-01-01 00:00 boot_out.txt
4096 2022-11-26 15:39 ._badger-172.gif
86526 2022-11-21 16:10 badger-172.gif
Successfully opened GIF badger-172.gif; Canvas size = 320 x 172
frame count: 3
duration: 150 ms
max delay: 50 ms
min delay: 50 ms
0 2020-01-01 00:00 .Trashes
22 2020-01-01 00:00 code.py
0 2020-01-01 00:00 lib/
115 2020-01-01 00:00 boot_out.txt
4096 2022-11-26 15:39 ._badger-172.gif
Error opening file ._badger-172.gif = 8

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: RP2040 and TFT, Mini GIF player "Error opening file" (black screen)

Post by mikeysklar »

Okay, I figured the locked files are part of the Ventura problem. Many devices that have been faking USB now require work arounds with Ventura. It is not anything specific to the Pi RP2040.

https://blog.adafruit.com/2022/10/31/up ... uitpython/

You should be able to push up NUKE and UF2 files via command line still with something like this (different file names).

Code: Select all

$ cp -X adafruit-circuitpython-raspberry_pi_pico-en_US-7.3.3.uf2 /Volumes/RPI-RP2
Go ahead and enable verbose upload messages in the Arduino IDE (File --> Preferences).

The blue screen is a good sign. You are getting close. I assume the ._badger* filename is causing the issue?

User avatar
Laila_Mestari
 
Posts: 50
Joined: Wed Oct 12, 2022 8:00 pm

Re: RP2040 and TFT, Mini GIF player "Error opening file" (black screen)

Post by Laila_Mestari »

Screenshot 2022-11-26 at 5.19.53 PM.png
Screenshot 2022-11-26 at 5.19.53 PM.png (187.83 KiB) Viewed 122 times
I did this but I think that the error message is still the same. Here it is:

Arduino: 1.8.19 (Mac OS X), Board: "Adafruit Feather RP2040, 8MB (no FS), 133 MHz, Small (-Os) (standard), Disabled, Disabled, Disabled, Disabled, None, Pico SDK, IPv4 Only"

Sketch uses 73804 bytes (0%) of program storage space. Maximum is 8384512 bytes.
Global variables use 33348 bytes (12%) of dynamic memory, leaving 228796 bytes for local variables. Maximum is 262144 bytes.
Resetting /dev/cu.usbmodem14201
Converting to uf2, output size: 179200, start address: 0x2000
Flashing /Volumes/RPI-RP2 (RPI-RP2)
Wrote 179200 bytes to /Volumes/RPI-RP2/NEW.UF2
processing.app.SerialException: Error opening serial port '/dev/cu.usbmodem14201'.
at processing.app.Serial.<init>(Serial.java:152)
at processing.app.Serial.<init>(Serial.java:82)
at processing.app.SerialMonitor$2.<init>(SerialMonitor.java:132)
at processing.app.SerialMonitor.open(SerialMonitor.java:132)
at processing.app.AbstractMonitor.resume(AbstractMonitor.java:132)
at processing.app.Editor.resumeOrCloseSerialMonitor(Editor.java:2126)
at processing.app.Editor.access$1300(Editor.java:116)
at processing.app.Editor$UploadHandler.run(Editor.java:2095)
at java.lang.Thread.run(Thread.java:748)
Caused by: jssc.SerialPortException: Port name - /dev/cu.usbmodem14201; Method name - openPort(); Exception type - Port not found.
at jssc.SerialPort.openPort(SerialPort.java:167)
at processing.app.Serial.<init>(Serial.java:141)
... 8 more
Error opening serial port '/dev/cu.usbmodem14201'.

User avatar
Laila_Mestari
 
Posts: 50
Joined: Wed Oct 12, 2022 8:00 pm

Re: RP2040 and TFT, Mini GIF player "Error opening file" (black screen)

Post by Laila_Mestari »

Exactly, I think the problem is related to Error opening file ._badger-172.gif = 8 line. Here is the complete message again:

Adafruit SPIFlash Animated GIF Example
Flash chip JEDEC ID: 0xC84017
Mounted filesystem!
86526 2022-11-21 16:10 badger-172.gif
0 2020-01-01 00:00 .Trashes
22 2020-01-01 00:00 code.py
0 2020-01-01 00:00 lib/
115 2020-01-01 00:00 boot_out.txt
4096 2022-11-26 17:32 ._badger-172.gif
86526 2022-11-21 16:10 badger-172.gif
Successfully opened GIF badger-172.gif; Canvas size = 320 x 172
frame count: 3
duration: 150 ms
max delay: 50 ms
min delay: 50 ms
0 2020-01-01 00:00 .Trashes
22 2020-01-01 00:00 code.py
0 2020-01-01 00:00 lib/
115 2020-01-01 00:00 boot_out.txt
4096 2022-11-26 17:32 ._badger-172.gif
Error opening file ._badger-172.gif = 8


At least now, the frame count is 3. The screen is blue since that one time when the code uploaded on the Feather without Error message. I don't know why it worked for that particular time because I believe I followed the exact same steps. Also, the screen is blue but when I connect the swtich it becomes black again.

User avatar
Laila_Mestari
 
Posts: 50
Joined: Wed Oct 12, 2022 8:00 pm

Re: RP2040 and TFT, Mini GIF player "Error opening file" (black screen)

Post by Laila_Mestari »

Would it be possible to have a live troubleshooting conversation? I think it would be really helpful.

Thank you

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: RP2040 and TFT, Mini GIF player "Error opening file" (black screen)

Post by mikeysklar »

We don't offer live support.

MacOS creates hidden dot files when copying to external drives.

You will need to delete the dot file before uploading the Arduino code so the gif player does not get stuck on it.

User avatar
Laila_Mestari
 
Posts: 50
Joined: Wed Oct 12, 2022 8:00 pm

Re: RP2040 and TFT, Mini GIF player "Error opening file" (black screen)

Post by Laila_Mestari »

(Sorry, I am not sure if my last message have been sent). The problem is that I did delete all dot files. What happens is that’s, as soon as the code is uploaded on the drive, it creates a dot file.

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: RP2040 and TFT, Mini GIF player "Error opening file" (black screen)

Post by mikeysklar »

I see. Since you are exclusively using MacOS the dot file creation needs to be disabled.

You should be able to use this command to prevent MacOS from doing this:

Code: Select all

 sudo mdutil -i off -d /Volumes/RPI-RP2
 sudo mdutil -i off -d /Volumes/CIRCUITPY

User avatar
Laila_Mestari
 
Posts: 50
Joined: Wed Oct 12, 2022 8:00 pm

Re: RP2040 and TFT, Mini GIF player "Error opening file" (black screen)

Post by Laila_Mestari »

Great, thank you.

How does this command work? Do I write in as part of the code? Is it to be written on the terminal? or is it a keybard instruction?

Thank you

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: RP2040 and TFT, Mini GIF player "Error opening file" (black screen)

Post by mikeysklar »

The mdutil commands are to be issued at the command line ("Terminal"). The important one is the CIRCUITPY drive. That will be which is accessible after you have installed CircuitPython.

Code: Select all

 sudo mdutil -i off -d /Volumes/CIRCUITPY
Then copy over your GIF and delete any visible dot files before uploading the Arduino code.

User avatar
Laila_Mestari
 
Posts: 50
Joined: Wed Oct 12, 2022 8:00 pm

Re: RP2040 and TFT, Mini GIF player "Error opening file" (black screen)

Post by Laila_Mestari »

Hi,

I figure out that it was on the terminal. I am still stuck at the same place: Here is what I get each time on my serial monitor:

Adafruit SPIFlash Animated GIF Example
Flash chip JEDEC ID: 0xC84017
Mounted filesystem!
86526 2022-11-21 16:10 badger-172.gif
0 2020-01-01 00:00 .Trashes
22 2020-01-01 00:00 code.py
0 2020-01-01 00:00 lib/
115 2020-01-01 00:00 boot_out.txt
4096 2022-11-29 18:18 ._badger-172.gif
86526 2022-11-21 16:10 badger-172.gif
Successfully opened GIF badger-172.gif; Canvas size = 320 x 172
frame count: 3
duration: 150 ms
max delay: 50 ms
min delay: 50 ms
0 2020-01-01 00:00 .Trashes
22 2020-01-01 00:00 code.py
0 2020-01-01 00:00 lib/
115 2020-01-01 00:00 boot_out.txt
4096 2022-11-29 18:18 ._badger-172.gif
Error opening file ._badger-172.gif = 8


Theese are the detailed steps of my process:


1
Plug RP2040 wired on breadboard with screen in the computer

2
Put RP2040 in boot loader mode

3
Clear invisible Mac files

4
Unlock locked files using TextEdit

5
"Nuke"using terminal: cp -X /Users/admin/Desktop/flash_nuke.uf2 /Volumes/RPI-RP2

6
Clear invisible Mac files again

7
Unlock files again

8
To disable dot files, type and enter on terminal:
sudo mdutil -i off -d /Volumes/RPI-RP2

9
Apply Circuit Python using terminal: cp -X /Users/admin/Desktop/CIRCUIT.UF2 /Volumes/RPI-RP2

10
Unlock files again

11
Clear invisible files

12
Copy GIF file on RP2040

13
To disable dot files, type and enter on terminal:
sudo mdutil -i off -d /Volumes/CIRCUITPY

14
Open Arduino 1.8.19

15
Upload code on Feather



Please let me know what else can I do

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: RP2040 and TFT, Mini GIF player "Error opening file" (black screen)

Post by mikeysklar »

Steps 12 and 13 need to be reversed.

You want to stop dot file creation before copying the GIF.

User avatar
Laila_Mestari
 
Posts: 50
Joined: Wed Oct 12, 2022 8:00 pm

Re: RP2040 and TFT, Mini GIF player "Error opening file" (black screen)

Post by Laila_Mestari »

I just tried it out but I get the same result

User avatar
Laila_Mestari
 
Posts: 50
Joined: Wed Oct 12, 2022 8:00 pm

Re: RP2040 and TFT, Mini GIF player "Error opening file" (black screen)

Post by Laila_Mestari »

Do you know if there is anything I can do?

User avatar
Laila_Mestari
 
Posts: 50
Joined: Wed Oct 12, 2022 8:00 pm

Re: RP2040 and TFT, Mini GIF player "Error opening file" (black screen)

Post by Laila_Mestari »

Also, I just want to make sure of something. Did you changed the wiring or modified the DISPLAY_HEIGHT dimension in your set-up?

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”