preenfm Forum

PreenFM => preenfm2 and preenfm3 => Topic started by: lokki on October 18, 2020, 09:37:54 AM

Title: [fixed in 0.95 ?] preenfm3 sd card error
Post by: lokki on October 18, 2020, 09:37:54 AM
hi xavier,

i flashed the firmware successfully.

unfortunately my LCD was a different kind of pcb, but still 2.8''. the holes for the sdcard-reader don't align. i bent some headers and soldered it, but maybe something is wrong...it is also possible the reader does not work on the PCB, it is a cheap chinese LCD. the screen itself works flawless.

now,
-when i boot up without an sdcard inserted i get a: SD CARD ERROR after which the preenfm3 boots successfully.
-when i insert a sdcard at boot up, the screen just stays black. if i then unplug the sdcard, the screen goes white
-when i insert a sdcard after boot up the screen goes black. when i remove it the screen goes white.

does that indicate anything?

if i would attach a separate sdcard reader module, i need the four connections and 3.3v and gnd?

Title: Re: preenfm3 sd card error
Post by: Xavier on October 19, 2020, 06:48:52 PM

Hi,

I just replied to the other thread to flash the firmware, glad you could flash it.

Can you let me know the exact TFT you have.
I didn't know some of them have different SD pins.
What are the 4 SD pins label on the TFT ?
Maybe some of them does not correspond to what the preenfm3 expect.
Title: Re: preenfm3 sd card error
Post by: lokki on October 19, 2020, 07:09:59 PM
sorry, yes i realised the "x" thing after a while as well, had no time to post it yet.

this is the link to the display:

https://www.aliexpress.com/item/4001135326039.html?spm=a2g0s.9042311.0.0.27424c4dP0cOvE

the sd pins seem to align, no?

is there anything more verbose in regard to the sdcard that i could try?
Title: Re: preenfm3 sd card error
Post by: Xavier on October 19, 2020, 07:42:13 PM
It's difficult to get any info from the SD card other than it does no work.

-when i boot up without an sdcard inserted i get a: SD CARD ERROR after which the preenfm3 boots successfully.

OK that's expected.

-when i insert a sdcard at boot up, the screen just stays black. if i then unplug the sdcard, the screen goes white

Seems like it stays locked while trying to initialize the SD driver (or read from the card).
Does your SD card contain the /pfm3/ folder ?

If yes can you try to reformat it (fat32) and copy the /pfm3/ folder again on it.


Title: Re: preenfm3 sd card error
Post by: lokki on October 19, 2020, 07:48:29 PM
it seems i am missing some fundamental stuff :-)  8)

will copy the folder to the sdcard (did not know i had to do that) the wiki does not mention it, no?
i guess i have to look at the zip file.
Title: Re: preenfm3 sd card error
Post by: lokki on October 19, 2020, 07:52:25 PM
sorry, i only looked at the 0.91 release, and it didn't contain the sdcard zip file...found it in the 0.90 folder.
Title: Re: preenfm3 sd card error
Post by: Xavier on October 19, 2020, 07:53:37 PM

You're right the SD wiki part is still missing. Sorry.
Yes the zip is attached in the v0.90 release :
https://github.com/Ixox/preenfm3/releases
Title: Re: preenfm3 sd card error
Post by: lokki on October 19, 2020, 08:24:46 PM
hmm, the screen still stays black even with the folder on the sdcard...

will try a different sdcard. or maybe the reader is really broken on the screen
Title: Re: preenfm3 sd card error
Post by: lokki on October 19, 2020, 08:32:25 PM
and another sdcard does not fix this...

but, the blue led on the main pcb blinks, even when the screen stays black, maybe that tells you something?

can i just attach another microsd card modul with SPI and 3.3v logic?
Title: Re: preenfm3 sd card error
Post by: Xavier on October 19, 2020, 09:31:45 PM
but, the blue led on the main pcb blinks, even when the screen stays black, maybe that tells you something?

Interesting, it means the pfm3 firmware is correctly running but the TFT is not.
I don't understand how puting a SD card can prevent the TFT to run...

Is the TFT totally black (no led at all), or black (with backlight) ?
There's a way to reinit TFT, can you try :
. v0.90 : holding the MENU 2 or 3 seconds
. V0.91: Hold down MENU (7) + press previous instrument (8 ) (see buttons number here (https://github.com/Ixox/preenfm3/wiki/Quickstart))
What is the result ?

can i just attach another microsd card modul with SPI and 3.3v logic?

Yes, it should work if you follow the SPI pins.
But i'm still not sure your SD card does not work.
Title: Re: preenfm3 sd card error
Post by: lokki on October 19, 2020, 09:58:03 PM
it is totally black (no backlight), as soon as i put in the sdcard. and as soon as i take it out it goes all white.
pressing menu does not help it stays white (i am on 0.90 now but will update again to 0.91 and try as well)
Title: Re: preenfm3 sd card error
Post by: lokki on October 21, 2020, 04:16:31 PM
Got it working. As I suspected it was the sdreader on that display module that was faulty. For testing I simply soldered a SD to micro sd adapter to the corresponding PINs on the preenfm3,since I found out that sd cards are directly SPI compatible...

Guess my preenfm3 will be accepting microSD from now on :)
Title: Re: preenfm3 sd card error
Post by: Xavier on October 21, 2020, 06:51:40 PM
Got it working. As I suspected it was the sdreader on that display module that was faulty. For testing I simply soldered a SD to micro sd adapter to the corresponding PINs on the preenfm3,since I found out that sd cards are directly SPI compatible...

Guess my preenfm3 will be accepting microSD from now on :)

Great  :)
and thanks for the update
Title: Re: preenfm3 sd card error
Post by: Olivier on October 26, 2020, 08:08:05 PM
When working with firmware 0.91 I can't get the SDCard to work from the sreen, so I installed a new SDcard reader, but it doesn't work.

I look at https://github.com/Ixox/preenfm3/issues/3 (https://github.com/Ixox/preenfm3/issues/3), install firmware 0.90 and now  the new SDcard reader work fine.
I didn't try the SDCard reader from the sreen.
Title: Re: preenfm3 sd card error
Post by: Xavier on October 26, 2020, 10:46:19 PM

Thanks for pointing the github issue, i missed it.

As i wrote in the issue :
"0.91 use DMA to send and receive data from the SD Card.
I don't know why it does not work with your SDCard.
What sdcard do you use ?"
Title: Re: preenfm3 sd card error
Post by: Xavier on October 27, 2020, 09:29:44 AM

Having the SD problem fixed is my highest priority now.
I cannot reproduce it with my SD cards so i would need to have your exact SD card reference so that i can buy it and try.
Thanks.
Title: Re: preenfm3 sd card error
Post by: Olivier on October 27, 2020, 04:30:55 PM
I use this SDcard reader.
https://fr.aliexpress.com/item/32820320799.html?spm=a2g0s.9042311.0.0.27426c37lxLDpm (https://fr.aliexpress.com/item/32820320799.html?spm=a2g0s.9042311.0.0.27426c37lxLDpm)

PM me your postale adress and I send you one, I live in France so you will get it very fast.
Title: Re: preenfm3 sd card error
Post by: Xavier on October 27, 2020, 06:04:10 PM
I use this SDcard reader.
https://fr.aliexpress.com/item/32820320799.html?spm=a2g0s.9042311.0.0.27426c37lxLDpm (https://fr.aliexpress.com/item/32820320799.html?spm=a2g0s.9042311.0.0.27426c37lxLDpm)

If it works with 0.90 and not with 0.91 i think it comes from the SDCard itself.
What model do you have ?

PM me your postale adress and I send you one, I live in France so you will get it very fast.

Thanks, that's not necessary for the moment  :)
Title: Re: preenfm3 sd card error
Post by: Xavier on October 27, 2020, 09:47:03 PM
I just published a 0.92 firmware.
At the last moment i decreased the SD communication speed, would be great if you could give a try and let me know.
https://github.com/Ixox/preenfm3/releases
Title: Re: preenfm3 sd card error
Post by: Olivier on October 29, 2020, 05:16:52 PM
I have try 0.92 firmware. The Outputs are OK.

My  SDcard reader works with a micoSd card Sandisk Mobile Ultra 8GB Class 6. It doesn't work with SD card Kingston 8GB class4. It also doesn't work with a very old SD card SimpleTech 128MB.

I have try the SDCard reader from the screen, the SDcard become hot very quickly and the screen was black or White, didn't remember.
Title: Re: preenfm3 sd card error
Post by: Xavier on October 29, 2020, 10:44:05 PM

Seems like your SD card reader from the screen does not work.
I bought almost 10 from amazon between 10€ and 15€ they all worked well  :-\

I still haven't found a SD card that does not work so i don't know how to debug that.

I'm glad you found a solution.
Title: Re: preenfm3 sd card error
Post by: Olivier on October 30, 2020, 12:30:55 AM
Ili9341 TFT display's built-in SD card does not seem reliable (search on the internet). We are two with the same problem and need to use an external SDcard reader.
Another problem is about the dimension of this screen. Mine is shorter than the one you show on the Wiki/Build. This mean that it's impossible to fit a unique metal or 3D case.

Aliexpress or amazon are not reliable supplier for this screen. When we order a Ili9341 TFT, we do not get the same product.

The best case would be to define 1 reference for the screen and 1 reference for the  SD card reader(or micro Sd card) from a trust supplier (mouser, ...). I don't know if it's possible.
Title: Re: preenfm3 sd card error
Post by: Olivier on October 30, 2020, 12:39:58 AM
Next week i will try my screen with 3,3Volts instead of 5 Volts. I hope the built-in SD card will work.
Title: Re: preenfm3 sd card error
Post by: Xavier on October 30, 2020, 07:38:47 AM
The best case would be to define 1 reference for the screen and 1 reference for the  SD card reader(or micro Sd card) from a trust supplier (mouser, ...). I don't know if it's possible.

Thanks for the feedback.
I agree, sorry about the problem with the screen dimension... i didn't expect that.
I'll update the BOM with more details.

Using an external SD card reader makes the build more complicated and may not be compatible with future cases (plexi, metal...).


Title: Re: preenfm3 sd card error
Post by: lokki on October 30, 2020, 10:54:29 AM
Next week i will try my screen with 3,3Volts instead of 5 Volts. I hope the built-in SD card will work.

So is the screen running at 5v on the preenfm3? I assumed 3.3v but did not yet take measurements...

I think all those sdcard problems come from the fact, that these displays are designed to be run on a 5v Arduino and include resistor dividers as level shifters instead of proper ICs. Probably one could simply solder jumper wires directly from the 4 sdpins to the sdcard slot and it would work. Maybe the three smd resistors would have to be removed.
Title: Re: preenfm3 sd card error
Post by: Xavier on October 30, 2020, 12:09:53 PM

Those TFTs accrepts both 5v and 3.3v as power.
The data lines must be 3.3v.

I don't know for the moment what's wrong with some SD card reader, but the 2 that reports problems also have a dimension problems.
What is the value of the 3 resistors you have on the TFT PCB ? I have 1Kohm.
I don't think their goal is to shift levels as the TFT is supposed to have 3.3v TTL level :

http://www.lcdwiki.com/2.8inch_SPI_Module_ILI9341_SKU:MSP2807



Title: Re: preenfm3 sd card error
Post by: lokki on October 30, 2020, 12:55:15 PM
The display I bought clearly stated that it is Arduino 5v compatible, the sdlines run directly from the connector via a resistor to the SPI pins, so they have to be for level shifting somehow. (Since Arduino sends out 5v logic).

With 3.3v logic you don't get the right levels I suppose. Unfortunately I can't easily measure, since I have soldered the display to the preenfm3 directly (will make my own smaller case...more later :)
Title: Re: preenfm3 sd card error
Post by: Olivier on October 30, 2020, 05:56:47 PM
The value of the 3 resistors I have on the TFT PCB are 1Kohm.

But the problem seems to be the connection to the SDCard. They are different between my sreen and your screen.

I attach a Jpg file with some numbers on the SDcard Pins.
Pin 1 is connected to R1
Pin 2 is connected to R2
Pin 5 is connected to R3
Pin 7 is connected to MISO

On your Screen
Pin 2 is connected to R1
Pin 3 is connected to R2
Pin 6 is connected to R3

This means that the SDCard connections on my screen are probably wrong.
Title: Re: preenfm3 sd card error
Post by: Xavier on October 30, 2020, 06:13:10 PM
I attach a Jpg file with some numbers on the SDcard Pins.
Pin 1 is connected to R1
Pin 2 is connected to R2
Pin 5 is connected to R3
Pin 7 is connected to MISO

This means that the SDCard connections on my screen are probably wrong.

 :o
Seems like you're right.
That does not correspond to the standard SD pins.. Cannot believe that !!!  :-\
Does R1 go to SD_CS  ?


http://elm-chan.org/docs/mmc/mmc_e.html
Title: Re: preenfm3 sd card error
Post by: lokki on October 30, 2020, 11:21:39 PM
This is indeed almost unbelievable...i will check the pictures of my order, but I suspect it is the sameas Oliviers
Title: Re: preenfm3 sd card error
Post by: Megalomidiac on October 31, 2020, 09:59:27 PM
I also bought this wrong display accidentally but never mounted it.
On mine, the SDcard connector is soldered very poorly, it looks, as if someone soldered it manually and there is flux smeared around it.
Have the two people here with the same wrong LCD the same appearance?

I ordered the right display and got it today. There, the SDcard connector is soldered perfectly and clean!
Title: Re: preenfm3 sd card error
Post by: Xavier on November 01, 2020, 06:48:19 PM
Thanks for the update.
Good to know such displays exist...

Title: Re: preenfm3 sd card error
Post by: Olivier on November 06, 2020, 07:21:14 PM
I tested my screen with 3,3Volts instead of 5 Volts. Built-in SD card didn't work. Power consumption didn't change.

Have the two people here with the same wrong LCD the same appearance?
It is not so bad, but it is not good.

The SDCard connections on this screen are wrong.
Title: Re: preenfm3 sd card error
Post by: Megalomidiac on November 08, 2020, 07:15:11 PM
Finally I had time to solder.
Wanted to make the acrylic case prototype first and then to "marry" the boards and TFT to allign all perfect.

I have installed the latest firmware (0.94) and tested a few cards from a few NoNames, Intensio class 10 16GB, Adata class 10 8GB and none of them worked.

Only a Sandisc Ultra 32GB works!
Title: Re: preenfm3 sd card error
Post by: Xavier on November 08, 2020, 08:28:52 PM
Finally I had time to solder.
Wanted to make the acrylic case prototype first and then to "marry" the boards and TFT to allign all perfect.

I have installed the latest firmware (0.94) and tested a few cards from a few NoNames, Intensio class 10 16GB, Adata class 10 8GB and none of them worked.

Only a Sandisc Ultra 32GB works!

Thanks for the report.

Cards that work for me :
. Sandisk Ultra class 10 16Gb
. Patriot LX series class 8 16GB
. EMTC class 4 8Gb
. Sandisk SDHC class 4 4Gb

Cards that does not work:
. Intenso class 10 8Gb
. Transcend class 10 4Gb

I'll try to improve compatibility. But that will take time and it's not straightforward.
Best thing to do today, is to chose a working SD card.
Sandisk ultra seems an easy choice : That's the one (https://www.amazon.fr/Carte-M%C3%A9moire-SanDisk-jusqu%C3%A0-Classe/dp/B0143RTB1E/ref=sr_1_7)
Title: Re: preenfm3 sd card error
Post by: j4ustin on November 10, 2020, 08:08:57 PM
I've tried updating my firmware beyond 0.90 but even at 0.91 I can't get any presets to pull up on my SD cards. I've tried 3 different SD cards (2 from Kingston, 1 from a pedal that I got unsure of the brand), and none of them work unless the version is downscaled to 0.90. The system will read the SD card firmware when flashing to go between versions, though.

I have the folder set as pfm3/ at the root with the presets stored. It works going back down to version 0.90 with no changes in place.

Am I missing something here?
Title: Re: preenfm3 sd card error
Post by: Xavier on November 10, 2020, 09:41:05 PM
I've tried updating my firmware beyond 0.90 but even at 0.91 I can't get any presets to pull up on my SD cards. I've tried 3 different SD cards (2 from Kingston, 1 from a pedal that I got unsure of the brand), and none of them work unless the version is downscaled to 0.90. The system will read the SD card firmware when flashing to go between versions, though.

I have the folder set as pfm3/ at the root with the presets stored. It works going back down to version 0.90 with no changes in place.

Am I missing something here?

Sorry about that.

FYI, In 0.91 i changed the way the SD card is accessed to allow loading presest without any audio glitch for other instruments.
I'll try tomorrow (day off in France) to have my "Transcend SD Card" working. Hopefully the other "non working ones" will work also.
If i cannot, i'll compile a recent firmware wth the same SD driver as in 0.90.
Title: Re: preenfm3 sd card error
Post by: j4ustin on November 10, 2020, 11:10:45 PM
Thanks Xavier, appreciate your work. This is an awesome instrument!
Title: Re: preenfm3 sd card error
Post by: Xavier on November 11, 2020, 06:56:08 PM
v0.95 will hopefully improve a lot SD card compatibility :
https://github.com/Ixox/preenfm3/releases

What did i fix ?
With SD card in SPI mode, when you read data you have to send dummy data to the SD card at the same time.
I was sending 0x00 data. Seems like 0xFF is the standard and some cards require it.


If you still don't see you card, try to format with the official SD card formatter :
https://www.sdcard.org/downloads/formatter/
Copy back your /pfm3/ folder and try again.
That fixes the problem for one of my SD card.

I still have problem with my "Intenso Class 10 8Go" which cannot create big files. So don't create Seq or Mixer Bank with it.

Please let me know how it works for you,

Xavier