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 »

1-This is very encouraging. I also uploaded this code and got a similar result:

Adafruit SPIFlash Animated GIF Example
Flash chip JEDEC ID: 0xC84017
Mounted filesystem!
142692 2022-09-27 16:22 Arduino-Logo-320.gif
4096 2022-10-31 17:53 ._Arduino-Logo-320.gif
22 2020-01-01 00:00 code.py
0 2020-01-01 00:00 lib/
115 2020-01-01 00:00 boot_out.txt
142692 2022-09-27 16:22 Arduino-Logo-320.gif
Successfully opened GIF Arduino-Logo-320.gif; Canvas size = 320 x 170
frame count: 1
duration: 40 ms
max delay: 40 ms
min delay: 10000 ms


2- BUT, my screen is still black AND when I change the DISPLAY_HEIGHT in the code from 174 to 170 to fit the dimensions of my screen, I recieve this message:

Adafruit SPIFlash Animated GIF Example
Flash chip JEDEC ID: 0xC84017
Mounted filesystem!
142692 2022-09-27 16:22 Arduino-Logo-320.gif
4096 2022-10-31 17:50 ._Arduino-Logo-320.gif
22 2020-01-01 00:00 code.py
0 2020-01-01 00:00 lib/
115 2020-01-01 00:00 boot_out.txt
142692 2022-09-27 16:22 Arduino-Logo-320.gif
Successfully opened GIF Arduino-Logo-320.gif; Canvas size = 320 x 170
frame count: 1
duration: 40 ms
max delay: 40 ms
min delay: 10000 ms
4096 2022-10-31 17:50 ._Arduino-Logo-320.gif
Error opening file ._Arduino-Logo-320.gif = 8


and I recive this error message while uploading:

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 1 (RPI-RP2)
Wrote 179200 bytes to /Volumes/RPI-RP2 1/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'.


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

3- I tried to upload the code that is working and unplugg the whole thing from the computer and power it with a battery. I tried with and without switch. The screen is still black

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

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

Post by mikeysklar »

The code is uploading and running again.

I need you to go over the display connections. Shorten the wires, use hookup cable if you have it and confirm continuity to each pin with a multi-meter. Then take a photo of your setup so I can confirm the wiring.

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 »

Ok, I will do that.
Are you able to see the GIF playing on your circuit?

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 »

Ok, I will do that.
Are you able to see the GIF playing on your circuit?

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

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

Post by mikeysklar »

I don’t have this display, only the RP2040 to run the code on.

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 have not shorten my wires because I checked my connections again and they are perfect so I know that the problem is not there. And I am using hook-up wires.

Here is what I see:
-The code is running when nothing is changed on it. It "successfully opens" the file but, there are still some strange thing going on:

A) the screen doesn't play anything

B) I think it is still wierd that the message says:
Successfully opened GIF Arduino-Logo-320-B.gif; Canvas size = 320 x 170
frame count: 1
duration: 40 ms
max delay: 40 ms
min delay: 10000 ms
duration: 40 ms
max delay: 40 ms
min delay: 10000 m

C)
Each time the switch is turned off and then on, the serial monitor adds these line to the message:

4096 2022-11-02 14:11 ._Arduino-Logo-320.gif
Error opening file ._Arduino-Logo-320.gif = 8


which is exactly the same problem i had at the very begining

What I see is that Engineers were able to solve my most recent problem, which arised after I reached out to you for my fisrt problem but now, we are back at the begining.

It seems to me that the RP2040 is creating an invisible file ("._Arduino-Logo-320.gif") each time that it is turned off and then it causes problem when the device is on even if there are no invisible files to start with on my RP2040.

I think the only way to verify if this project is working at this point is that you connect everything to a screen and see what happens.

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

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

Post by mikeysklar »

I have ordered the display needed to replicate the guide and will let you know if I have success with it or reproduce your findings.

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 »

Sounds great! Looking forward to hear back from you

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

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

Post by mikeysklar »

Parts arrived and I wired up the RP2040 + 1.9" IPS TFT. I had no issue with the code building or uploading. My display stayed black.

I went back to the source and modified the pins since RP2040 boards tend to use a GPIO prefix when referencing the pin numbers on the PCB. I figured the pin numbers were off and adjusted it from the D-pin name to the GPIO internal numbering.

The wiring stays the same, but change these pins:

5 --> 7
6 --> 8

The code should now read:

Code: Select all

#define TFT_CS         7
#define TFT_DC         8
#define TFT_RST        9
You can see the confusion looking at the RP2040 pinout chart.
Screenshot from 2022-11-15 10-41-11.png
Screenshot from 2022-11-15 10-41-11.png (587.4 KiB) Viewed 129 times
Now I have GIFs. Serial console needs to be opened.
mini-gif-animated.jpeg
mini-gif-animated.jpeg (160.05 KiB) Viewed 129 times

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 »

Thank you so much, that sounds great!
I am going to try to do the same as soon as I have access to my material and let you know how it goes.

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

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

Post by mikeysklar »

Sounds good.

One further point of confusion is the default Arduino-320.gif installed by CircuitPython. Be sure and remove that. It is not part of the set of GIFs included with the adafruit_gifs/320 folder. Start with the badger one since I confirmed that it works.

The pins being numbered differently is just the difference between CircuitPython numbering on top and Arduino on the bottom side of the RP2040 Feather.

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 was about to try it out today, but when I opened my RP2040, I could see that the files are locked, so I cannot load Nuke or CircuitPython on it...
Screenshot 2022-11-25 at 1.22.40 PM.png
Screenshot 2022-11-25 at 1.22.40 PM.png (76.15 KiB) Viewed 119 times
When I go on "Get Info", it looks like the computer doesn't allow me to uncheck the "locked" box...
Screenshot 2022-11-25 at 1.22.40 PM.png
Screenshot 2022-11-25 at 1.22.40 PM.png (76.15 KiB) Viewed 119 times
I updated my Mac some days ago, so that is probably why, but there must be a way to go around it. Please let me know if you can help with that
Attachments
Screenshot 2022-11-25 at 1.25.42 PM.png
Screenshot 2022-11-25 at 1.25.42 PM.png (131.51 KiB) Viewed 119 times

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 »

problem in last post was resolved

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

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

Post by mikeysklar »

What was the solution to the locked file problem you briefly encountered? I had not seen that before.

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 had to open the locked files with TextEdit and unlock them from there. But still after this, the UF2 and Nuke files would not copy onto the RPI-RP2 Volume. I found out that this was the symptom of a more complex problem explained here:
https://www.raspberrypi.com/news/the-ventura-problem/

I looks like there are some recent dysfunctions between Mac updating systems (Ventura) and Raspberry Pie products...But I did copy the UF2 file successfully using the terminal of my computer, as suggested on this article. However, I still have some issues with loading the code on my RP2040.

When I use Arduino 1.8.19, the code is compiled without problem but it gives me this error message every time I upload it on the board:

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
No drive to deploy.
An error occurred while uploading the sketch


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

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

Return to “Feather - Adafruit's lightweight platform”