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.

CCS/AM3359: Running EtherCAT application from SD card

Part Number: AM3359
Other Parts Discussed in Thread: SYSBIOS,

Tool/software: Code Composer Studio

I recently received an AM3359 module to develop an EtherCAT slave. I have successfully built an EtherCAT slave based on the Beckhoff Slave Stack tool and have it running with the debug probe. I based the project on the EtherCAT demo in sysbios 2.1.3.2, and added the slave stack files and removed the ethercat library. I thought I'd see if I could put the app on an SD card. If I take the release version of ethercat.out generated by CCS6.1.3 and type:

C:\ti\AM335X_StarterWare_02_00_01_01\tools\ti_image\tiimage.exe 0x8000000 NONE ethercat.out app

and place it along with the MLO file on a FAT32 formatted SD card, and reset the board, I see:

Copying to RAM completed successfully
 Image Copy Successful, Executing Application..

but nothing else. Any ideas as to what I might be doing wrong would be greatly appreciated.

Is my call to tiimage correct?

I see I have both an ethercat.bin and ethercat_ti.bin, but don't why there are 2 bin files.

Thanks for any help!

  • The EtherCAT experts have been notified. They will respond here.
  • the file ethercat.bin will be used when you are booting using UART boot modes while  _ti.bin file is used when MMCSD, NAND,  McSPI/QSPI boot modes. The _ti.bin file adds a image header with load address and load size to the binary file.

    The process to convert a .out to _ti.bin is as follows:

    TOOLCHAIN_PATH_<A8/A9>/bin/arm-none-eabi-objcopy -O binary <application>.out <application>.bin
    
    tiimage.exe <Image Load Address> NONE <application>.bin <application>_ti.bin

    If you are using industrial SDK, I believe that SDK provides as post_build.bat script to generate the images as described here:

    From your description, it appears that the RBL is able to read and load the MLO and it was able initialize the SOC (clocks, UART, etc ) and copied the image over but the application didn`t start. Since the issue is in the SBL, which is user level bootloader, you can do a CPU reset using emulator and debug this in the secondary bootloader and root cause the issue.

    Hope this helps.

    Regards,

    Rahul

  • Thanks for the quick response! I see you are pointing me at the version 01.01.00.08 user guide. I'm using version 02.01.03.02 http://processors.wiki.ti.com/index.php/AM335x_SYSBIOS_Industrial_SDK_Getting_Started_Guide. Unless I missed something, it seems I should be able to copy the MLO file and the ethercat demo application (as app) to the SD card and it should boot and run. I'm not seeing this.

    Also, when I build the application, I thought I was supposed to use the tiimage application to convert the ethercat_ti.bin file to app, rather than simply copy ethercat.ti_bin to app on the SD card.

    I'm confused by the various formats (.out, .bin, etc.) and the various header types (UART, SPI, NOR, etc). Is there some useful reference that describes these formats?

    Thanks again,

    Robert

  • The image formats for bootloader is described in the TRM under Initialization chapter. The boot tools in industrial SDK are using the Starterware tools that are documented in here:
    processors.wiki.ti.com/.../AM335X_StarterWare_Booting_And_Flashing

    When the boot fails, can you connect to the ARM and see if the ARM core is executing in the SBL memory space or in the ethercat application memory space. From the UART log, it appears the MLO booted and the application was copied and the control was passed to the application.

    Also, can you specify if you are using pre-built binary or did you build the ethercat out file. If you built the ethercat app , can you try to see if the pre-built binaries are booting in your setup.


    Regards,
    Rahul

  • Robert, Rahul is pointing you to the right information =). I think in your case you just need to rename  <application>_ti.bin to app and your app should work. A quick way to test that your SD card is correctly formatted is to try a pre-build binary. You can download pre-build binaries from SYSBIOSSDK-IND-SITARA

    thank you,

    Paula

  • Thanks for the comment, Paula.
    I did try to rename ethercat_ti.bin to app, but with the same results.
    So I tried copying the prebuilt files applications\ethercat\am335x_release\SD\app and bootloaders\AM335X_ICEv2.1\mmcsd_release\MLO, again with the same result:
    *** StarterWare Boot Loader. Build - 1.0.8 for ICE V2
    Copying application image from MMCSD to RAM

    Copying to RAM completed successfully
    Image Copy Successful, Executing Application..

    Then nothing. Can I have other files on the SD card? (I renamed the old MLO and app files before copying over the new ones. I'm using a 8GB SD card from SanDisk, formatted by the HP utility as FAT32.

    Thanks again!
  • Robert what about, Maybe do you have something in SPI flash?, some new boards has a pre-flashed application. Also please check you have correctly setup boot jumpers.

    From one of ours ISDK getting started guides

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    The device supports SPI , MMC/SD and NOR boot mode through ARM ROM Bootloader. Boot boot mode selection is determined by the state of pins on J5. ( See ICE V2 Picture for pin markings)

    MMC/SD Boot

         Pin 2 & 3 shorted  on J5. 
         ROM Bootloader looks for a file named 'MLO' in SD card and if found, loads it to IRAM and executes it. Please note that, SPI bootloader should NOT be present in SPI flash.

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    You can erase flash following steps from:

    SPI Flashing using CCS  --> my recommendation, it is easier

    SPI Flashing using SD Card

    Thank you,

    Paula

  • I had assumed that since it said it was copying the application from MMCSD to RAM that it was loading the app from the SD card. And since it didn't run the application in SPI, that wouldn't be the issue. Just to be sure, I erased the SPI application, but see no difference (other than the default application no longer runs). I then erased the bootloader too, but with the same result. I've tried changing the J5 jumper before and tried it again with no change.

    Any other ideas?

    I've tried setting the target configuration to both AM3359 and ICE_AM3359 to see if I saw any differences, but I see none (I'm not sure what the difference between the two is supposed to be - I'm using the V2 board, not the EVM).

    Thanks again,

    Robert

  • Robert, I think the best next step would be to connect a JTAG and debug with CCS, as suggest for Rahul above. Your procedure and steps looks correct to me, so no really sure what it can be.

    Echoing Rahul, from console log, it appears the MLO booted and the application was copied and the control was passed to the application, so when you connect to CCS you could see where in the program it stuck.

    thank, you,

    Paula