Bean based flash erase and events

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bean based flash erase and events

1,331 Views
bob_s
Contributor III
I'm running CW 8.1.1a. developing for a 56F8323.

I have enabled events, (NV_RAM_EnableEvent():smileywink:  and I am trying to do a sector erase (err = NV_RAM_EraseSector(NVRAM_ADDR + (i * DATA_FLASH_SECTOR_SIZE)):smileywink:

Would I expect an "OnWriteEnd" event at the end of that erase or is the return an indication it is finish?  If not, what gives me the finished go-ahead to use an erased sector?

Thanks,
Bob
Labels (1)
Tags (1)
0 Kudos
1 Reply

290 Views
ProcessorExpert
Senior Contributor III
The description of the methods and events including typical usage can be found in the help (pop-up menu) of the IntFlash bean. The OnWriteEnd event is not called within EraseSector method. The EraseSector method waits to erase command complete. You are informed about the result of the EraseSector method through the return value of this method.

In the documentation of the bean you could find (page Methods):

EraseSector - Erases the sector to which address Addr belongs.
 
    ANSIC prototype: byte EraseSector(BeanName_TAddress Addr)

    Addr:BeanName_TAddress - Address in FLASH.

      Version specific information for 56800 derivatives
      The value of this parameter is address of a 16 bit word location in the selected memory space.
      The memory space depends on the selected flash memory device.

    Return value:byte - Error code, possible codes:
          o ERR_OK - OK
          o ERR_NOTAVAIL - Desired program/erase operation is not available
          o ERR_RANGE - Address is out of range
          o ERR_SPEED - This device does not work in the active speed mode
          o ERR_BUSY - Device is busy
          o ERR_PROTECT - Flash is write protect
          o ERR_VALUE - Flash sector erase was not successful


0 Kudos