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.

uart1 bootloader for lm4f232

hi,

i tried with uart0 bootloader using lm4f and its working fine.now i am trying the same with uart1,but unable to execute it.i am getting an error "unable to synchronize baud rate with board" in flash programmer while downloading appilication.can i know why this problem occurs.i have gone through this links http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/247749.aspx i coudin't find the solution.............can you tell me the steps to be followed while configuring the uart1 and downloading application through lm flash programmer.

in regards,

shyam.

  • Hi Shyam,

         What are the changes you made, to make the uart bootloader work using uart1, instead of uart0.

    -kel

  • i have changed uart0 to uart1 where ever it is used in the example program "boot_serial".  i am not getting what else i am missing .........

    in regards,

    shyam.

  • Hi Shyam,

    There are a few issues here. A simple find & replace operation won't work.

    In bl_main.c, PA0 and PA1 are setup to be controlled by UART0. You'll need to change that code to set up pins for UART1. Refer to the datasheet to see which pins can be assigned to that function. 

    Secondly, If you are using the onboard ICDI to handle the UART communication between the microprocessor and the PC, then UART0 is your only option. The ICDI is hardwired to connect to the target chip's PA0 and PA1 pins.

    Regards,

    Sam

  • hi sir,

    i have already done all those changes regarding UART1 port pins(C4,C5) in main.c,uart.c. i am using ICDI for just power on the controller and to download the "boot_serial"code initially.nothing more than that. can you tell me the procedure which you followed to do uart1 bootloader, so that i can check mine.

    in regards,

    shyam.

  • hi sir,

             in which case the **error** failed to synchronize the baudrate with board " occur because when i am testing with uart0 bootloader i got this problem than i lowered the baudrate in lm flash than the application downloaded. again the same problem came with uart1 but when i fallow the same procedure even though the same error i am getting.in my board i cheked with all the ways like

    uart1 is working fine,

    when ever i program it is checking for synchronization baudrate with board and after some time error occurs. can know in which case this error occures mainly.

  • Hi Shyam,

    What are using to connect the UART on the LM4F232 to the PC?

    Have you selected the correct COM port for that device? (i.e. not the COM port for the ICDI).

    If you try disabling Auto Baud and manually setting the baud rate in LM Flash Programmer to match your bootloader code, does the problem go away?

    Regards,

    Sam

  • shyam reddy1 said:

    uart1 is working fine,

    While that may/may not be the case - you've not described your connection method/path between LX4F232's UART1 and your remote UART source.  We're told only that you use LM Flash Programmer - which involves a USB connection between your PC and your LX4F232 board.  And - Sam has stated - and our group confirms - that this USB sourced connection is hard-wired only to UART0. (on your LX4F232 board)

    So - when you state that UART1 works fine - by what means do you create that UART connection - and what is the remote UART device so attached?  Beware that should that remote UART be RS232 - those signal levels are far beyond the capability of any MCU.  (RS232 line-level driver IC required) 

    In one post you state, "...How did you (Sam) make the uart bootloader work using uart1, instead of uart0."   We see nowhere that Sam has made such claim.  It appears only to be possible by physically "hacking" that 4X232 board - to reroute from UART0 to UART1.  (and always unstated - for what purpose - to what end?)

    You really must detail:

    a) how do you route UART1 - both RX & TX - to the remote UART target?

    and

    b) what is that remote UART target - especially that target's signal levels?

    and

    c) kindly describe your meaning of, "uart1 works fine."   How/where/attached to what?

    Devil in these details - migration from the working UART0 demands such...  (and seems misguided - unless you have a very good supporting reason(s)...)

  • Hi Shyam,

    I am trying to change the UART of the bootloader. I have replaced all UART0 to UART2 and PORTA to PORTD. Still it is not working. Can you please tell me what are the changes i have to make in bootloader code(boot_serial).

    Thanks for your help.

    -Bijo

  • Hi Bijo,

        PD7/U2TX is NMI. You, need to add code that configures PD7 as UART. See, related post below

        Enable the NMI

    -kel 

  • hi Bijo,

                  follow this procedure for unlocking the PD7 pin.

    // Unlock access to the commit register
    HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY_DD;
    //
    // Set the commit register for PD7 to allow changing the function
    //
    HWREG(GPIO_PORTD_BASE + GPIO_O_CR) = 0x80;

    //
    // Enable the alternate function for PD7 (U2TX)
    //
    HWREG(GPIO_PORTD_BASE + GPIO_O_AFSEL) |= 0x400;

    //
    // Turn on the digital enable for PD7
    //
    HWREG(GPIO_PORTD_BASE + GPIO_O_DEN) |= 0x80;

    //
    // Relock the commit register
    //
    HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = 0;

    in regards,

    shyam.

  • Hi Kel,

    Thanks for your valuable information. Now, everything is working fine.