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.

CCS/TM4C129ENCPDT: Flash boot loader UART 7

Part Number: TM4C129ENCPDT
Other Parts Discussed in Thread: UNIFLASH,

Tool/software: Code Composer Studio

I am new with TI microcontrollers and I am having some problems trying to build a boot loader for the uart7. I think I have correctly configured the file bl_config.h from the boot_serial example and flashed it through a JTAG.

But when I tried to upload a .bin file via LM Flash it didn't work. I also upload a .bin file via Uniflash in the starting address that I have set as APP_START_ADDRESS in the attempt to run it together with the boot loader, but it didn't work either.

What am I doing wrong? Can I use LM Flash to upload .bin files to the uart7?

I am using a Tiva TM4C129ENCPDT  and the only uart ports that I have access are 5 and 7.

Best regards,

Vinícius

  • HI Vinicius,

     Check under the Windows Device Manager and do you have COM port for UART7? Please also check if have proper and matching baudrate between your PC and the MCU. If you see COM port in device manager then right click on the port and select the property and under the Port Settings tab make sure the baud rate is matching the MCU.

  • Hi Charles,

    thanks for the reply. I have already checked the parameters of the serial communication.

    During debug I can see that it waits in the while from the ReceivePacket function.

    I also tried sending twice 0x55 via Docklight but it didn't receive any response.

    Vinicius

  • Hi,
    You didn't answer my question. Did you see the COM port on the device manager? What hardware do you have to make the UART7 appear as a virtual COM port to the PC? Do you use a FTDI chip or other means that does the protocol translation?

    I will suggest before you jump in to the serial bootloader, you will first run a simple example like a uart echo example between the PC and the UART7. Make sure the UART7 is talking to the PC before you debug the bootloader problem.

    Please also use the scope to see if you see correct signaling on the UART7 TX and RX pins.
  • Hi,

    I am using a FTDI chip to communicate with the PC and I can see the COM port on the device manager.

    The communication between UART7 and the PC is working fine.

    Best regards,

    Vinicius

  • Hi,

    Do you already have some code starting at APP_START_ADDRESS ? You need to make sure there is no code starting at APP_START_ADDRESS the first time.

    1. Make sure your flash is completely erased.
    2. Use JTAG to first download the boot_serial
    3. Specify the COM port in the Device Manager. In addition, click the "Disable Auto Baud Support" Checkbox. I assume you have the correct baudrate in the device manager as you stated. Please double check. The bl_config.h uses 115200 as the default so your PC side must match it.
    4. In the Program tab, specify the .bin file. Please use either the boot_demo1.bin or boot_demo2.bin
    5. In the Program tab, specify the Program Address Offset. If you are using default, then you must enter 4000 as the offset address of the application
    6. Click Program button.
    7. After the application program is loaded, you should see the LED blinking if your board has the LED for the corresponding pin running on the demo1.bin/demo2.bin

    I will suggest a few things.
    1. If you have launchpad, run the boot_serial as is in conjunction with boot_demo1.bin or boot_demo2.bin and get a feel for how it works.
    2. Not sure if you need to modify your hardware, try to run the boot_serial as is on UART0 (if you also have the UART0 connected to the FTDI) and see if it works for you.
    3. In the bl_config.h there are various defines associated with the UART pins to use for serial bootloading. Make sure UART7 is modified throughout instead of UART0.
  • Hi,

    I've tried what you said. Here is the result:

    Here is the bl_config.h file.

    2273.bl_config.h

    Thanks for your help.

    Best regards,

    Vinicius

  • Vinicius,
    Do you have access to a Launchpad?
    Understanding the bootloader is only easy after you get it to work once - and it is relatively fast and easy to get it to work if you use a launchpad (because of the access to UART0), and simply tries the two examples found in TI's Tivaware folder. Did you take that route?
    Investing 20 bucks in such a board will surely save you a few hours! If your time is worth as much as other EE's time, you should do that investment immediately, and we will be glad to post further answers if you have any difficulty with the example's bootloaders.
    Straight answer to your question is: YES, you can use LM Flash to upload files to UART7.
    Cheers
    Bruno
  • {Edit] with some correction. I meant sector.

    Your program address offset is an issue. You have 0x1C00. This is an address which resides in the same flash sector as the flash bootloader itself. Are you sure this is what you want to do? Note that the flash erase works is by sector granularity. If you want to forcefully overwrite the first flash sector  then you need to uncomment the #define ENABLE_BL_UPDATE. However, this is not recommended. I will suggest you change the offset address to 0x4000 like the boot_demo1.

  • Hi, 

    I will try changing the offset and try using a launchpad to better understand the boot loader.

    I just have some other questions:

    1) The message error that I received is only related with the boot loader or it can be something else?

    2) The program offset, APP_BASE and APP_START_ADDRESS must be same?

    3) Can I upload more than 1 .bin file with different program offsets and have the boot loader deal with the extra ones? For example, send them elsewhere. (I just want to know if it is possible)

    Best regards,

    Vinicius

  • Hi,

      

    Vinicius Trentin said:
    1) The message error that I received is only related with the boot loader or it can be something else?

      I have only seen this error if the flash is not fully erased for the flash space that is intended for the application. For example, if the application is to occupy at address starting 0x4000 then the flash must have the flash sectors starting at 0x4000 totally erased. The bootloader starting at 0x0 is at the first flash sector. If the sectors starting at 0x4000 is not erased, then you will get the error. I have seen that myself too.  I had noted you on this before. If your application offset is 0x1C00 as what you had before, you are asking the bootloader to load a program onto a flash sector where the bootloader itself occupies. This is doable but totally not recommended as also noted before as this will destroy your bootloader. 

    Vinicius Trentin said:
    2) The program offset, APP_BASE and APP_START_ADDRESS must be same?

    yes,

    Vinicius Trentin said:
    3) Can I upload more than 1 .bin file with different program offsets and have the boot loader deal with the extra ones? For example, send them elsewhere. (I just want to know if it is possible)

      The TivaWare bootloader example does not support this. With the example, it is possible that after the application is already loaded, you press the SW1 switch on the launchpad to load another .bin file but this .bin file will overwrite the earlier .bin file in the flash. You could write your own application that will call the bootlader to load a new .bin file onto an unused flash sectors without affecting the flash sectors in which the current bootloader and the existing application reside. However, why would you want to do that? You are over complicating yourself. You will need to write a bootloader that knows which application to jump to. How will your bootloader know when to overwrite the first application or the second or even to add the third application? What is your application? I will keep it simple to begin with. 

  • Hi,

    I was able to use the boot loader with a Launchpad.
    I also checked the values from APP_BASE, APP_START_ADDRESS and program offset.
    I think the problem maybe in my bl_config.h file.
    The parameters that I've changed are:

    #define UART_FIXED_BAUDRATE 115200
    #define UART_CLOCK_ENABLE SYSCTL_RCGCUART_R7
    #define UARTx_BASE UART7_BASE
    #define UART_RXPIN_CLOCK_ENABLE SYSCTL_RCGCGPIO_R2
    #define UART_RXPIN_BASE GPIO_PORTC_BASE
    #define UART_RXPIN_PCTL 0x1
    #define UART_RXPIN_POS 4
    #define UART_TXPIN_CLOCK_ENABLE SYSCTL_RCGCGPIO_R2
    #define UART_TXPIN_BASE GPIO_PORTC_BASE
    #define UART_TXPIN_PCTL 0x1
    #define UART_TXPIN_POS 5

    Are they correct?

    Best regards,
    Vinicius