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.

TMS320F28335: Boot rom does not echo back last byte of the flash_kernel which i plan to use as secondary bootloader.

Part Number: TMS320F28335
Other Parts Discussed in Thread: C2000WARE

Hi,

I will give preliminary information to describe my problem. I am try to make an embedded system which will upload any program to f28335 mcu over uart serial communication. So I have read some refereance guide and tecnical documentation which related to tms320f28335 bootloader & serial flash programming. I am newbie about c2000 mcus and bootloaders. So I got confused a little but i can handle it. If I dont have misunderstood, The boot rom does not have capacity to load data to flash. So That to store the code into the device flash SCI bootloader should use to load flash_kernel into the RAM which is capable of writing the code into the Flash memory. If I am right everything clear for me. I have write a simple c code which send the binary code generated by hex2000 utility. I have upload 3 different .out(converted to .b00) file to ram. All of them uploaded with any error. But when I try to sent f28335_flash_kernel.out(of course converted to .b00). The last byte(it is 0x00) of the f28335_flash_kernel.b00 didnt echo from f28335. I have try to change f28335_flash_kernel example version. But it didnt work. Can you help me to find out where i have make mistake. Any suggesion will acceptable. Thanks in advance.

Best regards.

Some documents link below(I read); 

TI wiki C2000 bootloader

TMS320x2833x, 2823x Boot ROM Reference Guide

Serial Flash Programming of C2000™ Microcontrollers

F2833x-F2823x Firmware Development Package USER’S GUIDE

and so many Q&A on the forum...

  • Hi Emin,

    Your understanding of the bootloader and the kernel is correct.

    Can you see where the C2000 program counter is in ROM when it does not send the last byte back? You can load the symbols of the boot ROM and run the SCI bootloader. When the host application doesn't receive the last character, what is the device trying to execute?

    Also, what host tool are you using to load the kernel and other RAM applications.

    Also, are you sure you are converting the .out to the hex file properly with the proper flags.

    Please see: www.ti.com/.../sprabv4b.pdf

    Regards,
    sal
  • Thank you for your answer. The host application is running on rx631(renesas mcu) custom board. So the host application dont have capability to see c2000 program counter. So I am like blind about what is going on 28x... I dont understand about loading the symbols of the boot rom and running the sci bootloader. If the host applicaiton doesn't receive the last character, host application starts timeout counter.
    As I mentioned above, I have read the document you have suggested and more. I am using hex2000 utility while converting .out to the hex. I have check suitability of the hex file for 8bit data stream structure by using hex editor. I would like to remind you that I have successfully uploaded three ordinary application that I have not used as a secondary boot loader. but I'm having this problem when it comes to the application(flash_kernel) I'll use as a secondary boot loader as well.
  • Hi Emin,

    Are you saying that you have successfully uploaded 3 other RAM application using the SCI boot loader?

    Can you modify the kernel to blink an LED or toggle a GPIO to see if it is loaded successfully as well? If I understand correctly, you are not sure if the kernel is being loaded successfully, since you are not able to perform the autobaud lock with the kernel. If you can add some code to the kernel to toggle a GPIO at the start of the kernel, then you can determine if it has in fact loaded properly.

    Also, please ensure that the kernel is using the same SCI GPIO pins which the SCI bootloader. Additionally, since the SCI kernel should be using the same baud rate as the bootloader, the autobaud is not necessary. You can also test the connection by continually sending some data to the host once the kernel begins to execute. You can modify the kernel to just send data to make sure the SCI TX is working properly and able to communicate to the host.

    Hope this helps.

    Another question, do you have access to JTAG or debugger on C2000?

    Regards,
    sal
  • Hi Sal,
    It is good to see you again. Yes I have successfully upload 3 other application using the sci boot loader. But I realise that they were flash application. So I have not successfully upload ram applicaiton. If flash kernel successfully uploaded, the last char of the flash kernel should echo back to the host. Last char represent that next data block lenght is zero with previous 0x00 byte. So SCI boot loader will exit boot. Am I wrong? I have xds110 debug prob. I have try to build boot rom where is located at "C:\ti\c2000\C2000Ware_1_00_05_00\libraries\boot_rom\f2833x\v2_0\rom_sources" for debugging. but I couldn't built the source code. If I can build that I can apply your suggesions at your first reply.
  • Emin,

    Your understanding is correct about the echo back.

    However, if your other three applications were flash applications, then you have not successfully uploaded them. They SCI bootloader cannot program flash and thus your application was not programmed successfully. That is the need for the kernel. The kernel is equipped with the flash API to program the flash when a flash application is received.

    You don't have to build the symbols. They are in C2000Ware. You just have to add the symbols of the boot ROM is CCS. There are other E2E posts about this.

    The symbols are here: C:\ti\c2000\C2000Ware_1_00_05_00\libraries\boot_rom\f28004x\revB\rom_sources\ccs_files\cpu\Release
    Source files here: C:\ti\c2000\C2000Ware_1_00_05_00\libraries\boot_rom\f28004x\revB\rom_sources\F28004x_ROM\bootROM\source

    Hope this helps.
    sal
  • Hi Sal,
    I loaded symbols and started debug session. Now I can see registers, program counter etc. The boot rom and host application communicate with each other as expected. I add a breakpoint to my host application which will break the app at while sending last character of flash_kernel. Also boot rom side have break points. SCIA_GetWordData function waiting to fetch the MSB of the last word and verify back to the host. After break I step over line which write data to transmit data register from host side. So SCIA_GetWordData function should fetch the MSB of the last word. But It get stuck. The disassembly viwer point this line "0095a7: 5201 CMPB AL, #0x1". I search for the adress in TMS320x2833x System Control and Interrupts Reference Guide. There is nothing related to that adress. What should my next step be?
  • Hi Emin,

    Good job debugging so far. That is the right procedure.

    I think 0x95A7 is RAM, so it may be where the kernel is getting loaded. Is this correct? Can you see the data sheet for memory map or look at the kernel's linker command file to confirm this?

    sal
  • Yes the address belongs to ram, I reviewed f2833x_flash_kernel.map.The address related to SCI_boot function.It is not start address of SCI_Boot function but lenght info shows it contains the address. Most probably the kernel waiting "a"-"A" char :). I will write the code to dump flash app to flash kernel. But Serial flash programming guide(sprabv4b) does not have a clear explanation for me about flash_kernel data stream. I know it is based checksum of data block. But Where will be entryaddress, start adress, data count etc. So can you share a documentation which have good explanation for flash kernel data stream? By the way I dont understand why boot rom doesnt echo back the last char.

    Edit: I send char "a" and when I suspend the debug program counter at 0x95fe which related GetOnlyWordData function. So I can start to send flash appilication code to flash_kernel.

  • Hi Emin,

    Nice.

    You can find the hex format in the ROM chapter of the TRM. Please see: www.ti.com/.../spru963a.pdf

    It is the 19-22 byte that is sent. Please see the data stream format in the above link.

    Regards,
    sal
  • Thank you for your help. Actually I have source code so I can figure out data stream.