Tool/software: TI-RTOS
I have problem with NAND bootloader. I'm debugging the bootloader project and the bootloader always stucks in DMTIMER_WAIT_FOR_WRITE macro. The project itself was missing (I guess) from the main function:
/** \brief Global variable to instantiate the timer for providing a delay. */
timeUtilsObj_t freeRunTimer = {7U, TIME_CLOCK_SEL_24MHZ_EXT_CRY_OSC, TRUE, 0U};
/* Initialize the timer to make use of the delay functionality */ TIMEUtilsInit(&freeRunTimer, 0U);
because NAND libraries will use delay function. But then the code hangs in
void DMTIMERSetCounterVal(uint32_t baseAddr, uint32_t counter)
{
/* Wait for previous write to complete */
DMTIMER_WAIT_FOR_WRITE(baseAddr,DMTIMER_POSTED_WRITE_STS_TCRR );
/* Set the counter value */
HW_WR_REG32((baseAddr + DMTIMER_TCRR), counter);
}
If I don't initialize the timer then it will hang also on DMTIMER_WAIT_FOR_WRITE(baseAddr, DMTIMER_POSTED_WRITE_STS_TCRR);
int32_t NandLibWaitPinStatus(nandLibInfo_t *pNandLibInfo, uint32_t timeout)
{
uint32_t status = NAND_LIB_PASS;
uint32_t waitPinStatus = 0U;
uint32_t chipSel = pNandLibInfo->nandLibCtrlInfo.chipSel;
/*
** This function is called immediatly after issuing commands
** to the NAND flash. Since the NAND flash takes sometime to
** pull the R/B line low,it would be safe to introduce a delay
** before checking the ready/busy status.
*/
NandLibDelay(1U);
==>
uint32_t DMTIMERGetCounterVal(uint32_t baseAddr)
{
/* Wait for previous write to complete */
DMTIMER_WAIT_FOR_WRITE(baseAddr, DMTIMER_POSTED_WRITE_STS_TCRR);
/* Read the counter value from TCRR */
return (HW_RD_REG32(baseAddr + DMTIMER_TCRR));
}
Anything else I need to initialize to get the NAND bootloader to work?
JHi