Other Parts Discussed in Thread: HALCOGEN, RM48L952
Processor: RM48L952ZWT
1. When specifying a block number, are block numbers zero (0) or one (1) based?
2. In the Halcogen example_TI_Fee_Write_Read.c, the example at the end after writing and reading a block, calls
TI_Fee_InvalidateBlock(BlockNumber);
and then
to format bank 7.
a) Does InvalidateBlock() function the same way as erasing a flash, namely set all bits to one (1) and then the write function sets appropriate bits to a zero?
b) I understand the concept of formatting, such as formatting a disk to whatever format (NTFS, XFS, etc) before use, but why is that function at the end?
c) How do banks differ from blocks?
d) Why does TI_Fee_Format format bank 7, as opposed to bank 5 or 50 or 3 or whatever?
e) How many banks are there? Are there so many banks per block or blocks per bank?
3) I am trying to test EEPROM in my code (not the example, but my code) using my board, not the HDK. I do call TI_Fee_Init() prior to initiating the tests. I do a write operation and then do a read operation. The problem is that I get 0x00000000 back for the first cell in block zero, when I am expecting 0xFFFFFFFF, as that is what I wrote.
boolean doEepromTestWrite()
{
uint32 uSize = 32;
uint32 *lpdwBlock = (uint32 *)malloc(uSize);
if ((uint32 *)NULL == lpdwBlock)
return FALSE;
uint32 uData = 0xFFFFFFFF;
uint32 uIndex = 0;
uint32 uWords = uSize / 4;
uint32 *lpuIndex = lpdwBlock;
for (uIndex = 0; uIndex < uWords; uIndex++)
{
*lpuIndex = uData;
uData--;
lpuIndex++;
}
TI_Fee_WriteSync(uBlock, (uint8*)lpdwBlock);
free(lpdwBlock);
return TRUE;
}
boolean doEepromTestRead()
{
uint32 uSize = 32;
uint8 uBlock = 1;
uint32 *lpdwBlock = (uint32 *)malloc(uSize);
if ((uint32 *)NULL == lpdwBlock)
return FALSE;
TI_Fee_Read(uBlock, 0, (uint8*)lpdwBlock, uSize);
uint16 Status;
do
{
TI_Fee_MainFunction();
delay();
Status = TI_Fee_GetStatus(0);
} while (IDLE != Status);
uint32 uData = 0xFFFFFFFF;
uint32 uIndex = 0;
uint32 uWords = uSize / 4;
uint32 *lpuIndex = lpdwBlock;
for (uIndex = 0; uIndex < uWords; uIndex++)
{
if (uData != *lpuIndex)
return FALSE;
uData--;
lpuIndex++;
}
free(lpdwBlock);
return TRUE;
}
Here is the test code that I created, less the display statements. I originally started with uBlock = 0, but then saw the example use one (1), so I set uBlock = 1 instead. Still, I read zeros back. I also did not incorporate the TI_Fee_InvalidateBlock() and TI_Fee_Format() calls, as I am not sure when to use them and what specifically they do
af



