change Adafruit_TinyFlash to use other W25Q chips

Adafruit's tiny microcontroller platform. 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
szedula
 
Posts: 31
Joined: Tue Jul 07, 2015 10:51 pm

change Adafruit_TinyFlash to use other W25Q chips

Post by szedula »

I looked at the the code in the "Adafruit_TinyFlash" library and was wondering if using a BANNED instead of W25Q80BV would be as easy as just changing these lines:

// Currently rigged for W25Q80BV only
#define CHIP_BYTES 1L * 1024L * 1024L

to these lines:

// for W25Q80BV only (8 Mbit = 1 Mbyte)
//#define CHIP_BYTES 1L * 1024L * 1024L
//#define MAN_ID 0xEF
//#define DEV_ID 0x13
// for BANNED (32 Mbit = 4 Mbyte)
#define CHIP_BYTES 4L * 1024L * 1024L
#define MAN_ID 0xEF
#define DEV_ID 0x15

And changing these lines:

// Chip capacity is hardcoded for now
return ((manID == 0xEF) && (devID == 0x13)) ? CHIP_BYTES : 0L;

to these lines:

// Chip capacity is hardcoded for now by defines
return ((manID == MAN_ID) && (devID == DEV_ID)) ? CHIP_BYTES : 0L;

I have the datasheets for both chips and was wondering if this was all I needed to change before spending a lot of time comparing the two data sheets.

Thanks, Joe.

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

Re: change Adafruit_TinyFlash to use other W25Q chips

Post by mikeysklar »

Joe,

You can see in our CircuitPython archive we do support this device as W25Q16JV_IQ. Maybe some defining features in there for you to review before making any changes to tiny_uf2.

https://github.com/adafruit/circuitpyth ... /devices.h

Your suggested mods look like a reasonable change. It's just a bigger flash chip right? If your changes work why not open an Issue with the repo as a feature request to support this chip with your proposed code merge. They'll either merge it or point you towards another resource.

https://github.com/adafruit/Adafruit_TinyFlash/issues

User avatar
plutonic
 
Posts: 89
Joined: Wed Jan 06, 2016 3:21 am

Re: change Adafruit_TinyFlash to use other W25Q chips

Post by plutonic »

Wait, sorry to cut in but is this about the Trinket M0? Does the board have a pad for a serial flash chip? The product page doesn't mention anything about that, but I'd love to add more flash to my Trinket.

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

Re: change Adafruit_TinyFlash to use other W25Q chips

Post by mikeysklar »

The QtPy is using the same processor as the Trinket M0 and it has the flash 8-SOIC available for a memory upgrade. No dice on the Trinket M0.

https://www.adafruit.com/product/4600
58195F34-8A53-419A-A81B-6A12A349BFF2.jpeg
58195F34-8A53-419A-A81B-6A12A349BFF2.jpeg (374.26 KiB) Viewed 142 times

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

Return to “Trinket ATTiny, Trinket M0”