435
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
This approach was chosen to minimize the influence of the changing size of your
Tibbo Basic application on the data you keep in the flash memory. Typically, the
size of your application keeps changing as you develop and debug it. At the same
time, you often need to keep certain data in the data area permanently, and don't
want to recreate this data every time you load new iteration of your application. If
the beginning of the data area was right after the end of the firmware/application
area, any change in the application size would move the boundary of the data
area, corrupt your data, and force you to recreate the data again. If, on the other
hand, your data area starts from the top of the flash IC and continues downwards,
then the chance of the data area corruption will be a lot smaller.
When debugging your application, use only a portion of the data area
and leave some of the data area unoccupied. This will create a gap of
unused sectors between the data and the firmware/application areas of
the flash. This way, your application will (mostly) be able to grow
without corrupting the data area.
Fd. Object's Status Codes
Many things can go wrong when working with the flash memory. This is why most
methods of the fd. object return a status code. Good Tibbo Basic application
doesn't just assume that all will be well and always checks the status of method
execution.
Listed below are possible status codes retuned by fd. object methods. Of course,
not every code can be generated by every method:
0- PL_FD_STATUS_OK: Completed successfully.
1- PL_FD_STATUS_FAIL : Physical flash memory failure (fatal).
2- PL_FD_STATUS_CHECKSUM_ERR: Checksum error has been detected in one of
the disk sectors (fatal).
3- PL_FD_STATUS_FORMAT_ERR: Disk formatting error has been detected (fatal).
4- PL_FD_STATUS_INV_PARAM: Invalid argument have been provided for the
invoked method.
5- PL_FD_STATUS_DUPLICATE_NAME: File with this name already exists.
6- PL_FD_STATUS_FILE_TABLE_FULL: Maximum number of files that can be stored
on the disk has been reached, new file cannot be created.
7- PL_FD_STATUS_DATA_FULL: The disk is full, new data cannot be added.
8- PL_FD_STATUS_NOT_READY: The disk is not mounted.
9- PL_FD_STATUS_NOT_FOUND: File not found.
10- PL_FD_STATUS_NOT_OPENED: No file is currently opened "on" the current
value of the
property.
11- PL_FD_STATUS_ALREADY_OPENED: This file is already opened on some other
463