Hello,
I want to have a separate memory region in NAND to store copies of critical data using the file system. I do not want to store the copies in the same memory region in case that the memory corruption occurs.
I am thinking about making the first partition smaller and using the rest of space for the second partition, so I changed the function BLConfigureFlashPartitions() in flash.c of SD EBOOT from
hPartition = BP_OpenPartition((DWORD)NEXT_FREE_LOC, (DWORD)USE_REMAINING_SPACE, PART_DOS32, FALSE, PART_CREATE_NEW);
if (hPartition == INVALID_HANDLE_VALUE)
{
OALLog(L"Error creating file partition 1!!\r\n");
goto cleanUp;
}
to
hPartition = BP_OpenPartition((DWORD)NEXT_FREE_LOC, (DWORD)0x02800000, PART_DOS32, FALSE, PART_CREATE_NEW); // Partition #1 = 40 MB
if (hPartition == INVALID_HANDLE_VALUE)
{
OALLog(L"Error creating file partition 1!!\r\n");
goto cleanUp;
}
hPartition = BP_OpenPartition((DWORD)NEXT_FREE_LOC, (DWORD)USE_REMAINING_SPACE, PART_DOS32, FALSE, PART_CREATE_NEW);
if (hPartition == INVALID_HANDLE_VALUE)
{
OALLog(L"Error creating file partition 2!!\r\n");
goto cleanUp;
}
The first partition is created successfully but not the second. Can you tell me why it fails to create the second partion? Is it possible to create a second partition in the bootloader? Is this the right thing to do for my purpose?
I appreciate your help and guidance.
Thanks,
Luan