hi all,
I am using TMS570Ls3137 HDK board,halcogen 4, ucos-iii.I want to dump my code through bootloader.So pls help me how to add uart bootloader code in my application.
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 all,
I am using TMS570Ls3137 HDK board,halcogen 4, ucos-iii.I want to dump my code through bootloader.So pls help me how to add uart bootloader code in my application.
Pandurang,
Please have a look to the following document:
Pandurang,
It will be easier if you can provide more detail on what is not working.
I've created 2 projects targeting TMS570LS3137. All the files are included in the zip file. 1234.Data.zip
Unzip this file on your C: root directory.. You should see a directory named: C:\data\workspace_temp
Start CCS and select File->Switch Workspace and specify C:\data\workspace_temp as your new workspace.
Right click on each project in the project explorer window and select open.
Be sure that the active configuration for both project is "Release"
1] TMS570LS3137_Blinky_Bootloader. In this directory you have the code to blink an LED on our HDK board.
This code has 2 build configuration:
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
2] TMS570LS3137-Bootloader. In this directory you have the code for the TMS570LS3137 UART bootloader.
The bootloader code needs access to the Flash_API library. This is by default installed when Halcogen is installed, and the default directory is:
C:\ti\Hercules\F021 Flash API\02.01.00
This version of the bootloader needs Flash API version 02.01.00
Both project are using an XDS560 as JTAG pod. You will have to change that to match your JTAG debug configuration.
Also, both project are already compiled (out files and bin file for download) I will suggest to use them as is.
Please let me know if this is helpful.
If you encounter problem, please be as specific as possible.
Apparently you are missing the Flash API library.
If installed, it is by default in C:\ti\Hercules\F021 Flash API\02.01.00
It is usually installed with Halcogen package. Tha actual release you can download is 02.01.01 but is not compatible with the Bootloader.
As I mentioned, Flash API 02.01.00 has to be used with bootloader. We are working on a new version of bootloader to work with 02.01.01
The download page for Flash API is:
I will send you as zip file the version 02.01.00
Can you also check on your PC if it is installed and let me know the version(s) you have.
Pandurang,
Can you tell me the path installation for the Flash_API.
In the project I've sent to you, the expected path for this Flash_API library is C:\ti\Hercules\F021 Flash API\02.01.00
If for some reason your installation is different, than the library will not be found at link time.
Here is how to change the project in case Flash_API in your case is not installed at the default location.
1] Right click on your project name in the project explorer window and select "Show Build Settings".
2] Expand CCS Build->ARM Linker->File Search Path as shown below.
If the path is incorrect, double click and edit with the correct path.
Please have a try and let me know.
Pandurang,
This is good news.
What you have to do is to program on your device the UART bootloader first.
This will erase the device and program the bootloader.
Start your Hyperterminal (you have to have the usb cable plugged between your HDK and your PC.
Here is the configuration for Hyperterminal. In my setup I use Tera Term VT.
The COM port will certainly be different in your case. The default baudrate has to be set as 115200 as shown in the above picture.
The next step is to run the bootloader. It will check if there is a valid application code.
Right now there is no application so it will be in download mode.
You should see this on your terminal:
Before going further, the bootloader is using YMODEM protocol to download binary code to the device:
In Tera Term you have to go through File->Transfer->YMODEM->Send and select the file you want to download.
In my example, it is TMS570LS3137_Blinky_Bootloader.bin from the release directory.
As I said in a previous post, the release version is linked at address 0x0002_0000
So to start the download, from the Hyperterminal click option 1 "Download Application Image To the Internal Flash"
In Tera Term you have to go through File->Transfer->YMODEM->Send and select the file you want to download.
With my demo code you have to select: TMS570LS3137_Blinky_Bootloader.bin
In your case, you will have to select your application code.
You should see a progress bar going on. This will confirm that download is in progress.
Now, if you click option 3 in the Hyperterminal, the bootloader will execute your application code.
With my demo code, you should see an LED blinking on the HDK.
So there is nothing to merge. The bootloader is one project, your application is a different project.
Use my demo code to understand the concept before trying to download your application.
Good luck.
Hi jean,
I tried with your TMS570LS3137_blinky_bootloader program it gets work fine.But once the application is loaded and once we restart the device it doesnot shows upload,download option,we have to reput the uart bootloader.I want my application to ask every time i restart my TMS device searching for app update for some time.
Also when i put my appliaction code it stops exactly #packets :514 and bytes transferred :525312.Is there any code limit.Pls guide
Thanks
Pandurang Pai
Pandurang,
In my first reply, I've mentioned the following document:
I suggest you read it. There is a flow diagram that explains how the bootloader works.
In section 7 UART Bootloader Operation it is explained that GIOA_7 is used to force a re-load. Otherwise, the control is passed to your application.
Concerning the download of your application, it is difficult to debug this problem without your code.
So if you can share it I can have a look. If you don't want to share it on the forum, I will give you my email address so you can share is safely.
Pandurang,
I was able to use your code and program it via bootloader.
Here are what I had to change.
1] Not sure if this is an artifact of importing your project in my environment, but the Post-Build step to generate the bin file was missing.
Here is the full command line:
"${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/armofd.exe" "${CG_TOOL_ROOT}/bin/armhex.exe" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe"
2] This is the most important part, and in my previous reply I've mentioned it many times.
The bootloader EXPECT your application code to be mapped at address 0x0020_0000 AND NOT 0x0000_0000
In your case, it was 0x0000_0000.
To be able to debug the application to be downloaded I create via CCS a debug and release version. The debug version uses a linker command file where the flash is mapped to 0x0000_0000. In this case the code can be programmed via CCS directly and there is no need to use the bootloader.
Once the code is debugged, than I create the release version. This version uses a different linker command file where the flash is now mapped to 0x0020_0000.
I've attached to this post the 2 linker command file for your reference. These linker command files can be copied in:
\Micrium_TMS570LS31xHDK_OS3\Micrium\Examples\TI\TMS570LS31xHDK\BSP\CCS-HCG\source directory.
In the previous picture, you can see that for Release Version, sys_link.cmd is excluded and sys_link_release.cmd is used.
In the Debug Version it is the opposite. sys_link.cmd is used and sys_link_release.cmd is excluded.
So as summary, I'm able to download your code. I'm not sure how to test what it is doing.
Please read carefully and let me know the result.https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/312/2402.sys_5F00_link_5F00_release.cmdhttps://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/312/4011.sys_5F00_link.cmd
Pandurang,
I was able to make your OS3 application to work with the bootloader.
Here are the modification/reason to be done in the bootloader.
By default, the bootloader assumes the custom application will use "IRQ Handling via VIC Controller".
Micrium OS3 does not use this mode. The RTOS has to have full control on how to manage IRQ.
So there are 2 fixes to be done in the bootloader project.
1] in the file sys_invecs.asm you have to change:
b _c_int00 ;0x00
b #0x1FFF8 ;0x04
b #0x1FFF8 ;0x08, Software interrupt
b #0x1FFF8 ;0x0C, Abort (prefetch)
b #0x1FFF8 ;0x10, Abort (data)
reservedEntry
b reservedEntry ;0x14
b #0x1FFF8 ;0x18 (Original code: ldr pc,[pc, #-0x1b0])
b #0x1FFF8 ;0x1C (Original code: ldr pc,[pc, #-0x1b0])
2] Also in sys_startup.c you have to comment out the following statement:
/* Initialize System - Clock, Flash settings with Efuse self check */
systemInit();
/* Enable IRQ offset via Vic controller */
// _coreEnableIrqVicOffset_();
/* Initialize VIM table */
{
uint32_t i;
Recompile the bootloader and re-flash it.
Than download your released OS3.bin. It will work.
NOTE: After this modification in the bootloader, the blinky application I've send to you as example WILL NOT WORK ANYMORE.
This demo code expect the bootloader to use "IRQ Handling via VIC Controller".
I suggest you to read in the TRM the chapter 15 "Vector Interrupt Manager (VIM) Module"
Hi Jean-Marc,
i am trying to implement a CAN Boatloader on a TMS570LS0714.
I was trying to use the existing bootloader code but am also encountering problems as it is using the old Flash API 02.01.00 which i cannot find for download anywhere.
Do you know if there is a newer bootloader demo project based on the current Flash API 02.01.01 available or can you provide us the old API 02.01.00 for evaluation and as starting point for adaptions?
Any help is much appreciated,
Cheers