W25QXXX 3v Serial Flash Memory

Please do not post requests
Post Reply
sajuukKahr
Posts: 45
Joined: Mon Jan 30, 2017 10:52 pm
Location: Amsterdam, NL

W25QXXX 3v Serial Flash Memory

Post by sajuukKahr » Tue Feb 07, 2017 9:04 pm

First of all credits to: madias for the init, michael_l for the pinMode change

https://github.com/RRPRIME/STM32/tree/m ... nbondflash

Should work with:
W25Q80
W25Q16
W25Q32
W25Q64
W25Q128

How to use:

init your SPI port
SPIClass spiToUse(2); // int represents SPI port number

set your SS port
//#define SS PA4
#define SS PB12

use mem.begin(_W25Q64,spiToUse,SS)

the above example is for a W25Q64 running on the SPI2 of a STM32F1

victor_pv
Posts: 1745
Joined: Mon Apr 27, 2015 12:12 pm

Re: W25QXXX 3v Serial Flash Memory

Post by victor_pv » Mon Feb 13, 2017 5:23 am

sajuukKahr wrote:First of all credits to: madias for the init, michael_l for the pinMode change

https://github.com/RRPRIME/STM32/tree/m ... nbondflash

Should work with:
W25Q80
W25Q16
W25Q32
W25Q64
W25Q128

How to use:

init your SPI port
SPIClass spiToUse(2); // int represents SPI port number

set your SS port
//#define SS PA4
#define SS PB12

use mem.begin(_W25Q64,spiToUse,SS)

the above example is for a W25Q64 running on the SPI2 of a STM32F1
Thanks for sharing.
I noticed you send bytes for a page one by one with this

Code: Select all

  do {
    transfer(buf[i]);
    i++;
  }while(i!=0);
You can improve speed on that by using the spi.transfer() function, is part of the spi standard library in both stm and arduino.

stevestrong
Posts: 1821
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: W25QXXX 3v Serial Flash Memory

Post by stevestrong » Mon Feb 13, 2017 9:51 am

I would go further and suggest to use the SPI.write(uint8_t * buf, uint32_t length) function, which is even more faster, and it looks more suitable because no reading is needed in this case.

victor_pv
Posts: 1745
Joined: Mon Apr 27, 2015 12:12 pm

Re: W25QXXX 3v Serial Flash Memory

Post by victor_pv » Mon Feb 13, 2017 1:20 pm

stevestrong wrote:I would go further and suggest to use the SPI.write(uint8_t * buf, uint32_t length) function, which is even more faster, and it looks more suitable because no reading is needed in this case.
Makes sense. And there is another function for reading to a buffer that does something similar, could use the spi library function to read to buffer.

sajuukKahr
Posts: 45
Joined: Mon Jan 30, 2017 10:52 pm
Location: Amsterdam, NL

Re: W25QXXX 3v Serial Flash Memory

Post by sajuukKahr » Thu Feb 16, 2017 9:23 am

Thanks for the suggestions I will look into it as soon as I have some free time.

ropa
Posts: 8
Joined: Tue Jul 25, 2017 6:23 am

Re: W25QXXX 3v Serial Flash Memory

Post by ropa » Tue Jul 25, 2017 6:24 am

Unfortunately, this library doesn't work


User avatar
martinayotte
Posts: 1229
Joined: Mon Apr 27, 2015 1:45 pm

Re: W25QXXX 3v Serial Flash Memory

Post by martinayotte » Tue Jul 25, 2017 2:47 pm

Personally, I'm using this one :
https://github.com/LowPowerLab/SPIFlash

Post Reply