This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

External SPI flash read skipping one byte every two

Thanks for your support folks!

I am trying to read some bytes I have wrote in a MX25R8035F.  From the datasheet, if you send 0x03 (READ) + 3 Byte address, then the memory starts sending data, and increasing address automatically, so you can dump the entire memory with only one command. 

However, nRF52832 is reading only two bytes, then skipping one. 

Logic analyzer shows that memory is giving the correct data, but Nordic is skipping one byte for every two. Any help is welcome.

Parents
  • Hello,

    I can't see any obvious errors from the snippets that you have sent.

    I can't see anything wrong in your read_data() function. It seems to run through fluently.

    However, I don't know what's going on inside MX25_READ(...);

    Could you please give the functions that you didn't describe, such as IsFlash4Byte() (what does it return), CS_Low(), CS_High(), SPI_TRANSFER(), SendFlashAddr(),SPI_READ, and what value does byte_length have?

     

    If the case is actually that the application can't handle the SPI fast enough, can you try to read more than one byte at the time?

    SPI_READ(0xFFFF, 2);

     

    Best regards,

    Edvin

Reply
  • Hello,

    I can't see any obvious errors from the snippets that you have sent.

    I can't see anything wrong in your read_data() function. It seems to run through fluently.

    However, I don't know what's going on inside MX25_READ(...);

    Could you please give the functions that you didn't describe, such as IsFlash4Byte() (what does it return), CS_Low(), CS_High(), SPI_TRANSFER(), SendFlashAddr(),SPI_READ, and what value does byte_length have?

     

    If the case is actually that the application can't handle the SPI fast enough, can you try to read more than one byte at the time?

    SPI_READ(0xFFFF, 2);

     

    Best regards,

    Edvin

Children
No Data
Related