This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LP-AM243: Issue in writing Flash memory

Part Number: LP-AM243

Hi,

I'm trying to write the Flash memory in the same page sequentially, flash write operation is getting failed.

kindly suggest the sequence for writing in flash in the same page address sequentially.

Thanks in advance

  • I've following queries,

    1. if we are configuring flash in uniform configuration(256KB sector size) then how is Flash_eraseSector function is working in ospi_flash_io_am243x-lp_r5fss0-0_nortos_ti-arm-clang example code ?
    2. What are the steps for writing to the same page in the flash multiple times sequentially? do you have any example code for the same?
    3. if the flash page is 256 Bytes, is it possible to write a data which is less than 256 Bytes ?
  • Hi Kathiravan,

    if we are configuring flash in uniform configuration(256KB sector size) then how is Flash_eraseSector function is working in ospi_flash_io_am243x-lp_r5fss0-0_nortos_ti-arm-clang example code ?

    I have discussed internally, and this seems like an issue. So I will raise a bug for the same.

    if the flash page is 256 Bytes, is it possible to write a data which is less than 256 Bytes ?

    Writing to a page only works if the offset is page aligned. Hence you cannot write same page multiple times.

    What are the steps for writing to the same page in the flash multiple times sequentially? do you have any example code for the same?

    Because of the second answer, this is not possible to run the flash write on same page multiple times as the offset has to be empty as well as page aligned.

    Best Regards,
    Aakash

  • Hi Aakash,

    Thank for response

    Is it possible to erase only the particular bytes in the flash page ?

    1 block(256KB) contains 1024 pages(256Bytes) in that, is it possible to delete only particular pages?

    I can see that Erase is done for full 256KB block in flash uniform configuration.

  • Hi ,

    So Erase is done at Sector, Block or Chip Level. If the flash supports Sectors i.e. 4KB then you can erase a minimum of 4KB. If not, then block has to be erased for 256KB.

    In chip erase, everything in flash gets erased.

    Best Regards,
    Aakash

  • Hi Aakash,

    "Writing to a page only works if the offset is page aligned. Hence you cannot write same page multiple times."

    Is this a driver limitation or Flash device limitation? The data sheet of flash says that data can be written to the same page in subsequent writing, starting from a new address within the same page.

     .

    Regards,

    Hari

  • Hi Hari,

    In that case, let me check this internally. I will try this on my end as well.

    Best Regards,
    Aakash

  • Hi Hari,

    I tried this internally and the change does not look very straight forward. I need a week's more time to get this checked internally.

    Best Regards,
    Aakash

  • HI Aakash,

    Thank you for the update.

    Could you please share an example code as well when it is done at your end?

    Regards,

    Hari

  • Hi Aakash,

    Can you please update on this issue ASAP.

    Thank You

  • Hi Kathir

    Currently writes are always done page by page. Workaround will be to remove the alignment check in the flash write function. Then you can write to middle of the page. But if you want to handle the case where the write exceeds a page boundary then it’s not straightforward. You can remove the check, and maybe write a wrapper on top of the flash write which makes sure that if the write is crossing a page boundary, then it is handled as two writes. Like find out how many unaligned writes are there and handle them separately. One example is OSPI_readDirect which has a similar logic implementation.

    Once you make the change you need to rebuild the drivers lib and then use that api to do flash write in your application.