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.
Hi,
I need to program TM4C129 using Beaglebone black. I am using Tivaware driver lib and Ti- RTOS. Planning is given below.
Which example i need to follow. I am planning to go with flash type bootloader. If any one have others easy and good option please suggest.
Regards,
Sumit Chaulya
Hi,
The boot_serial is the flash-based bootloader to program/upgrade application firmware on TM4C129 MCU. The boot_demo1 is an example application that is programmed through the UART port by the bootloader. You can use LM Flash Programmer running on the host PC to download the application application image. Since you are using a Beagle Bone then refer to this app note for implementation of a programmer on the host side for serial bootloading.
https://www.ti.com/lit/pdf/spma074
TivaWare also has the source code for the sflash command line utility at C:\ti\TivaWare_C_Series-2.2.0.295\tools\sflash. You can refer to sflash to build your utility running on the Beagle Bone.
Hi Charles,
Thanks for suggestion.
I have tested, it is working with UART0. I have tested the example code, boot_serial and boot_demo1.
I my case, I have program though the UART1.
So how to change UART0 to UART1?
What is the process, I have to follow for this?
I was trying to open the boot serial example code to modify the UART PORT but unable to open.
I am getting this type of message.
I copied and pasted at another folder but same message I got.
Regards,
sumit
Hi,
Please refer to the bl_config.h file where you can configure the UART port that you want to use for serial bootloading. Below is the snippet of code that currently configures UART0 for serial bootloading. You can change it to UART1 for your project.
//***************************************************************************** // // Selects the baud rate to be used for the UART. // // Depends on: UART_ENABLE_UPDATE, CRYSTAL_FREQ // Exclusive of: UART_AUTOBAUD // Requires: None // //***************************************************************************** #define UART_FIXED_BAUDRATE 115200 //***************************************************************************** // // Selects the clock enable for the UART peripheral module // // Depends on: UART_ENABLE_UPDATE // Exclusive of: None // Requires: UARTx_BASE // //***************************************************************************** #define UART_CLOCK_ENABLE SYSCTL_RCGCUART_R0 //***************************************************************************** // // Selects the base address of the UART peripheral module // // Depends on: UART_ENABLE_UPDATE // Exclusive of: None // Requires: UART_CLOCK_ENABLE // //***************************************************************************** #define UARTx_BASE UART0_BASE //***************************************************************************** // // Selects the clock enable for the GPIO corresponding to UART RX pin // // Depends on: UART_ENABLE_UPDATE // Exclusive of: None // Requires: UART_RXPIN_BASE, UART_RXPIN_PCTL and UART_RXPIN_POS // //***************************************************************************** #define UART_RXPIN_CLOCK_ENABLE SYSCTL_RCGCGPIO_R0 //***************************************************************************** // // Selects the base address for the GPIO corresponding to UART RX pin // // Depends on: UART_ENABLE_UPDATE // Exclusive of: None // Requires: UART_RXPIN_CLOCK_ENABLE, UART_RXPIN_PCTL and UART_RXPIN_POS // //***************************************************************************** #define UART_RXPIN_BASE GPIO_PORTA_BASE //***************************************************************************** // // Selects the port control value for the GPIO corresponding to UART RX pin // // Depends on: UART_ENABLE_UPDATE // Exclusive of: None // Requires: UART_RXPIN_CLOCK_ENABLE, UART_RXPIN_BASE and UART_RXPIN_POS // //***************************************************************************** #define UART_RXPIN_PCTL 0x1 //***************************************************************************** // // Selects the pin number for the GPIO corresponding to UART RX pin // // Depends on: UART_ENABLE_UPDATE // Exclusive of: None // Requires: UART_RXPIN_CLOCK_ENABLE, UART_RXPIN_BASE and UART_RXPIN_PCTL // //***************************************************************************** #define UART_RXPIN_POS 0 //***************************************************************************** // // Selects the clock enable for the GPIO corresponding to UART TX pin // // Depends on: UART_ENABLE_UPDATE // Exclusive of: None // Requires: UART_TXPIN_BASE, UART_TXPIN_PCTL and UART_TXPIN_POS // //***************************************************************************** #define UART_TXPIN_CLOCK_ENABLE SYSCTL_RCGCGPIO_R0 //***************************************************************************** // // Selects the base address for the GPIO corresponding to UART TX pin // // Depends on: UART_ENABLE_UPDATE // Exclusive of: None // Requires: UART_TXPIN_CLOCK_ENABLE, UART_TXPIN_PCTL and UART_TXPIN_POS // //***************************************************************************** #define UART_TXPIN_BASE GPIO_PORTA_BASE //***************************************************************************** // // Selects the port control value for the GPIO corresponding to UART TX pin // // Depends on: UART_ENABLE_UPDATE // Exclusive of: None // Requires: UART_TXPIN_CLOCK_ENABLE, UART_TXPIN_BASE and UART_TXPIN_POS // //***************************************************************************** #define UART_TXPIN_PCTL 0x1 //***************************************************************************** // // Selects the pin number for the GPIO corresponding to UART TX pin // // Depends on: UART_ENABLE_UPDATE // Exclusive of: None // Requires: UART_TXPIN_CLOCK_ENABLE, UART_TXPIN_BASE and UART_TXPIN_PCTL // //***************************************************************************** #define UART_TXPIN_POS 1
Yes, you need to change boot_demo1 example from UART0 to UART1 and rebuild boot_demo1 again.
Hi Charles,
Thanks for Quick reply.
So, I have to change this file from example code.
Then Need to build the project source code(boot_demo1).
am I right Charles?
Regards,
Sumit
Yes. You need to modify the bl_config.h file shown in your screenshot and rebuild the boot_serial example. You also need to modify boot_demo1 to change from UART0 to UART1 as I mentioned in my last reply.
Hi Charles,
Thank you so much for instruction. I followed your instructions and it's work's fine.
But now i got some new issue.
Now i am trying to integrate the bootloader with my actual source code, But i am getting some error.
I think something i have to change, but i don't know that is that.
Working Environment: TM4C129DNCPDT, TI-RTOS, TIVAWARE Driver lib.
Before change the cmd file for bootloader
After Change the cmd file for Bootloader
Compile log:
**** Build of configuration Release for project MPU_E ****
"C:\\ti\\ccs1120\\ccs\\utils\\bin\\gmake" -k -j 8 all -O
Building file: "../MPU_E.cfg"
Invoking: XDCtools
"C:/ti/xdctools_3_32_00_06_core/xs" --xdcpath="C:/ti/tirtos_tivac_2_16_00_08/packages;C:/ti/tirtos_tivac_2_16_00_08/products/tidrivers_tivac_2_16_00_08/packages;C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages;C:/ti/tirtos_tivac_2_16_00_08/products/ndk_2_25_00_09/packages;C:/ti/tirtos_tivac_2_16_00_08/products/uia_2_00_05_50/packages;C:/ti/tirtos_tivac_2_16_00_08/products/ns_1_11_00_10/packages;" xdc.tools.configuro -o configPkg -t ti.targets.arm.elf.M4F -p ti.platforms.tiva:TM4C129DNCPDT -r release -c "C:/ti/ccs1120/ccs/tools/compiler/ti-cgt-arm_20.2.5.LTS" "../MPU_E.cfg"
making package.mak (because of package.bld) ...
configuring MPU_E.xem4f from package/cfg/MPU_E_pem4f.cfg ...
generating custom ti.sysbios library makefile ...
Starting build of library sources ...
making D:/HBIO/FW_Developments/HBIO_PLURALIS_CONTROL_BOARD/dev/MPU_E/src/sysbios/sysbios.aem4f ...
gmake[1]: Entering directory `D:/HBIO/FW_Developments/HBIO_PLURALIS_CONTROL_BOARD/dev/MPU_E/src/sysbios'
gmake[1]: Nothing to be done for `all'.
gmake[1]: Leaving directory `D:/HBIO/FW_Developments/HBIO_PLURALIS_CONTROL_BOARD/dev/MPU_E/src/sysbios'
Build of libraries done.
clem4f package/cfg/MPU_E_pem4f.c ...
"package/cfg/MPU_E_pem4f.c", line 22126: warning: statement is unreachable
"package/cfg/MPU_E_pem4f.c", line 22780: warning: statement is unreachable
"package/cfg/MPU_E_pem4f.c", line 22961: warning: statement is unreachable
"package/cfg/MPU_E_pem4f.c", line 23893: warning: statement is unreachable
Finished building: "../MPU_E.cfg"
Building target: "MPU_E.out"
Invoking: Arm Linker
"C:/ti/ccs1120/ccs/tools/compiler/ti-cgt-arm_20.2.5.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -O2 --define=ccs="ccs" --define=PART_TM4C129DNCPDT --gcc --diag_warning=225 --diag_wrap=off --display_error_number --enum_type=packed --wchar_t=16 --abi=eabi -z -m"MPU_E.map" --heap_size=0 --stack_size=512 -i"C:/ti/ccs1120/ccs/tools/compiler/ti-cgt-arm_20.2.5.LTS/lib" -i"C:/ti/ccs1120/ccs/tools/compiler/ti-cgt-arm_20.2.5.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="MPU_E_linkInfo.xml" --rom_model -o "MPU_E.out" "./main.obj" "./ustdlib.obj" "./Src_user/Analog_Monitor.obj" "./Src_user/Fault_Monitor.obj" "./Src_user/Generator.obj" "./Src_user/Host_communication.obj" "./Src_user/INT_EEPROM.obj" "./Src_user/adc.obj" "./Src_user/calibration.obj" "./Src_user/common.obj" "./Src_user/gpio.obj" "./Src_user/i2c.obj" "./Src_user/pfc_monitor.obj" "./Src_user/pwm.obj" "./Src_user/spi.obj" "./Src_user/uart.obj" "C:/ti/TivaWare_C_Series-2.2.0.295/driverlib/ccs/Debug/driverlib.lib" "../tm4c129dncpdt.cmd" -l"configPkg/linker.cmd" -llibc.a
<Linking>
"configPkg/linker.cmd", line 151: warning #10096-D: specified address lies outside memory map
error #10264: DEFAULT memory range overlaps existing memory range FLASH
error #10264: DEFAULT memory range overlaps existing memory range SRAM
error #10010: errors encountered during linking; "MPU_E.out" not built
>> Compilation failure
makefile:159: recipe for target 'MPU_E.out' failed
gmake[1]: *** [MPU_E.out] Error 1
makefile:155: recipe for target 'all' failed
gmake: *** [all] Error 2
**** Build Finished ****
**************************************************************
if i click this line "configPkg/linker.cmd", line 151: warning #10096-D: specified address lies outside memory map"
I am getting this in linker.cmd.
Please suggest the changes.
Thanks and Regards
Sumit
Hi,
Please refer to this post, particularly the answer by Chester. https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1024278/tm4c1294ncpdt-rtos-bios-not-working/3786291?tisearch=e2e-sitesearch&keymatch=vtable%20relocate#3786291
You need to map your vector table accordingly.
Hi Charles,
Thanks for instruction.
Problem solved everything is working fine.
Now i have another point.
If new application is failed to load because of some issue (communication fail, Power fail, etc.)
Controller should be bootup with old application after reset.
So, what do the steps i have to follow?
Thanks and regards,
Sumit
Hi,
If new application is failed to load because of some issue (communication fail, Power fail, etc.)
You can use CHECK_CRC to verify if the new application is programmed successfully. Refer to CHECK_CRC in the bootloader user's guide for details.
Controller should be bootup with old application after reset.
The current bootloader will overwrite the existing old firmware with a new firmware. It does not retain the old application. It will be up to you to customize the bootloader and to divide the flash into two different sections where the bootloader will update one of the program images and decides which one to jump to after power up.