Closed santhosh1211 closed 4 years ago
HI Marzogh,
i changed the default clock speed to 18mhz now its working fine ,
flash.setClock(2000000); this function is working but not 100% after changing the below modification its working fine for STM32f103
Modification found from (Bug report - Not working by default with Teensy 4.0 and W25Q64JV #199 ) Whereas the SPIMemory library sets this to 104MHz by default (in defines.h):
Changing SPI_CLK to "#define SPI_CLK 18000000"
its working good .
Thank you
Thank you santhosh1211. That was what I needed for it to work flawlessly, reducing the speed of the SPI CLK. I am using W25Q128FVSG module. My board is the BluePill STM32F103C8T6.
I noticed that the ARCH_STM32 is not selected automatically so the constructor was trying to match other patterns. I don't know if I should have written #define ARCH_STM32 at the beggining of the sketch though. For a final try I reinstalled the library to get rid of any modifications and I put this line at the beggining and it now selects the right constructor.
Any bug report raised here MUST be submitted according to this template or it will be flagged with 'Not enough information'. No action will be taken till all the prerequisite information is provided. If no information is provided for over a month after the 'Not enough information' label is applied, the issue will be closed.
Pre-bug report checklist:
Do this checklist before filing an bug report:
Bug Report
HI Marzogh,
i am using stm32f103rct6 controller i connected default spi pins to the W25Q64 SPI flash .
i but the ARCH_STM32 line in the variant.h file after that its complied.
I tried multiple SPI clock speed setting after that Erase Chip and Power Up function start working
but the run diagnostic is getting failed . so that read write function also not working .
Kindly support me to solve this issue .
Describe the bug
Include a clear and concise description of what the bug is.
#define RUNDIAGNOSTICS
uncommented in SPIFlash.h. Paste the relevant sections of the output from your Serial console when you run FlashDiagnostics.ino.here:SPIMemory Library version: < 2.5.0
JEDEC ID: 0x77A00B Man ID: 0x77 Memory ID: 0xA0 Capacity: 0 Max Pages: 0 Unique ID: 2241195777991936, 0x6458811BE382500
To see function runtimes ncomment RUNDIAGNOSTIC in SPIMemory.h.
FlashDiagnostics.ino
include
if defined(ARDUINO_SAMD_ZERO) && defined(SERIAL_PORT_USBVIRTUAL)
// Required for Serial on Zero based boards
define Serial SERIAL_PORT_USBVIRTUAL
endif
if defined (SIMBLEE)
define BAUD_RATE 19200
define RANDPIN 1
else
define BAUD_RATE 19200
if defined(ARCH_STM32)
define RANDPIN PA0
else
define RANDPIN A0
endif
endif
define TRUE 1
define FALSE 0
SPIFlash flash;
void setup() {
Serial.begin(BAUD_RATE);
if defined (ARDUINO_ARCH_SAMD) || defined (__AVR_ATmega32U4__) || defined (ARCH_STM32) || defined (NRF5) || defined (ARDUINO_ARCH_ESP32)
while (!Serial) ; // Wait for Serial monitor to open
endif
delay(50); //Time to terminal get connected Serial.print(F("Initialising")); for (uint8_t i = 0; i < 10; ++i) { Serial.print(F(".")); } Serial.println(); randomSeed(analogRead(RANDPIN));
if (flash.error()) { Serial.println(flash.error(VERBOSE)); }
flash.begin(); // flash.begin(MB(32)); delay(50); flash.setClock(2000000); // this sets the clock spped to 20,000,000 Hz - i.e. 20MHz
if (getID()) {
..........