.getsector Method

Function:

Reads the entire 264 bytes from the specified sector into the currently selected RAM buffer of the flash memory (selection is made through the fd.buffernum property).

Syntax:

fd.getsector(num as word) as pl_fd_status_codes

Returns:

One of the following pl_fd_status_codes, also affects the state of fd.laststatus:

0 — PL_FD_STATUS_OK: Completed successfully.

1 — PL_FD_STATUS_FAIL : Physical flash memory failure (fatal).

16 — PL_FD_STATUS_FLASH_NOT_DETECTED: Flash IC wasn't detected during boot, fd. object cannot operate normally.

See Also:

Direct Sector Access, File-Based and Direct Sector Access Coexistence, fd.buffernum, fd.getbuffer, fd.setbuffer, fd.setsector, fd.checksum, fd.copyfirmware, fd.copyfirmwarelzo


Part

Description

num

Logical number of the sector to read from (logical numbers are in reverse: reading from the logical sector 0 actually means reading from the last physical sector of the flash IC).


Details

All file-based operations of the flash disk also load data into the RAM buffers. Switch to the RAM buffer #0 each time before performing direct sector access with this or other related methods — this will guarantee that you won't corrupt the files and/or the file system and cause disk dismounting (fd.ready becoming 0 — NO).

This method always accesses the actual specified target sector and not its cached copy even if a disk transaction is in progress (fd.transactionstarted = 1 — YES) and the target sector has been cached already.


.getsector Method

Details