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.
Tool/software: Code Composer Studio
Hi,
I'm using Code Composer Studio(CCS) 9.3.0.00012, And I want to create a binary(.bin) file for UART Bootloader.
The hardware I use is TMS570LS3137 HDK board, so I refer to a TI forum about this MCU,
Here's the URL: e2e.ti.com/.../402100
I downloaded a Bootloader file "Data.zip" provided by Jean-Marc Mifsud from this forum.
The "Data.zip" file contains two projects about UART Bootloader.
The project "boot_uart_TMS570LS3137" is a Bootloader program project,
Another project "TMS570LS3137_Blinky_Bootloader" is a project of blink an LED on TMS570LS3137 HDK.
There is a binary file called "TMS570LS3137_Blinky_Bootloader.bin" from the project "TMS570LS3137_Blinky_Bootloader" release directory.
I know that I can download this application Image(binary file) to the internal flash by Hyperterminal.
But I don't know how to generate a binary file for Bootloader with Code Composer Studio.
And I've seen a lot of teaching about generating binary files for "LM Flash Programmer" by CCS, not for Bootloader.
So my question is, how to generate a binary file for Bootloader?
Also I found that the "TMS570LS3137_Blinky_Bootloader.bin" binary file does not seem to be usable by other Bootloaders.
In order to the compiler problem caused by the Flash API library version, I use the Bootloader project provided by QJ Wang.
Here's the URL: e2e.ti.com/.../869521 (Special thanks to QJ Wang's help!)
Then I tried using YMODEM protocol to download binary code to the device:
In Tera Term: File->Transfer->YMODEM->Send and select "TMS570LS3137_Blinky_Bootloader.bin" binary file to download.
After I download the binary(.bin) file to TMS570LS3137 HDK by using Bootloader, I click option 3 in the Hyperterminal.
At this point the system should perform an LED blinking on the TMS570LS3137 HDK, But I didn't see the LED on the HDK is blinking.
Is this problem caused by the incompatibility between the Bootloader project and the binary file?
And how to generate a binary file for the Bootloader project provided by QJ Wang?
In addition, Mr. Jean-Marc Mifsud mentioned that:
This code has 2 build configuration:(TMS570LS3137_Blinky_Bootloader project)
a] Debug. This is to debug the code. It will be flashed to 0x0000_0000 and does not need the bootloader.
b] Release. This is the configuration to use when you want to download the code using the bootloader. In this configuration, the code is moved to address 0x0002_0000 instead of 0x0000_0000.
Does this mean that I have any settings to check before generating the binary file?
Thanks for your help!
Best Regards, Chen Yan-Li
Hello Yan-Li,
You can convert out file to binary file in CCS.
Using the following script in post-build steps of CCS Build of your project property:
"${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/armofd" "${CG_TOOL_ROOT}/bin/armhex" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin"
Hello QJ Wang,
I tried the method you said, which is to add
"${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}"
"${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/armofd" "${CG_TOOL_ROOT}/bin/armhex"
"${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin"
in the post-build steps of CCS Build of project property.
But after I executed CCS Build ('Debug' for project),
I didn't find the binary file with file extension .bin in the directory of CCS project.
May I ask which step went wrong?
And in which project should I set the above content, the bootloader project? Or Blinking LED project?
Thanks for your help!
Best Regards, Chen Yan-Li
Hello Yan-Li,
It generates binary file for your current compiling project. This utility is to convert *.out file to *.bin file. If compiler/linker generates out file first, then binary file. Please check if you get the *.out file in your debug folder.
Hello QJ Wang,
Thanks for your reply!
Yes, I did find the "TMS570LS3137HDK_UART_Bootloader.out" file in the debug folder of the project,
but this file has already generated before adding the "${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin..." in the post-build steps.
So can I understand that the *.out file after adding "${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin..." and build will become a ".bin" file,
but is the file extension still kept ".out"?
Then, should I download this "TMS570LS3137HDK_UART_Bootloader.out" directly to the HDK device through the Bootloader?
Or Should I change file extension to "TMS570LS3137HDK_UART_Bootloader.bin"?
Or do some conversions before downloading to the HDK device through the Bootloader?
Thanks for your help!
Best Regards, Chen Yan-Li
Hello Yan-Li,
Please delete the old *.out file from the debug folder, then check if a new out file is generated. The utility won't use the old existing out file.
BTW, you don't need binary format for the bootloader. You need a binary file for the application (for example led blinky). The example bootloader only supports binary file format.
Hello QJ Wang,
Understood, so after I burned the Bootloader to TMS570LS3137 through JTAG, I don't need to use the Bootloader project.
Then I just need to generate binary file (application file) through the "example led blinky" project, right?
Let me check with you, can I directly use the new .out file (TMS570LS3137_Blinky_Bootloader.out) generated by the "example led blinky" project?
And without going through some conversions before download to the HDK device through the Bootloader?
Thanks for your help!
Best Regards, Chen Yan-Li
Hello Yan-Li,
1. You are right. You don't need binary for bootloader. The bootloader is loaded through JTAG.
2. No, the example uart bootloader only supports binary format.
Hello QJ Wang,
Thanks for your reply!
I think I fully understand your instructions, After the Bootloader is loaded through JTAG.
Then I can download the Application file (*.bin file) to update the program through the Bootloader.
The steps for generating the Application file (*.bin file) used by the Bootloader are as follows:
1.Add the "${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin..." in the post-build steps.
2.Delete the old *.out file from the debug folder and rebuild the entire project.
3.After completing steps 1 and 2, can find a newly generated binary file (*.bin file) in the debug folder.
(The binary file generated by the example TMS570LS3137_Blinky_Bootloader project is TMS570LS3137_Blinky_Bootloader.bin)
The steps to update the application through Bootloader are as follows:
1.Launch HyperTerminal and connect the communication interface (I use Tera Term VT and the UART Bootloader default USB Cable)
2.Select "1.Download Application Image To the Internal Flash" in the Bootloader's Main Menu.
3.Click File->Transfer->YMODEM->Send and select the binary file (TMS570LS3137_Blinky_Bootloader.bin) to download.
4.After downloading the binary file, Select "3.Execute The Application Code" in the Bootloader's Main Menu.
(In theory, after going through the above steps, the LED on the HDK board should blink)
If my description above is correct, I have encountered a serious problem,
The HDK board does not blink LED or other functions after updating the application through the Bootloader.
I have used the JTAG method to confirm the function of the TMS570LS3137_Blinky_Bootloader project. The LED on the HDK board does blink.
But after I use the Bootloader method to update the program, the LED on the HDK board does not respond.
I have tried other projects to use Bootloader to update the application, but it will not show any function after the update.
Is there any incorrect operation in the above Bootloader process?
Is there any reason why the programs after Bootloader are not updated correctly?
Thanks for your help!
Best Regards, Chen Yan-Li
Hello Yan-Li,
Did you change the linker cmd for application code as below:
VECTORS (X) : origin=0x00010020 length=0x00000020
The origin address for VECTORS(X) should be the start address of your application.
Hello QJ Wang,
I have tried to change the application memory setting you described,
which is to modify the linker cmd file "sys_link_debug.cmd" at the source folder in the TMS570LS3137_Blinky_Bootloader project.
Here is the original memory settings in sys_link_debug.cmd :
MEMORY
{
VECTORS (X) : origin=0x00000000 length=0x00000020
FLASH0 (RX) : origin=0x00000020 length=0x0013FFE0
STACKS (RW) : origin=0x08000000 length=0x00001500
RAM (RW) : origin=0x08001500 length=0x0002EB00
}
Then I changed the original setting of sys_link_debug.cmd to the following:
MEMORY
{
VECTORS (X) : origin=0x00010020 length=0x00000020
FLASH0 (RX) : origin=0x00010040 length=0x0013FFE0
STACKS (RW) : origin=0x08000000 length=0x00001500
RAM (RW) : origin=0x08001500 length=0x0002EB00
}
However, when I use the binary file generated by this new memory setting for the Bootloader, it still doesn't work.
I even deleted the debug folder and rebuild the entire project to make sure that the binary file are newly generated.
Actually, I have made similar changes to the memory settings before.
Because I remember Mr. Jean-Marc Mifsud who provided TMS570LS3137_Blinky_Bootloader project mentioned that:
This code has 2 build configuration:(TMS570LS3137_Blinky_Bootloader project)
a] Debug. This is to debug the code. It will be flashed to 0x0000_0000 and does not need the bootloader.
b] Release. This is the configuration to use when you want to download the code using the bootloader. In this configuration, the code is moved to address 0x0002_0000 instead of 0x0000_0000.
(e2e.ti.com/.../402100
Based on the above description, I did find a linker cmd file "Excluded from Build" in the project called "sys_link_release.cmd".
The memory settings of sys_link_release.cmd are as follows:
MEMORY
{
VECTORS (X) : origin=0x00020000 length=0x00000020
FLASH0 (RX) : origin=0x00020020 length=0x0013FFE0
STACKS (RW) : origin=0x08000000 length=0x00001500
RAM (RW) : origin=0x08001500 length=0x0002EB00
}
According to the above description, I have tried changing the memory setting to the following:
(Or cancel the "Excluded from Build" of sys_link_release.cmd and change it to sys_link_debug.cmd as "Excluded from Build")
MEMORY
{
VECTORS (X) : origin=0x00020000 length=0x00000020
FLASH0 (RX) : origin=0x00020020 length=0x0013FFE0
STACKS (RW) : origin=0x08000000 length=0x00001500
RAM (RW) : origin=0x08001500 length=0x0002EB00
}
But after I tried the above modifications, the binary file generated by the project still couldn't make the LED on the HDK blink after updating through the Bootloader.
Is there any other possibility that the Bootloader cannot update the application correctly?
I would be grateful if you could give me a compatible Bootloader and application example project for reference.
If you have other example application projects that are compatible with this Bootloader, would you please provide it to me?
Thanks for your help!
Best Regards, Chen Yan-Li
Hi Yan-Li,
The start address in this linker command file should be consistent with the start application address defined in bootloader.
Hello QJ Wang,
Thanks for your reply!
So where can I see the start application address defined in Bootloader?
Is it in the cmd file of the Bootloader? and how to understand the definition inside?
Thanks for your help!
Best Regards, Chen Yan-Li
It is in bl_config.h:
// The flash image of the boot loader must not be larger than this value.
//*****************************************************************************
#define APP_START_ADDRESS 0x00010020
Hello QJ Wang,
Thank you! The information you provide is key to solving the problem.
The application cannot be updated properly due to the settings of APP_START_ADDRESS in bl_config.h.
The default APP_START_ADDRESS setting of the Bootloader project is 0x00010100 instead of 0x00010020,
so the previous APP_START_ADDRESS setting of application (0x00010020) will be smaller than the default start application address defined.
Now the application I created successfully blinks the LED board on the HDK.
Thank you so much for your help!
Thanks for your help!
Best Regards, Chen Yan-Li