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.

TMS320F28069: SCI_echoback

Part Number: TMS320F28069
Other Parts Discussed in Thread: C2000WARE

Hello,

I am currently at a deadlock about my project. I am trying to flash my TMS320F28069 by using SCI (UART connection) but I can't connected my board. 

I am using the experimenter's kit - Piccolo F28069 for the board, TTL-232R-3v3 for USB-UART (Tx of TTL connected to GPIO28 of Piccolo, Rx of TTL connected to GPIO29) and the USB is connected to my PC. I am using CCS, and I would like to test the example : C:\ti\c2000\C2000Ware_3_04_00_00\device_support\f2806x\examples\c28\sci_echoback . 

I can't  run the program, I have the following error in the console from CCS : 

" C28xx: GEL: Error while executing OnTargetConnect(): Could not read register ST1: execution state prevented access
at (ST1&~(0x0100)) [f28069.gel:312]
at C28x_Mode() [f28069.gel:78]
at OnTargetConnect() "

My parameter in CCS are : UARTConnection for the connection and TMS320F28069 for the board device.

I have tried for one week to understand what is going on but I can't figure out and I don't further my work.

Many thanks in advance for your help.

Best regards,

Nicolas Clochefert

  • Hi Nicolas,

    There is another alternative to using a RS232 transceiver which is explained here: https://e2e.ti.com/support/microcontrollers/c2000/f/c2000-microcontrollers-forum/325527/sci-usage-in-f28069 . I would suggest you try the first option and see if that works for you before we debug your current method.

    Best Regards,

    Marlyn

  • Dear Marlyn,

    Thanks a lot for this link, I have not seen it. 

    I am going to follow this.

    Many thanks.

    Best regards,

    Nicolas

  • Dear Marilyn,

    The link has been really helpful for me to move forward in my project. Thanks a lot.

    I have done exactly what the link said, and I have run the SCI_echoback example or Led_blinky example for F2806x device.

    But there is a problem : on my windows terminal, when I run program, I see "Kernel Autobaud Successful" and after that "Kernel Loaded Done Waiting for kernel boot...attempting autobaud Application AutoBaud Successful "

    But after that I can't take back control and nothing happens. I don't understand why. 

    Could you please help me if you understand what's going on ?

    Many thanks in advance for your help.

    Best regards,

    Nicolas Clochefert

  • I think it's because the first code "sci_flash_kernel" never finishes. Just like if the program always stays at the same point and never switch on the other program which is "sci_echoback". What do you think, have you ever seen this kind of problem ? 

    I have seen on another post that someone else had almost the same problem than me but none solution has been given, the guy used C2Prog to solve his problem. But I feel this soft use JTAG and I don't want it. 

    Many thanks in advance for your answer.

    Best regards,

    Nicolas Clochefert

  • Hi Nicolas,

    Actually i had the same problem, and I solve it by increasing the number of sectors to be erased in the kernel. You can do that by importing the kernel project to ccs, you will find the project in:

    C:\ti\c2000\C2000Ware_3_04_00_00\device_support\f2806x\examples\c28\f28069_sci_flash_kernel 

    After opening, navigate to CopyData(void) function, you will find that function in sharedboot.c file. change the line where it says

    status = Flash_Erase((SECTORA | SECTORB | SECTORC | SECTORD), &FlashStatus);

    to 

    status = Flash_Erase((SECTORA | SECTORB | SECTORC | SECTORD | SECTORE | SECTORF | SECTORG | SECTORH), &FlashStatus); 

    This way, it will erase all the sectors. The problem might be that the firmware that you are trying to flash using sci is too big for the sectors that are getting erased in the provided kernel which can result in data overriding and data corruption with the previously non erased sectors. 

    After changing the line inside the kernel you have to build it again and then take .txt file from debug folder inside the project directory. After that you have to use this new kernel with flash utility.

    Regards,

    Najeeb

  • Hi Najeeb,

    Thanks a lot for your help. I have tried what you have said but unfortunately it doesn't change anything. My terminal still get stuck at the same point "Application AutoBaud Successful". 

    Maybe I make a mistake somewhere but I don't know where. 

    Thanks again, I will continue to search what is going on. If you have another idea I take it with pleasure.

    Regards,

    Nicolas

  • can you get me through the steps you are taking and what exactly you are trying to do? I might be able to help.

    R,

    NU

  • I am trying to use UART GPIO to flash DSP (by using sci-flash-kernel) and after that running a random program (sci_echoback for example). I use the F28069 Piccolo Experimenter Kit and TTL-R232-3v3 for USB-UART. GPIO connected are GND/3v3/28&29. 

    I am using windows terminal to run program and see results.

    So I convert .out into .txt (so flash.txt and echo.txt) and then I run programs with the next line :  C:\ti\c2000\C2000Ware_3_04_00_00\utilities\flash_programmers\serial_flash_programmer\serial_flash_programmer.exe -d f2806x -k C:\...\flash.txt -a C:\...\Echo.txt -p COM1 -b 9600 -v

    And then I see : 

    getting comm state
    building comm DCB
    adjusting port settings

    calling f05_DownloadImage
    Downloading C:\Users\nclochefert\Documents\NCL\Echocho.txt to device...

    Kernel AutoBaud Successful
    aa==aa
    8==8
    0==0

    ....

    0==0
    0==0
    Kernel Loaded
    Done Waiting for kernel boot...attempting autobaud
    Application AutoBaud Successful

    And after that nothing. It stays at this point and I have to make ctrl+c to take back control. 

    Thanks a lot for your help, very kind.

    Best,

    Nicolas

  • What command/switches/utility do you used to convert .out file to .txt file?

  • I use this command :

    C:\ti\ccs930\ccs\tools\compiler\ti-cgt-c2000_20.2.3.LTS\bin\hex2000.exe -boot -a C:\...\Debug\f28069_sci_flash_kernel.out -sci8 -o C:\...\Flash.txt

  • I hope you are using the same command for the application. Here is what you can do, change the pin state for flash boot, load the any example like ledblinky with jtag, change the pin state back to sci_boot, turn off and on the power to the controller, you can do that by using the switch on experimenter kit. After that run serial flash programmer and when it get stuck at the same point, reconnect the jtag by pressing connect target button on the toolbar, after that press on load dropdown menu in the toolbar and click load symbols, open flash.out file that you have previously created. By doing this you can find out where in the kernel it got stuck.

    let me know what happens.

  • Thank you for this solution. I will try it later, I have to work on another project right now. 

    I will recontact you asap to tell you the result of your solution, thanks again. 

    Just I would like to ask something about the autobaud in flash-kernel code. Did you write something on kernel.txt to do the autobaud? In the kernel code I have used a debugger and my code gets stuck at this point in the function SCI_Boot

    So it maybe because he is waiting a character "A" or "a" but it never happens, doesn't it? But the fact is, I don't know where I can put this character, I have tried in .txt file but nothing happens more. Do you have an idea ? 

    Many thanks again for your help, I will come back soon.

    Best regards,

    Nicolas

  • Yep, autobaud requires to receive "A" character in order to set baud rate, but you don't have to write this character anywhere, the serial flash programmer that you using, does that for you. Also your controller seems to go past this step as the serial flash programmer print "Applicatin auto baud successful", the script only prints this string once it sends and receives "A" character. This means that it get stuck somewhere after that.

    Can you try to send different example firmware, that has been tested before and working. And trying using some lower baud rates then 9600.

  • Hello Najeeb,

    Sorry I was on another project for some days.

    Thank you for your explanation and for your solution about change firmware and baudrate. 

    I have tried your solution but it doesn't change unfortunately. But there is a weird fact : when I flash and put an empty firmware.txt, it works (Windows terminal give me back control). When there is 3 or less characters in the firmware.txt (ex: 0 0 or 000 or (space)00 ) it works but if I write one more character it doesn't work. 

    Just like if the CPU has not enough memory to run the new program if there is 4 or more characters.

    And another thing, when I am stuck in the Window terminal (so stuck at "Application Autobaud Successful" step), I can't modify the firmware.txt, it means that the program is inside and try to read it. 

    I don't understand what is going on exactly, do you have an idea of reason of that please ?(or someone else?) 

    Thank you in advance for your help.

    Best,

    Nicolas

  • Hello, I was assigned this issue today. I will take a look at the thread history and reply in a day or so.

    Thanks,

    Sira

  • Hello Sira,

    Many thanks to take of your time to help me with this issue .

    Best,

    Nicolas

  • Nicholas,

    So the SCI ROM Bootloader is able to download the SCI Flash Kernel to RAM, pass control to it, then gets stuck - seemingly in the AutoBaud lock phase (per CCS after loading symbols) even though the terminal message (from serial flash programmer) indicates Application Autobaud is successful.

    This is the part I'm not sure about. Can you please try repeating this? Once you hit the "unresponsive" state, connect to CCS, load symbols and see where it is halted.

    Najeeb's suggestion is important, and I hope you are continuing to use that i.e. build the SCI Flash Kernel with CopyData() modified to where the call to Flash_Erase() includes all sectors, not just A-D. The reason it is not showing up at the moment is because CopyData() happens much later within SCI_Boot(). And the kernel is not even getting to that point.

    This user had the same issue as you, and the above fix helped.

    https://e2e.ti.com/support/microcontrollers/c2000/f/c2000-microcontrollers-forum/910287/tms320f28065-sci-upgrade-issues/3370415#3370415

    Thanks,

    Sira

  • Hello Sira,

    Sorry for the delay, I am at the same time on another project with many problems too ;) 

    Thanks you for your answer and to have taken your time. 

    So as Najeed has suggested, I have changed the CopyData() function to be sure that every sectors are erased. But it doesn't change anything.

    I have a question about your suggestion, sorry I am a beginner in this field so I don't see how I can do what you say : "Once you hit the "unresponsive" state, connect to CCS, load symbols and see where it is halted." 

    So if I understand well, I have to go back to CCS and use a debugger once I am stuck to see where the program stop. Is that what you mean ?

    The fact is, I use GPIO28/29 to use UART so I have to use an external debugger but I just have XDS100v3 without UART to my disposition. Do you have a reference to me please ? 

    Many thanks for your help.

    Best regards,

    Nicolas

  • Nicolas, correct, that is what I mean - use a debugger. You had this before as well, and posted a picture. I just want you to repeat this again to see if it is stuck in the same location.

    Thanks,

    Sira

  • Sira,

    Thank you for your reply.

    So, here a picture of my board to be sure that we understand each other well.

    So as I said before, I don't have a debugger to use with UART connection so I have to connect the USB and work just with USB (so I disconnect UART it doesn't useful).

    But the fact is, in my Windows terminal, I am not stuck at the same step if I use UART or if I use USB : see screen below. That's why I am not sure that it is useful to control with the debugger from USB because UART interests me, not USB. But maybe I make a mistake and both issues are linked ... 

    So on the left side, this is what I see on the Windows terminal with USB, and on the right this is with UART. 

    UART seems to achieve flash kernel for two reasons : 

    • first, according to terminal;
    • second, as I said before if my second program has just 3 or less characters in the .txt file, I can take back control (program switch and reads the second .txt). But if there are 4 or more characters, I am stuck at this step on the right screen.

    So I come back to your request. With USB I can use debugger and I am always blocked at the same step, see screen below : 

    So, as you can see on the screen, program blocks in SCIA_AutobaudLock function when SCIFFCT has to be set to 0. And if I hide this line, there is a second stop 2 lines after with SCIRXST this time. 

    Many thanks for your help Sira.

    Best,

    Nicolas

  • Sira,

    Sorry I have set aside this project for a while so I have forgotten to make short the terminals of J9 on the Docking Station. 

    So now when I use USB I am stuck at the same point than when i use GPIO 28/29.

    So I have used again the debugger and program stops at the same point, no improvement for that. 

    Thank you.

    Best regards,

    Nicolas

  • Nicolas, I am not sure what the issue might be. I will consult my colleagues for any clues. I will get back to you in a day or two.

    Thanks, Sira