This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Adding a third partition to NAND from Bootloader

WEC7:  I am trying to create a third partition on my NAND but my approach is not working...my objective is (Part00 40MB, Part01 60MG and Part02 for remaining). I am also not sure on how to implement dwNumSectors. Will appreciate any guidance.

In SRC\Eboot\Sdmemory\flash.c  of BLConfigureFlashPartitions() method

  hPartition = BP_OpenPartition((DWORD)NEXT_FREE_LOC, dwBootPartitionSectorCount, PART_BOOTSECTION, FALSE, PART_CREATE_NEW);
        if (hPartition == INVALID_HANDLE_VALUE)
        {
            OALLog(L"Error creating OS partition!!\r\n");
            goto cleanUp;
        }
        // Create FAT partition of XXMB partition for system files.....(dwNumSectors  ???  must define somewhere)
        hPartition = BP_OpenPartition((DWORD)NEXT_FREE_LOC, (DWORD)0x9FFF, PART_DOS32, FALSE, PART_CREATE_NEW);
        if (hPartition == INVALID_HANDLE_VALUE)
        {
            OALLog(L"Error creating file partition2!!\r\n");
            goto cleanUp;
        }
        //OALLog(L"Flash format complete!\r\n");

  // Create FAT partition on remaining flash (can be automatically mounted)....partition for user data files
        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 partition2!!\r\n");
            goto cleanUp;
        }
        OALLog(L"Flash format complete!\r\n");

  • Please let us know what fails with the changes you described above. Note that "dwBootPartitionSectorCount" is used in many places in the bootloader hence you should actually modify it to your new value instead of hard-code it in one place. Actually even better would be to directly modify the "osPartitionSize" variable which is set under SRC\BOOTLOADER\EBOOT\main.c.]