Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino MKR MEM Shield - Wrong JEDEC ID - Used to work #79

Closed
sambartle opened this issue May 10, 2021 · 10 comments
Closed

Arduino MKR MEM Shield - Wrong JEDEC ID - Used to work #79

sambartle opened this issue May 10, 2021 · 10 comments

Comments

@sambartle
Copy link

sambartle commented May 10, 2021

Description

Until recently this code worked fine to access the Winbond 25Q16JVIQ Flash chip on the MKR MEM Shield. (This code is recommended by Arduino as the example code for this chip)
It appears that changes (Perhaps somewhere external as the recent changes here dont look like they could cause this issue) have now broken this code as it cannot communicate with this chip anymore.
The JEDEC ID Returned is incorrect and the chip does not work.
I can reproduce this on 5 different sets of new MKR GSM1400 and MKR MEM Shields, and have redownloaded a clean Arduino IDE (run in portable mode for isolation) and new library download.

Steps To Reproduce Problem

Download Arduino IDE.
Connect MKR MEM Shield to Arduino MKR GSM 1400.
Install MKR Board and this library from library manager (or github result is same)
If necessary run EraseEverything example to erase flash. (change CS from 6 to 5)
Open Example: RawHardWareTest.ino
Change FlashChipSelect from 6 to 5 (for the MKR MEM Shield)
Flash code and observer serial monitor.

Hardware & Software

Board: Arduino MKR GSM 1400
Shields / modules used: Arduino MKR MEM Shield
Arduino IDE version: 1.8.13
Version info & package name: Arduino SAMD Boards (1.8.11)
Operating system & version: Windows 10 Pro 20H1

Arduino Sketch

The included RawHardwareTest.ino with only 1 change..

const int FlashChipSelect = 5; // digital pin for flash chip CS pin

Errors or Incorrect Output

Raw SerialFlash Hardware Test

Read Chip Identification:
JEDEC ID: F7 20 A
Part Number: (unknown chip)
Memory Size: 1048576 bytes
Block Size: 65536 bytes

Reading Chip...

Writing 512 signatures
error writing signature at 0
Read this: 00 00 00 00 0A FA CA 25
Expected: 00 00 00 00 15 F5 95 4B

Tests Failed :{

The flash chip may be left in an improper state.
You might need to power cycle to return to normal.

As you can see the JEDEC ID is Incorrect and the test fails.

@sambartle
Copy link
Author

sambartle commented May 11, 2021

Further investigation..

This is caused by a change in the SAMD core in arduino.. v1.8.10 and 1.8.9 work fine, but the latest 1.8.11 causes this error.

The following commit causes the issue: arduino/ArduinoCore-samd@738a0e9

@etix
Copy link

etix commented Jun 2, 2021

This is caused by a change in the SAMD core in arduino.. v1.8.10 and 1.8.9 work fine, but the latest 1.8.11 causes this error.

Confirmed, 1.8.10 works fine, 1.8.11 does not.
Tested on Mini Ultra Pro v3 (ATSAMD21G18A-AU).

sambartle referenced this issue in arduino/ArduinoCore-samd Jun 3, 2021
Fixes #576

From https://ww1.microchip.com/downloads/en/DeviceDoc/SAM_D21_DA1_Family_DataSheet_DS40001882F.pdf , Table 25-2

Syncronous mode (the one we are using) condition is fBAUD <= fref/2 .

Since fref can be as high as F_CPU (48MHz) let's limit the possible fBAUD to F_CPU/2 .
@PaulStoffregen
Copy link
Owner

Does this SAMD issue solve the problem?
arduino/ArduinoCore-samd#622

Should I close this issue, or leave it open?

@sambartle
Copy link
Author

I haven't been able to test the changes as the signature file is missing in that issue, however if I make the changes manually it does fix the issue.

So I am certain it will and this can be closed.

@sambartle
Copy link
Author

Will be resolved in Arduino core. No issue here.

@stefat
Copy link

stefat commented Jul 7, 2021

Hi all, I am a newbie with and MKR1010 + MKR MEM. I became crazy for your this same issue. At least I now know you've found the cause. I then tried to install 1.8.10 in my Mac (already running 1.8.15 IDE) trying to fix the speed issue with the SPI but the older IDE does not run. Any clue ? How can I run the older 1.8.10 in my Mac ? Or.. how can I fix this issue ? Thank you to anybody spending some time to help.

@PaulStoffregen
Copy link
Owner

Best to ask for help on the Arduino forum.

@stefat
Copy link

stefat commented Jul 7, 2021

ok thanks

@stefat
Copy link

stefat commented Jul 7, 2021

BTW: I've just done this
....
bool ret = SerialFlash.begin(chipSelect);
SPI.setClockDivider(SPI_CLOCK_DIV64);
....
and it now works.

@sdrshnptl
Copy link

SPI.setClockDivider(SPI_CLOCK_DIV64);

This solve my problem on ESP32 with salvaged W25Q80 FLASH
testing further!
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants