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.

TMS320C6746: Rom Bootloader failed to load User bootloader

Part Number: TMS320C6746

Hi,

We are using device C6746, connected to a NAND flash memory MT29F4G16ABADA

We found out 2 problems regarding the UBL:

 The UBL doesn't start runnig (no printing).

we compered the memory flash with functioning board

1.

In 2 boards the UBL secsion in flash was different in 1 bit (0 instead of 1) what caused failure in flash reading

After burning the flash again the unit worked.

2.

In one board the flash memory is identical

but the DDR text section is different (25% of the code is identical and the rest is different)

We don't want to burn that one again before invesigate the issue

All boards worked properly before sending to customer

We generate the UBL using AISGen application with following defintions:

CS3 Setup: 0x041020BD

PLL0-> CPU: 456.00

All other defintions are defaul values

For the application we use out2rprc application

We have to types of flash memory, one with pages in size of 2048 bytes and one in size of 4096

The problems were in those with page size of 4096

Do you have any idea what can cause those problems?

  • GK,

    thanks for providing details of the issue that you are facing on the custom board. Can you also please clarify how you are programming the data to NAND and if you are using Block0 or block 1 for booting from NAND? If it is a single bit error in the data stored on NAND page, we expect that to be corrected during boot using the ECC mechanism. In addition to page data, can you also confirm that the ECC data on the NAND is correctly generated.

    If the boards, were all working properly when you shipped to customer and have now been reported to be failing in field, I would recommend that you look at the device errata Advisory 2.3.24 to see if you have applied the patch referred to in the errata.

    http://www.ti.com/lit/er/sprz304h/sprz304h.pdf

    Regards,

    Rahul

  • Hi Rahul,

    Hello I work with gili (gk) on this project.

    for programming we are using code composer runing nandwriter code. the nandwriter receive as an input an AIS file that is generated by AisGen tool revision 1.9. 

    As specified in spraat2f 6.4 the nand is written from block 1 .

    who can we confirm that the ECC data on NAND is correctly generate?

    If we use recomondation in errata 2.3.24, we need to generate ais using aisGen 1.13 , how we use the patch?

    If the patch code is in memory location 0x11800000 we need to make sure this location is not in use by UBL

    Thanks

    Ilan

  • Hi Rahul,

    Thank you for helpful reply!

    In additional to generate the bootloader from aisGen 1.13

    we try to understand the issue with the last board that the flash memory is identical to functioning board

    We right code that working as RBL, reading the flash memory with ecc data, configure registers according to commands in ais,

    copy section data to DDR and execute the program- that's working!

    We compared the ROM memory, is also identical

    We replaced the flash HW in a new one and the RBL still failed to load the bootloader

    Do you have any idea why the loading failed from the original RBL? 

    Thank you,

    GK

  • Hi Rahul,

    I have to know if the code in bootloader from "C6748_StarterWare_1_20_04_01\nandlib" includes the correction as function in the patch of ecc nand what we found in "sillicon errata " documents.

    If not how can we correct the bug in our bootloader? can we get the source code of the patch to replace the wrong function?

    Thank you,

    Gili

  • No, run time NAND driver and libraries in starterware don`t have the fix for that errata NAND boot issue as far as I know.  I can provide the source to the patch that applies to the ROM but this will need to be applied to nandlib (EMIFAHammingCodeECCCheckAndCorrect)

    The patch source for the AISGen tool was not shared as part of the AISGen release since the code fix applies to ROM ECC handling function. We don`t share the ROM source for this device so the patch wouldn`t make sense since the original function in ROM was not available to users. 

    If it helps, I have extracted the original PG 2.1 NAND Ecc function and the applied patch that replaces that function for you to compare so you can apply the fix to NANDlib. Device_nand.c is the NAND driver with the ECC handling function, nand_ecc_rom_org is the function as implemented in original ROM and nand_ecc_rom_fix is the file with the updated ECC handling function that handles the ECC error in spare area correctly.

    nand_boot_patch.zip

    Regards,

    Rahul

  • Hi Rahul

    we replace the nand_ecc_rom_org by the fixed function nand_ecc_rom_fix. 

    We burn several unit and left them in test (power up and down every several seconds) after several on and off loop (~500) one of the unit didnt work. when I check it with debugger

    there are some times that the reading pass without any ECC error and some times that the reading has 1 bit error but s not fixed.

    the code lines

    // Start calcuating the correction addresses and values
    AEMIF->NANDFCR |= (0x1U << 13);

    // Loop until timeout or the ECC calculations are complete (bit 11:10 == 00b)
    i = 1000;
    do
    {
    temp = (AEMIF->NANDFSR & 0x00000F00)>>10;
    i--;
    }
    while((i>0) && (temp != 0x0));

    // Read final correction state (should be 0x0, 0x1, 0x2, or 0x3)
    corrState = (AEMIF->NANDFSR & 0x00000F00) >> 8;

    after putting breackpoint we found out that i=999, temp=0, and corrState=5

    in the old code there is a loop cycle for reading corrState and this problem do not accure.

    it seems that maybe a delay between start calculation and the first reading is needed maybe - after adding 

    temp = (AEMIF->NANDFSR & 0x00000F00)>>10;

    before the loop fix it and the reading of corrState return 3 (the ecc was compleated)

    Is it correct to add this delay (maybe the status is not update immediately after ecc enable (AEMIF->NANDFCR |= (0x1U << 13); so we need to let the dsp to update the status to a value diffrent from 0 before start testing it?

    How can it be that in debug mode some times we get no error in ecc and some times 1 bit error (for the same data). I am expecting to receive all the time the same result from the ecc test? 

    This issue is in very high priority in our company as we need to supply the unit to the costumer as soon as possible

    Best Regards

    Ilan

  • Hi Rahul

    Regarding the problem of no delay in the new patch code, I looked at the c6746 reference manual doc spruh80c,

    You can see that in paragraph 8.2.5.6.6.2 page 829 for read in step 10 after enabling 4BITECC_ADD_CALC_START there need to be a dummy read before reading the ecc state.

    In the patch code this reading do not exist and so when an error occurred the code do not fix the error.

    after that we add a dummy read the code run correctly.

    We need to know is this is the exact code that is in the patch, if so problem may occurred when the rom bootloader will use this function 

    Thanks

    Ilan

  • Ilan,

    Sorry for the delay in getting back to you on this issue. Agree based on TRM that there needs to be a dummy read before reading ECC state. Please note that the ROM runs the device and EMIF at slower speed for reliability. The NAND ECC patch that has been provided here was tested across multiple silicon samples with different NAND flash parts and is known to fix the issue. It has been implemented in production software by multiple customers on this device. Also note that the code is a patch to the ROM ECC correct function to overcome the ECC handling of the spare area so it can be over ridden. 

    Can you please indicate the speed at which the DSP and the EMIF is running in your use case. I suspect that the dummy read  may be critical when the device is running at higher speeds where there is not enough wait time before the ECC state is updated. It appears that the issue you are running into is observed at run time when the patch is applied to the NAND driver and not during boot from ROM. Can you confirm ?

    Regards,

    Rahul

  • Hello Rahul

    The DSP is running at speed of 456MHz . The EMIF on CS3 is configured with 0x041020BD. 

    You are right, the issue we were facing was during loading the application by user bootloader (using nand driver with fixed function) after adding the dummy read it seems to be OK (this was check with a nand that has 1bit error). 

    But as I understand the ROM bootloader read the AIS file from NAND and configure DSP registers as defined in the AIS, and then load the data (user bootloader) from nand to ram and run it. so its mean that the rom bootloader will load the user bootloader after DSP is running at full speed. if this is the case the problem may happens when the rom bootloader try to load the user bootloader.

    If the rom bootloader configure the registers after loading the data from NAND, then slower speed may be OK. 

    Can you confirm that the rom bootloader do not need this dummy read and if a NAND 1-4 bit error occurred in the user bootloader address space the rom bootloader will fix it correctly?

    Thanks 

    Ilan 

     

     

  • Ilan,

    I reviewed the ROM validation with the NAND ECC patch and have found that all of the ROM validation for the NAND boot was done with the DSP configured to run at 300 MHz and not the 456 MHz setting. At these speeds, the ROM will read the initial image and has been test validated to confirm that 1 bit to 4 bit ECC errors in NAND page and spare regions is handled correctly. 

    If you think that this is a risk with the 456 Mhz settings that you are using, we have two options to address the issue:

    Option1 (Preferred): Do a reliable boot with DSP at 300 MHz and then change the device PLL to 456 post ROM boot.

    Option2: Update the NAND ECC correct patch source with the dummy read and install in the AISGen patch_binaries folder so the updated patch applies during boot image creation. 

    Let me know based on your evaluation which approach you wish to use.

    Regards,

    Rahul