Hi All,
I feel like I’m missing something obvious here, but I can’t seem to find any info on saving-to/reading-from the optional GD25Q16 - 2MB SPI Flash chip on a Adafruit QT Py - SAMD21 Dev Board using Circuit Python.
Project is basically a data logger with the need for data to be saved in non-volatile memory.
I hope someone can point me to an example or let me know if it’s something simple I’ve missed!
- Thanks
QT PY: 2Kb SPI Flash Access
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Franklin97355
- Posts: 23938
- Joined: Mon Apr 21, 2008 2:33 pm
Re: QT PY: 2Kb SPI Flash Access
Take a look at these and see if they help:
https://learn.adafruit.com/micropython- ... e-sd-cards
https://learn.adafruit.com/adafruit-spi-flash-sd-card
https://learn.adafruit.com/micropython- ... e-sd-cards
https://learn.adafruit.com/adafruit-spi-flash-sd-card
- Lansteys
- Posts: 9
- Joined: Sun Mar 03, 2019 9:22 pm
Re: QT PY: 2Kb SPI Flash Access
Thanks for that!
I’m just working through it now - though I can’t seem to identify the CS pin for the Flash chip…?
Seems to be pin 11, PA08 but I’m stuck on figuring out how to put that in this line:
‘board.SD_CS’ isn’t valid and I’m not sure what I need to replace this with. I haven’t found what PA08 is in ‘board’. Any clues?
Any help would be greatly appreciated!
I’m just working through it now - though I can’t seem to identify the CS pin for the Flash chip…?
Seems to be pin 11, PA08 but I’m stuck on figuring out how to put that in this line:
Code: Select all
cs = digitalio.DigitalInOut(board.SD_CS)
Any help would be greatly appreciated!
- Lansteys
- Posts: 9
- Joined: Sun Mar 03, 2019 9:22 pm
Re: QT PY: 2Kb SPI Flash Access
Ok, minor update:
Returns: “ValueError: PA08 in use”
I’ll keep trying to figure it out…
Code: Select all
cs = digitalio.DigitalInOut(microcontroller.pin.PA08)
I’ll keep trying to figure it out…
- tannewt
- Posts: 3314
- Joined: Thu Oct 06, 2016 8:48 pm
Re: QT PY: 2Kb SPI Flash Access
After you've soldered the optional flash onto the QT Py you'll want to switch to the Haxpress board build of CircuitPython. It'll use the SPI for the filesystem and then you can follow this guide for datalogging: https://learn.adafruit.com/cpu-temperat ... uit-python
Flash info is here: https://learn.adafruit.com/adafruit-qt- ... 3073285-12
Flash info is here: https://learn.adafruit.com/adafruit-qt- ... 3073285-12
- Lansteys
- Posts: 9
- Joined: Sun Mar 03, 2019 9:22 pm
Re: QT PY: 2Kb SPI Flash Access
Hey, thanks for your reply!
Yes, have the Haxpress version installed. From memory the drive shows up with the full memory on my PC.
So if I understand correctly, there is no way to specifically save data to the Flash chip? Or is it that I can only save data to the Flash chip? (this would be OK)
I believe the Flash chip is rated for far more read/write cycles than the microcontrollers flash memory so it would be preferable to always use this.
Yes, have the Haxpress version installed. From memory the drive shows up with the full memory on my PC.
So if I understand correctly, there is no way to specifically save data to the Flash chip? Or is it that I can only save data to the Flash chip? (this would be OK)
I believe the Flash chip is rated for far more read/write cycles than the microcontrollers flash memory so it would be preferable to always use this.
- tannewt
- Posts: 3314
- Joined: Thu Oct 06, 2016 8:48 pm
Re: QT PY: 2Kb SPI Flash Access
The haxpress version of CircuitPython will write to the external flash only. The non-haxpress version will write to the internal flash. There isn't a version that will do both.
I haven't heard of anyone wearing out their flash with CircuitPython.
I haven't heard of anyone wearing out their flash with CircuitPython.
- Lansteys
- Posts: 9
- Joined: Sun Mar 03, 2019 9:22 pm
Re: QT PY: 2Kb SPI Flash Access
Thanks again!
Yes, probably worried over nothing on that account, but that also answers my question - I don’t need to do anything special to utilise the external flash chip as long as the haxpress version of CP is installed.
Exactly what I needed to know - thanks!
Yes, probably worried over nothing on that account, but that also answers my question - I don’t need to do anything special to utilise the external flash chip as long as the haxpress version of CP is installed.
Exactly what I needed to know - thanks!
Please be positive and constructive with your questions and comments.