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.

trouble with UART ROM Bootloader in TM4C123BH6PGE

Other Parts Discussed in Thread: TM4C123BH6PGE

Hi,

I developed my code using an EKLM4F120XL board and the ROM Bootloader (UART) was all working nicely. I have now ported the code onto my own board with a TM4C123BH6PGE and I can't get the ROM Bootloader working.

I have two methods of entering the Bootloader...

holding pin A6 low at power up, set up using this code...

    //Set ForceBootloader Pin.......BOOTCFG..........................................................................................................
    int regVal;
    regVal = HWREG(0x400FE000 + 0x1D0);                        //read BOOTCFG
    if(regVal & 0x00000100) {                                //check EN bit - if set, program BOOTCFG
        HWREG(FLASH_CTRL_BASE + 0x00) = 0x75100000;            //FMA addr
        HWREG(FLASH_CTRL_BASE + 0x04) = 0x00001802;            //FMD data PA6 pulled low - my board
        //HWREG(FLASH_CTRL_BASE + 0x04) = 0x00003402;         //FMD data PB5 pulled low - launchpad
        HWREG(FLASH_CTRL_BASE + 0x08) = 0xA4420008;            //FMC key | commit    //key should be 71D5 no?
        delayms(2);                                            //wait for flash write
    }
    //regVal = HWREG(0x400FE000 + 0x1D0);                    //read BOOTCFG to test it was actually written

and entering the Bootloader from my code using this code...

void EnterBootloader(void)
{
    ROM_IntMasterDisable();                                //disable interrupts master

    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    ROM_SysCtlPeripheralReset(SYSCTL_PERIPH_GPIOA);        //get UART reset to simple, no interrupts, no handshake
    ROM_GPIOPinConfigure(GPIO_PA0_U0RX);                //set up pins PA0 and PA1 for UART use
    ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
    ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    ROM_UARTDisable(UART0_BASE);                        //disable while we set it up

    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
    ROM_SysCtlPeripheralReset(SYSCTL_PERIPH_UART0);
    ROM_UARTConfigSetExpClk(UART0_BASE, ROM_SysCtlClockGet(), 38400, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));

    //ROM_UARTEnable(UART0_BASE);                            //flush rx buffer??
    //while(ROM_UARTCharsAvail(UART0_BASE))
    //    ROM_UARTCharGet(UART0_BASE);

    ROM_UpdateUART();                                    //will not return from here - needs hardware reset
}

Neither method is working for me - entering with the pin held low does appear to run some other code than mine, but the LMFlash Programmer does not connect. I am watching the tx and rx lines on a scope and there is no response from the Tiva to the LMFlash "hello". If I enter from my code it drops straight out and runs my code as if we had just reset.

Is anybody aware of a difference between the Stellaris and the Tiva here? The only difference on my board is that the main osc is 25MHz rather than 16Mhz on the Launchpad. The UART works fine in my code, so the hardware is OK.

Thanks in advance!

Richard

  • Further to this I have found that a "factory virgin" part does Bootload correctly.

    Does the factory part have the Bootloader in Flash as well as in ROM?

    Once I have put my code in flash I can't make it run the bootloader - it's as if it didn't exist in the ROM.

    What have I done wrong?

  • All the problems here stem from not having the latest versions of CCS and Tools - having updated, everything works as expected. So be warned - to use Tiva devices you do need the very latest CCS etc. Unfortunately the "Migrating to Tivaware" document doesn't emphasise this.

    Would be nice if TI could email when new versions are released as I don't think there's an "auto-update" is there?

    Cheers

    Richard