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

Compilation error on NRF52840 #207

Open jkano opened 4 years ago

jkano commented 4 years ago
Any bug report / feature request raised here MUST be submitted according to the respective templates or they will be flagged with 'Not enough information'. No action will be taken till all the prerequisite information (according to the right template) is provided. If no information is provided for over a month after the 'Not enough information' label is applied, the issue will be closed.
For support questions (for example, tutorials on how to use the library), please use the Arduino Forums. This repository's issues are reserved for feature requests and bug reports.

Hi, I was testing your library on the NRF52840 Feather and I got one compilation error:

D:\Documents\Arduino\libraries\SPIMemory\src/SPIMemory.h:114:12: fatal error: util/delay.h: No such file or directory
   #include <util/delay.h>
            ^~~~~~~~~~~~~~
compilation terminated.

This is the code that is giving that error:

#ifndef ARCH_STM32
  #if defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32L0) || defined(__STM32F1__) || defined(STM32F1) || defined(STM32F3) || defined(STM32F4) || defined(STM32F0xx)
    #define ARCH_STM32
  #endif
#endif
#if defined (ARDUINO_ARCH_SAM) || defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_ESP8266) || defined (SIMBLEE) || defined (ARDUINO_ARCH_ESP32) || defined (BOARD_RTL8195A) || defined(ARCH_STM32) || defined(ESP32) || defined(NRF52)
// RTL8195A included - @boseji <salearj@hotmail.com> 02.03.17
  #define _delay_us(us) delayMicroseconds(us)
#else
  #include <util/delay.h>
#endif

This is because the NRF52 Core for new chips it doesn't have that NRF52 macro defined, instead it has now the macro NRF52_SERIES so basically by adding || defined(NRF52_SERIES) it will compile for all new devices.

Hope this helps anyone getting this error.


DO NOT DELETE OR EDIT anything below this

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.

Note 2: For support questions (for example, tutorials on how to use the library), please use the Arduino Forums. This repository's issues are reserved for feature requests and bug reports.


GitHub issue state GitHub issue title GitHub issue author GitHub issue label GitHub issue comments GitHub issue age GitHub issue last update

TheSecondEmperor commented 3 years ago

Out of curiosity, did you use this library to read/write to an external flash chip?