Reading a flash ROM chip (M45PE20) through SPI with an ATMEGA 2560

Hello all! I'm trying to communicate through SPI to a Flash ROM chip (M45PE20) with an ATMEGA 2560. I'm looking to read the data off the chip, but the output I'm getting is nothing but FF's. I've checked my wiring and everything looks okay on that end, I also don't have a scope to probe the output unfortunately.

I've the crude code below:

#include<SPI.h>  
void setup() {
  Serial.begin(9600);    
  pinMode(SS, OUTPUT);
  digitalWrite(SS, HIGH);  
  SPI.begin();  
}

void loop() {
  Serial.println("Starting");
  Serial.println("Waiting 1s");
  delay(1000);
  SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0));

  digitalWrite(SS,LOW);
  Serial.println(SPI.transfer(0x03));
  Serial.println(SPI.transfer(0x00)); 
  Serial.println(SPI.transfer(0x00));
  Serial.println(SPI.transfer(0x00));
  for(int i = 0; i<16384; i++){  
    Serial.print(i*32, HEX);
    Serial.print(" ");
    for(int j = 0; j<32; j++){
      Serial.print(SPI.transfer(0xFF), HEX);
      Serial.print(" ");
    }
    Serial.println();
  }
  
  Serial.println();
  digitalWrite(SS,HIGH);
  delay(500);
  SPI.endTransaction();
  delay(5000);
}

Link to datasheet: datasheet.pdf - Google Drive

your code looks OK from what you shared.

Why not try something more basic to see if you get any sensible output back, like READ IDENTIFICATION for example. you could try using something like this maybe:

(compiles, NOT tested!)

#include<SPI.h>
void setup() {
  //initialise Serial port
  Serial.begin(9600);

  //Initialise SPI
  pinMode(SS, OUTPUT);
  digitalWrite(SS, HIGH);
  SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0)); //4MHz clk, SPI MODE 0 (CPOL = 0, CPHA = 0)

  //READ IDENTIFICATION
  Serial.println("Waiting 1s");
  delay(1000);
  Serial.println("Requesting identification...");

  digitalWrite(SS, LOW);
  Serial.println(SPI.transfer(0x9F));

  Serial.println("Reading reply:");
  Serial.print("ManufacturerIdentification: ");
  Serial.println(SPI.transfer(0xFF));
  Serial.print("Memory Type: ");
  Serial.println(SPI.transfer(0xFF));
  Serial.print("Memory Capacity: ");
  Serial.println(SPI.transfer(0xFF));
  Serial.print("UID(CFD length): ");
  Serial.println(SPI.transfer(0xFF));
  Serial.print("UID(CFD Content): ");
  for (int i = 0; i < 16; i++) {
    Serial.println(SPI.transfer(0xFF));
  }

  digitalWrite(SS, HIGH);

}

void loop() {

}

hope that helps....