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.

Linux/TMS320F28377S: Programing from a Raspberry

Part Number: TMS320F28377S
Other Parts Discussed in Thread: C2000WARE

Tool/software: Linux

Hello All,

Is it possible to program the microcontroller using a Raspberry pi zero?

I am interested on programing the controller remotley or thru a Raspberry pi zero.

Thanks

  • I'm not familiar with the Raspberry Pi Zero, but I imagine this should be possible. What communication protocol do you want to use? Have you looked into the different peripheral boot loaders available on the F28377S? I recommend reading up on them in the technical reference manual. I also recommend checking out the flash programming examples in C2000Ware.

    Whitney
  • Hello, Whitney:

    -What communication protocol do you want to use?
    SCI, is it the best option?
    -Have you looked into the different peripheral boot loaders available on the F28377S?
    Yes, I have found in www.ti.com/.../spruhx5e.pdf (Table 3-4) the different boot modes and have chosen SCI boot mode, which specifically refers to SCIA port, I did configure the Dip-Switch as high-low-low referring to positions 1, 2 and 3.
    ->How can I physically connect to SCIA port? by USB? I could not find the specific pins.

    -I also recommend checking out the flash programming examples in C2000Ware.
    I did found and executable on /C2000Ware_1_00_06_00/utilities/flash_programmers/serial_flash_programmer but it does not run on ARM's architectures.

    Thanks.
  • I don't know enough about your system to say whether or not SCI is best, but I think it's probably a good choice. Note that the boot loaders only load to RAM. If you want to load to flash, you need to load a flash kernel. We have an app note on the subject: http://www.ti.com/lit/pdf/sprabv4

    You can also refer to C2000Ware_1_00_06_00/device_support/f2837xs/examples/cpu1/F2837xS_sci_flash_kernel

    What board are you using for the F28377S? Is it a LaunchPad? Assuming you are, the USB interface provides a serial connection to SCIA over GPIOs 84 and 85. I don't think any of the SCI boot mode pins are brought out to the jumpers on the F28377S, so that may be your easiest option with the LaunchPad. I don't know how compatible this is with the Raspberry Pi board though.

    I believe the serial_flash_programmer is just for use on Windows PCs with the C2000 connected to a COM port via the USB connection I mentioned. You will need to write your own host side program for your Raspberry Pi. I think we share the source for the utility--you can study it and see if some of it can be reused.

    Whitney

  • I loaded  C2000Ware_1_00_06_00/device_support/f2837xs/examples/cpu1/F2837xS_sci_flash_kernel to the device and now the controller is responding during SCI boot mode.

    I have moved forward to the programming phase (load the kernel for flash programming using the raspberry pi), I am trying to code the host side program based on the source for the utility--.

    I will appreciate any other information for programming the host side program.

    Thanks.

  • Having never ported the host side myself, I don't have much advice to provide. How is it going? Did you get something running?

    Whitney
  • Hello,

    -I'm facing problems when loading the kernel to the controller, at the middle of the loading it always responds "A" when "D" has been sent (at the same data trend of the kernel),  I tried to troubleshoot the problem by sending a "D" just after the BaudLock is performed and the controller responds correctly with a "D". It seems that something into the data trend (kernel) makes the controller respond "A" instead of "D". Do you have any idea of what can be happening?

    I also ran the Serial Flash Programmer executable on windows to see if my host is not sending the data properly,  but:
    .\serial_flash_programmer.exe -p COM12 -d f2837xS -k .\F2837xS_sci_flash_kernel_cpu01.txt -b 9600 -v

    C2000 Serial Firmware Upgrader
    Copyright (c) 2013 Texas Instruments Incorporated.  All rights reserved.

    getting comm state
    building comm DCB
    adjusting port settings

    calling f021_DownloadKernel CPU1 Kernel
    Downloading .\F2837xS_sci_flash_kernel_cpu01.txt to device...

    Attempting autobaud to load kernel...
    Autobaud for kernel successful! Loading kernel file...
    a==a
    8==8
    0==67
    Data does not match... Please press Ctrl-C to abort.
    The windows executable just load two lines where mine loads almost half of the kernel, it exactly fails after the trend 61 A 6F 40 76 1A CA D.

    I tried to look for some information at:
    e2e.ti.com/.../712706
    e2e.ti.com/.../638536
    But did not have much help.

    -I Also was trying to get the function which is supposed to receive the kernel on the controller side but could not find it, after (at SCI_GetFunction.c):

    SCIA_Init(BootMode);
    SCIA_AutobaudLock();

    command = SCI_GetPacket(&length, data);
    It follows a sequence of "if" statements but all of them are related to the options when the controller is booting from the kernel (after loading the kernel). Could you help me to find this function?

    Thanks in advance.

  • Making sure the kernel works with the Windows executable first is a good idea. I've seen similar issues with the pre-built kernel .txt before (the ones in f2837xD_fw_upgrade_example). Instead of using those, see if regenerating a fresh .txt file by running the hex2000 utility (in the codegen tools bin folder) on the .out from the kernel project and loading that one instead works. There are directions in f2837xD_fw_upgrade_example.txt.

    The boot loader in ROM loads the kernel. All the boot ROM source can be found in C2000Ware_1_00_06_00\libraries\boot_rom\f2837xd. Look for the SCI_Boot.c file. There's also a .out for the ROM that will allow you to load the ROM symbols and step through the ROM code while you're debugging.

    Whitney
  • I have tried with a new kernel file obtained after compiling the code into ccs, and the same behavior was presented.

    I was checking the SCI_Boot.c code and it seems that it reads the data from the SCI channel and then it stores it into a RAM location.
    For running SCI_Boot.c is not supposed to have the kernel loaded first?
    Is this data been loaded to unsecured RAM?

    After the kernel is loaded, how do I make the controller start running the kernel?


    Juan D Gamba
  • Do you have a logic analyzer or oscilloscope you can use to check the data being sent? Have you tried loading the ROM symbols and stepping through the SCI boot loader to see where it's getting stuck?

    The boot loader in ROM is used to load the kernel into RAM. Once it's loaded, the boot loader code will jump to the start of the kernel program and execute it. Once it's executing you can transfer your application code over SCI and the kernel will load it into flash.

    Whitney