adafruit / Adafruit_SPIFlash

Arduino library for external (Q)SPI flash device
MIT License
148 stars 79 forks source link

Can't format SPI flash on Feather M0 Express #44

Closed jakubhlavaty closed 4 years ago

jakubhlavaty commented 4 years ago

I want to format the onboard flash on the Feather M0 Express and store some files there. The format example gives the following output:

Adafruit SPI Flash FatFs Format Example
Flash chip JEDEC ID: 0x14015
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This sketch will ERASE ALL DATA on the flash chip and format it with a new filesystem!
Type OK (all caps) and press enter to continue.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Creating and formatting FAT filesystem (this takes ~60 seconds)...
Formatted flash!
Error, failed to mount newly formatted filesystem!
ladyada commented 4 years ago

please make sure you have the latest SAMD package, we made some changes recently! :)

hathach commented 4 years ago

@jakubhlavaty I just pull out my Feather M0 Express to test, seem to be good with latest lib version, can you confirm your lib version is at least as follows (it is part of compile verbose output)

Using library SPI at version 1.0 in folder: 
Using library Adafruit_ZeroDMA at version 1.0.4 in folder: 
Using library SdFat at version 1.2.1 in folder: 
Using library Adafruit_SPIFlash at version 3.1.4 in folder:

If it still fails, please try to eanble SdFat DEBUG_MODE to 1 and re-compile & upload, then post your Serial output here https://github.com/adafruit/SdFat/blob/master/src/FatLib/FatVolume.h#L38

hathach commented 4 years ago

PS: I notice your board using a different flash device than mine, your seem to be S25FL116K, mine is GD25Q16C . But the lib should technically work with both.

Adafruit SPI Flash FatFs Format Example
Flash chip JEDEC ID: 0xC84015
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This sketch will ERASE ALL DATA on the flash chip and format it with a new filesystem!
Type OK (all caps) and press enter to continue.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Creating and formatting FAT filesystem (this takes ~60 seconds)...
Formatted flash!
Flash chip successfully formatted with new empty filesystem!
jakubhlavaty commented 4 years ago

Just a hint: I had some issues compiling so I downgraded the boards lib to the pre-last version which solved that issue. Not sure if it could be related.

I will try the debug option, thanx :-)

jakubhlavaty commented 4 years ago

Btw this is on windows (fresh install from windows store along with all libs in latest versions - except the boards like I mentioned). I can try on Linux as well.

hathach commented 4 years ago

Just a hint: I had some issues compiling so I downgraded the boards lib to the pre-last version which solved that issue. Not sure if it could be related.

I will try the debug option, thanx :-)

Thanks for your info, but please be specific about your SAMD BSP, SPIFlash and SdFat (Adafruit's Fork) version that you are using. Which version that works and which doesn't. Yes if possible the debug log will help to analyze the problem.

jakubhlavaty commented 4 years ago

also some other Adafruit libs:

I didn't yet have the chance to run with debug. I'll let you know when I do. Like I said this was a fresh install of Arduino IDE with the latest libs and the formatting didn't work for me yet as I didn't try downgrading any other stuff then the Adafruit SAMD.

jakubhlavaty commented 4 years ago

Just tried it on Linux and everything works like a charm. Fedora 26 4.16.11-100.fc26.x86_64

I had an older version of Arduino IDE lying around so I installed the latest one (1.8.11) and added the new SPIFlash libs.

Adafruit SAMD: 1.0.21 Adafruit circuit playground: 1.7.0 Adafruit SPIFlash: 3.1.4 SdFat - Adafruit fork: 1.2.3

I guess you can just close this one :-)

Btw I was impressed by your quick reply and btw2 just want to say you're awesome @ladyada.

Have a great day.

hathach commented 4 years ago

thanks for confirming the issue