AM62A3: NorFlash S28HS512T sector erase failed

Part Number: AM62A3

Tool/software:

hi  TI experts

         Now we use norflash  memory S28HS512T  which is  accessed  through  AM62A3 OSPI  interface  in our  customized board,   if  using   " int32_t Flash_eraseBlk(Flash_Handle handle, uint32_t blockNum) "   function( erase 256k)  , the  used  flash block can be erased  successfully and  user data can be wrote to Nor flash device correctly;

           but if  use  "int32_t Flash_eraseSector(Flash_Handle handle, uint32_t sectorNum) (erase 4K)"   function,  the erase and  write operation  will be failed.

           in fact,  most time we may just  modify  a few bytes data  in one sector;  before erasing flash,  we can copy one sector data into global buffer ,  then modify  some bytes data according to the  data

 position offset in the buffer , finally  write data stored  in buffer to the specified sector area,  there is  no necessary to erase  block area every time ;

        so why  call  the   "Flash_eraseSector()"  function   can`t   erase data  as expected;

  

  • Hello,

    Allow me sometime to check the implementation of erase sector.

    Regards,

    Vaibhav

  • Hello,

    I would request you to loom through the file: flash_nor_ospi.c

    Please see how Flash_norOspiEraseSector is used.

    Please refer the latest AM62A MCU PLUS SDK.
    FYI, I am pointing you to look through this:

    Let me know if this helps.

    Regards,

    Vaibhav

  • hi  Kumar

          The  MCU SDK is  installed in windows  operation system  and its version is  V9.2 ;

          i  aslo try to install  the latest  version  10.0.0.14 of  MCU SDK ;

         but i can`t  find the function  Flash_norOspiEraseSector(...) as you mentioned  above;

        i  can only find   " int32_t Flash_eraseBlk(Flash_Handle handle, uint32_t blockNum)"  and  "int32_t Flash_eraseSector(Flash_Handle            handle, uint32_t sectorNum)"

  • Hello Ming,

    Please look through the file flash_nor_ospi.c in latest SDK, to search for the API named as Flash_norOspiEraseSector()

    Regards,

    Vaibhav

  • hi  Kumar

             i  have replace flash erase   function  with  "Flash_norOspiEraseSector()"  in my project, but the  erase and write  operation is also  failed.

            as the screenshot show  below , the  "gFlashConfig"  parameter is generated by syscfg file in CCS IDE;

  • Hell Ming,

    Can you please tell me about the values that is offset, sector_val and page in your case?

    I can try this on the AM64x TI EVM as it has the NOR flash part which you are using along with AM62A.

    Regards,

    Vaibhav

  • hi  Kumar

               The flash offset is  0xf80000 ,  sector id  is 3968, page id is 0;

  • Hello Ming,

    Based on the above information, you want to just erase 4096 bytes and not a whole block right?

    Regards,

    Vaibhav

  • hi  Kumar

        we  hope   the  best  option  is  that  block erase  and  sector  erase command can both be  useful,  in  most  time ,  maybe  the sector erase  command can meet our  requirement,

    but  in  software  upgrade    scenario, the  block  erase  can be  more effective

  • Hi Vaibhav,

    Cusrtomer want to use both 4K erase, and block erase based on the SW usercase, so pls help support. Thanks for support.

    BR,

    Biao

  • Hello Ming and Bioa,

    Thank you very much for the clarification I needed.

    So as a part of next steps from my end:

    1. I am going to try erasing a block and see if the operation is successful.

    2. I am going to try erasing a sector and see if the operation is successful.

    In either of the cases, if it fails, then I will debug on my TI EVM setup as to where the failure happens.

    You can expect responses from my end in sometime.

    Thanks,

    Vaibhav

  • Hello Ming,

    Can you calculate which offset will sector number 3968 fall into? This way I can see in the memory browser if the erase operation is happening properly or not.

    Is this offset F80000 = 3968 * 4096?

    FYI, erase block works just fine.

    Regards,

    Vaibhav

  • Hello Ming,

    I have tested this on my end and it turns out that the Flash_eraseSector is broken and does not erase the required sector.

    The workaround is to continue using block erase as of now and as a next action step I have raised a JIRA for this.

    A JIRA has been created for erasing sector failure, as it is not successful.

    I will update here on this thread, once a fix has been proposed.

    Thanks for your patience.

    Regards,

    Vaibhav