Marzogh / SPIMemory

Arduino library for Flash Memory Chips (SPI based only). Formerly SPIFlash

Home Page:http://spimemory.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SST26 not working with STM32F429ZI

mattia424 opened this issue · comments

Hi, I am running the SPIMemory V.3.4.0 library with a NUCLEO-F429ZI board and the SST26VF032 memory chip the sketch is extracted from an example.

I tried to include the SPIMemory library and it doesn't work, only with SPIFlash it works
I checked what my deault SPI is and made the following connections:

NSS: PA4 -> CE # (1)
SCK: PA5 -> SCK (6)
MISO: PA6 -> SO / SIO1 (2)
MOSI: PB5 -> SI / SIO0 (5)
VCC -> WP # / SIO2 (3), HOLD / SIO3 (7), VDD (8)
GND -> VSS (4)

The output of my serial is

16: 34: 06.650 -> Get JEDEC ID 
16: 34: 06.650 -> Manufacturer ID: feh
16: 34: 06.650 -> Memory Type: feh
16: 34: 06.650 -> Capacity: feh
16: 34: 06.650 -> JEDEC ID: fefefeh

Sketch:

#include<SPIFlash.h>
HardwareSerial Serial1(PD9, PD8);

char printBuffer[128];
SPIFlash flash(PA4);  
      
void setup() {
  Serial1.begin(115200);
  Serial1.println("####\nStart setup!" );
  delay(50);
  flash.begin(MB(32));
  Serial1.println("End setup!\n####");
}

void loop() {
    Serial1.println(F("----------------------------------------------------------------------------------------------------------------------------------"));
    Serial1.println("Get JEDEC ID");
    uint8_t b1, b2, b3;
    uint32_t JEDEC = flash.getJEDECID();
    //uint16_t ManID = flash.getManID();
    b1 = (JEDEC >> 16);
    b2 = (JEDEC >> 8);
    b3 = (JEDEC >> 0);
    clearprintBuffer();
    sprintf(printBuffer, "Manufacturer ID: %02xh\nMemory Type: %02xh\nCapacity: %02xh", b1, b2, b3);
    Serial1.println(printBuffer);
    clearprintBuffer();
    sprintf(printBuffer, "JEDEC ID: %04xh", JEDEC);
    Serial1.println(printBuffer);
    Serial1.println(F("----------------------------------------------------------------------------------------------------------------------------------")); 
    delay(5000);
}

void clearprintBuffer()
{
  for (uint8_t i = 0; i < 128; i++) {
    printBuffer[i] = 0;
  }
}

Why do I always get that strange string "feh" and "fefefeh"?