Fail to write data form nrf52840 to nor flash w25q128jv

i am writing data from wav file to w25q128jv and i got error -22 at some offset while writing. i tried many config but it seems the problem is not solved, does anyone have any idea for my case, thank you very much

overlay :

config in code : 

write func :

and I tried logging the offset of the error, and I realized it can change according to the config but it seems like before the write was completely normal for the first 1.4mb

this error randomly appears continuously while I write the file. Everyone's opinion is useful to me at the moment.

Parents
  • Hello Hakon, 

    this is my source : l5_ex1.zip

    sorry for this mess. i have some new clues, it seems i can only operate on the first 2mb of nor flash, my attempts to erase or mount are only allowed on the address areas of the first 2mb, i have read and written successfully on this 2mb before but at that time i was partitioning 16mb and i thought there was fragmentation in nor flash. now i partitioned 2mb and reading and writing on it seems fine no more -22 error, i am not sure this is the cause but if it is the cause is there any way i can have full access to the 16mb memory area of ​​w25q128jv. below is the datasheet of w25q128jv and i see "Memory Protection" in it. 

Reply
  • Hello Hakon, 

    this is my source : l5_ex1.zip

    sorry for this mess. i have some new clues, it seems i can only operate on the first 2mb of nor flash, my attempts to erase or mount are only allowed on the address areas of the first 2mb, i have read and written successfully on this 2mb before but at that time i was partitioning 16mb and i thought there was fragmentation in nor flash. now i partitioned 2mb and reading and writing on it seems fine no more -22 error, i am not sure this is the cause but if it is the cause is there any way i can have full access to the 16mb memory area of ​​w25q128jv. below is the datasheet of w25q128jv and i see "Memory Protection" in it. 

Children
No Data
Related