Problem converting BMP into correct OLED image. (SOLVED)

I can confirm that the faulty data is being sent over the SPI bus (tested with logic analyzer), so I don't think the display is at fault. I'm directly comparing the first bytes of the image array with the first bytes being sent to the display after the proper commands (also verified).

Here is the current image:

As it shows up:

First bit of the image array:

FLASH_ARRAY(unsigned char, test,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0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FF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
....

And part of the SPI data stream:


The first bytes on the left are the row and column address commands being sent, followed by a command to enable writing to the RAM. Between the markers are roughly 280 bytes, corresponding to about 565 pixels (just over 2 rows). The first couple dozen bytes of 0xFF followed by a couple hundred bytes of 0x00 matches exactly what is seen on the screen. So the display itself seems to be working as it should, but the data being sent is faulty. If you look at the array, you see it is all 0xFF for a good while at the start.

After this I am confident that something is going on inside the Arduino that I am not understanding.

What is that screen shot proving? I see some zeroes in your data, and zeroes in the logic analyzer. Can you narrow down the part you think is wrong?

In the array, the first zero is the 302nd byte, before that is all 0xFF. This corresponds to the 604th pixel, which would be about 35% of the way into the third row - the display is scanned horizontally. If you look at the original image file, that is exactly where the first zero is. So the image array is correct in that regard. I should clarify since it may be hard to see; the first part of the text encountered while scanning the display (horizontally, left to right; vertically, top to bottom) is the top of the 'S.' The uppermost part of the 'S' is on the third row of pixels.

However the display is clearly not showing that, it is showing a short line of 0xFF followed by a bunch of zeros on the first, second, and part of the third row. The SPI stream shows that this is indeed what is being sent to the display. So the display is faithfully displaying the data being sent to it, but the data is incorrect. The data sent SHOULD match the image array exactly, and the image array is correct. So, somewhere between writing the data to the flash memory upon uploading the sketch, and reading the data from the array and sending it over the bus, the data is being corrupted.

To me this is very strange, I see no logical reason from my code why this should happen. Unless the Arduino itself is faulty, or the Flash library I used is faulty (Flash | Arduiniana), I see no logical reason why this should be happening.

Well to comment further I would have to see the code and preferably reproduce it. Can you make a minimal example that compiles, with the problem data, and exhibits the problem? Then I can see whether or not it happens to me, and this rules in or out faulty hardware.

hi
still have
ODTv1.1.11278.zip cause link seems to be broken
thx