Marzogh / SPIMemory

Arduino library for Flash Memory Chips (SPI based only). Formerly SPIFlash
http://spimemory.readthedocs.io/en/latest/
GNU General Public License v3.0
430 stars 136 forks source link

Bug report - Compatibility with nRF52840 #225

Open TheSecondEmperor opened 3 years ago

TheSecondEmperor commented 3 years ago
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

Describe the bug

Include a clear and concise description of what the bug is. I am trying to use the flash chip W25Q128JVSIQ to communicate with an Arduino Nano 33 BLE which isn't explicitly supported by this library. However, I added || defined(ARDUINO_ARCH_NRF52840) to line 106 of SPIMemory.h which solved the util.delay.h errors I was getting when compiling the TestFlash.ino sketch which was suggested by the Arduino Forum in this thread. The trouble is that after uploading the sketch the microcontroller fails to communicate with the flash chip indicated by error "2" in the Diagnostics of the serial monitor. I changed some things in the sketch as indicated below to help identify the chip. I also uncommented line 33 the SFDP line in SPIMemory.h which is supported by this chip as described in its datasheet. Chip Select has been set to 1 as I believe TX on the Nano 33 BLE is pin 1. I have tested continuity with all of the pins on the flash.

Check your wiring. Flash chip is non-responsive. If this does not help resolve/clarify this issue, please raise an issue at http://www.github.com/Marzogh/SPIMemory/issues with the details of what your were doing when this error occurred The Flash chip does not support SFDP. Unable to identify chip. Are you sure this chip is supported? If this does not help resolve/clarify this issue, please raise an issue at http://www.github.com/Marzogh/SPIMemory/issues with the details of what your were doing when this error occurred 2

- If you have a problem with a particular function, call the `flash.error()` function (after you have made sure you have started up your Serial port with a ``` Serial.begin(BAUD) ``` ). Provide details of the function, the data given to/ expected from the function and the error code here: (**Please repeat this for every function you have an error with**)
        - Function: (e.g. writeByte())
       -  Data: (e.g. 3.14 or Struct)
        - Error code: (e.g. 0x0A)

#### To Reproduce
Provide a **minimal code snippet** example that reproduces the bug (If you're using one of the examples that came with the library, just tell us which one instead of pasting the entire example's code). Please make sure you wrap any code in the proper code blocks like below

TestFlash.ino, 
line 100 is changed to, 

SPIFlash flash(1);

line 106 has been given this addition,

|| defined(ARDUINO_ARCH_NRF52840)

line 117 was given the addition,

Serial.println(flash.error());



#### Expected behavior
A clear and concise description of what you expected to happen.

I expected the sketch to upload and then print the scripts in the setup as well as the commands. The initialization failed with the "2" error indicating a failure to communicate with the chip. After entering "1" into the command line, I expected the JEDECID to be presented. Instead, the JEDECID was represented as zeroes.

#### Screenshots
If applicable, add screenshots to help explain your problem.
![Screenshot (157)](https://user-images.githubusercontent.com/36765298/125364230-b982de00-e337-11eb-9c5c-905ec697620a.png)

#### Wiring diagram
If applicable, add a wiring diagram to help explain your problem.

#### Software environment (please complete the following information):
 - Library version: [v3.0.1]
 - Arduino IDE version: [1.8.15]
 - OS: [Windows 10]
 - Micro controller platform: [Arduino Nano 33 BLE]
 - Flash/Fram memory module: [IS25LP064A-JBLE]

#### Additional context
Add any other context about the problem here.

<hr>

###### DO NOT DELETE OR EDIT anything below this

<hr>

<sub> <b> Note 1: _Make sure to add **all the information needed to understand the bug** so that someone can help. If any essential information is missing we'll add the 'Needs more information' label and close the issue until there is enough information._ </b></sub>

<sub> <b> Note 2: For support questions (for example, tutorials on how to use the library), please use the [Arduino Forums](http://forum.arduino.cc/index.php?topic=324009.0). This repository's issues are reserved for feature requests and bug reports. </b></sub>

<hr>

![GitHub issue state](https://img.shields.io/github/issues/detail/s/Marzogh/SPIFlash/14.svg) ![GitHub issue title](https://img.shields.io/github/issues/detail/title/Marzogh/SPIFlash/14.svg) ![GitHub issue author](https://img.shields.io/github/issues/detail/u/Marzogh/SPIFlash/14.svg) ![GitHub issue label](https://img.shields.io/github/issues/detail/label/Marzogh/SPIFlash/14.svg) ![GitHub issue comments](https://img.shields.io/github/issues/detail/comments/Marzogh/SPIFlash/14.svg) ![GitHub issue age](https://img.shields.io/github/issues/detail/age/Marzogh/SPIFlash/14.svg) ![GitHub issue last update](https://img.shields.io/github/issues/detail/last-update/Marzogh/SPIFlash/14.svg)