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

writeAnything bug #151

400081 opened this issue Aug 12, 2018 · 3 comments


Copy link

commented Aug 12, 2018

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

---------------------------- DO NOT DELETE OR EDIT anything above this line ----------------------------

Issue details

I'm submitting a ...

  • bug report

Do the checklist before filing an issue:

  • Is this a bug that you cannot fix? Post the bug report as an issue here with a title that cleary says "Bug Report".

When opening an issue please include the following details:

  • Do you want to request a feature or report a bug? - bug

  • Which library version are you using? - 3.2.1

  • Which Arduino IDE version are you compiling the library on? - 1.8.5

  • Which OS are you compiling your code on? [Linux / Mac / Windows] - Windows

  • Which microcontroller platform are you using? - arduino

  • Which Flash memory module are you using? - W25Q16BV

  • What is the current behavior? - writeAnything - Structure of size 12, spans memory boundary is not written

  • Provide a minimal code snippet example that reproduces the bug. Please make sure you wrap any code in the proper code blocks like below

SPIFlash flash;

typedef struct {
  uint32_t a;
  uint32_t b;
  uint32_t c;
} Test;

void setup() {
  uint32_t addr = 250;
  Test data_w;
  Test data_r;
    data_w.a = 1;
    data_w.b = 2;
    data_w.c = 3;
    flash.readAnything(addr, data_r);

void loop() {}   ```

###### ---------------------------- suggestions how to fix  ----------------------------

SPIFlash.h  Insert code in line numbers 315 

         if(_currentAddress % SPI_PAGESIZE==0){//<<<<<<<<<<<<<<<<<
		_nextByte(WRITE, PAGEPROG);
@Marzogh Marzogh self-assigned this Aug 16, 2018
@Marzogh Marzogh added the bug label Aug 16, 2018
@Marzogh Marzogh added this to the v3.3.0 milestone Aug 16, 2018

This comment has been minimized.

Copy link

commented Aug 16, 2018

Thanks for catching this. Page boundary bugs are turning out to be the bane of my existence 😉

I'll roll the fix into the next release.


This comment has been minimized.

Copy link

commented Aug 17, 2018

thank you for your reply
Looking forward to your perfect solution.

jacky4566 added a commit to jacky4566/SPIMemory that referenced this issue Nov 7, 2018
Fix page boundary problem. Bug  Marzogh#151

This comment has been minimized.

Copy link

commented Mar 13, 2019

Hi all, i'm getting failed (Write Function has failed errorcheck) on structTest() with Spansion/Cypress S25FL164K, running on ATSAMD21E18A. Any suggestions for further troubleshooting? Thanks in advance.

Please ignore, it was just a temporary issue. Mentioned flash is working fine.

SPIMemory Library version: 3.2.1

JEDEC ID: 0x14017
Man ID: 0x1
Memory ID: 0x40
Capacity: 8388608
Max Pages: 4294967295

							Testing library code
			Function		Test result			     Runtime
			Power Down		   PASS				      61 us
			Power Up		   PASS				      53 us

			Erase Chip		   PASS				      42.789 s
			Erase 72KB		   PASS				      350.81 ms
			Erase 64KB		   PASS				      327.17 ms
			Erase 32KB		   PASS				      174.81 ms
			Erase 4KB		   PASS				      32.18 ms
			Data type		I/O Result	      Write time	      Read time
			Byte			   PASS			108 us			52 us
			Char			   PASS			128 us			52 us
			Word			   PASS			132 us			52 us
			Short			   PASS			132 us			52 us
			ULong			   PASS			144 us			60 us
			Long			   PASS			148 us			56 us
			Float			   PASS			148 us			56 us
			Struct			   PASS			336 us			104 us
			Byte Array		   PASS			2.56 ms			564 us
			String			   PASS			228 us			76 us

@jacky4566 jacky4566 referenced this issue Apr 17, 2019
4 of 7 tasks complete
Marzogh added a commit that referenced this issue Apr 19, 2019
Update SPIFlash.h
Fixes #151
@Marzogh Marzogh closed this Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.