SPI Flash Examples missing (fatfs_format, etc), can't write SPIFlash...

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.
Locked
User avatar
tomjennings
 
Posts: 102
Joined: Thu Aug 17, 2006 1:21 am

SPI Flash Examples missing (fatfs_format, etc), can't write SPIFlash...

Post by tomjennings »

There seems to be a problem with the SPI Flash libraries and examples; the current examples do not compile. My libraries and boards are up to date. I was relying on the fatfs_format example as a one-time formatter, but it's now gone.

I'm using SPIFlash as a FAT12 system, to store about a dozen variables, like I did with old EEPROM-equipped boards.

Is there any longer an example program to format a FAT12 or other file system onto the onboard SPI Flash?

Board is a Metro M4.

Code: Select all

00:00:01 flash setup
00:00:01 flash Flash chip JEDEC ID: 0xC84015
00:00:01 flash Error, failed to mount newly formatted filesystem!
00:00:01 flash Was the flash chip formatted with the fatfs_format example?
00:00:01 flash Mounted filesystem
00:00:01 flash flash/SD read fail data2.txt

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

Re: SPI Flash Examples missing (fatfs_format, etc), can't write SPIFlash...

Post by mikeysklar »

What version of the Adafruit SPIFlash library are you running?

Are you using the Adafruit SdFat fork?

https://learn.adafruit.com/adafruit-fea ... -spi-flash

User avatar
tomjennings
 
Posts: 102
Joined: Thu Aug 17, 2006 1:21 am

Re: SPI Flash Examples missing (fatfs_format, etc), can't write SPIFlash...

Post by tomjennings »

mikeysklar wrote: Wed Oct 26, 2022 11:42 am What version of the Adafruit SPIFlash library are you running?
Are you using the Adafruit SdFat fork?
Adafruit SPIFlash, 4.0.0
"SDFAT Adafruit Fork", 2.2.1

For example programs, I'm looking in Examples : Adafruit SPIFlash. The older fatfs_format and other examples are missing, and the ones that are there, do not compile.

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

Re: SPI Flash Examples missing (fatfs_format, etc), can't write SPIFlash...

Post by mikeysklar »

I have a Metro M4. I'll install the current libs and get back to you.

Are you running the Arduino IDE v1.8.19? I could see the 2.x release potentially breaking some things.

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

Re: SPI Flash Examples missing (fatfs_format, etc), can't write SPIFlash...

Post by mikeysklar »

I was able to build and upload these two scripts to my Metro M4 using the same current library versions you are using.

flash_info
SdFat_format

Both of which come from the SPIFlash library examples.

User avatar
tomjennings
 
Posts: 102
Joined: Thu Aug 17, 2006 1:21 am

Re: SPI Flash Examples missing (fatfs_format, etc), can't write SPIFlash...

Post by tomjennings »

I'm running IDE 1.8.16, yeah 2.x has awful problems, which is unfortunate.
mikeysklar wrote: Wed Oct 26, 2022 5:09 pm I was able to build and upload these two scripts to my Metro M4 using the same current library versions you are using.

flash_info
SdFat_format

Both of which come from the SPIFlash library examples.
Firs, THANKS SO MUCH for doing that.

Ahh. OK then, my environment is AFU. Hmm... I did recently try the 2.x version to see if it's improved enough to use, but alas the work window lost all it's menu pulldowns and other odd problems...

It did update a bunch of libraries. Or I could have hosed things all by myself. Worst case I'll reinstall the IDE and libraries from scratch (sigh).

User avatar
tomjennings
 
Posts: 102
Joined: Thu Aug 17, 2006 1:21 am

Re: SPI Flash Examples missing (fatfs_format, etc), can't write SPIFlash...

Post by tomjennings »

mikeysklar wrote: Wed Oct 26, 2022 5:09 pm I was able to build and upload these two scripts to my Metro M4 using the same current library versions you are using.
The fatfs_format program no longer exists; and SDfat_format wants an external SD from what I can tell. I'll rebuild my enviro first then try again...

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

Re: SPI Flash Examples missing (fatfs_format, etc), can't write SPIFlash...

Post by mikeysklar »

It is always an option to rename the Arduino/ folder like Arduino-1.8.16 and then install a the most up to date of the 1x release --> 1.8.19 so it will create its own fresh installation. That way if you want to run the old 1.8.16 setup for some other code base you can move the folder back into place.

User avatar
tomjennings
 
Posts: 102
Joined: Thu Aug 17, 2006 1:21 am

Re: SPI Flash Examples missing (fatfs_format, etc), can't write SPIFlash...

Post by tomjennings »

PROBLEM SOLVED with your help Mike. Thanks.

Yeah, it was just a fouled up library environment. I installed 1.8.19, moved the Arduino/ folder, used the Library Manager to install necessary libs, my own libraries I installed by hand, and a couple oddballs I use not in the Arduino distros, and all's well. The examples compile, and my fatfs little config store works again.

For the record, Example > Adafruit SPIDFlash > fatfs_format and the rest are now SDfat_format and &c. So functionality is not lost, just obscured, lol.

I'll of course keep the old libraries folder and pluck out what few oldies I still need. But it's a reminder I need to clean out the cruft once in a while.

While I don't know what munged it in the first place, I suspect it was the 2.x IDE, but I won't pursue that. (But if I test again I'll clone the Arduino folder first : - )

tom

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

Re: SPI Flash Examples missing (fatfs_format, etc), can't write SPIFlash...

Post by mikeysklar »

Thank you for sharing the summary of your solution.

The Arduino IDE seems to get a bit fussy with years of library installs and multiple IDE releases installed on top of each other. I blow away my Arduino/ folder every few months and save my code elsewhere.

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

Return to “Metro, Metro Express, and Grand Central Boards”