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/AM3358: Profibus Master boot issue

Part Number: AM3358
Other Parts Discussed in Thread: PROFIBUS, CCSTUDIO, SYSBIOS

Tool/software: Code Composer Studio

Hello, 

I'm going to boot my beagle bone black (Version C) platrorm with profibus master application form SD Card. I did the following steps:

1) I rebuilt PDK pakages using 

gmake all 

2) I renamed "C:\ti\pdk_am335x_1_0_7\packages\ti\starterware\binary\bootloader\bin\am335x-evm\gcc\bootloader_boot_mmcsd_a8host_release_ti.bin" into MLO

3) I built profibus master application with the following properties:

4) I converted   "C:\ti\PRU-ICSS-Profibus_Master_01.00.01.00\protocols\profibus_master\projects\profibus_master_AM335x_arm\AM335x_release\profibus_master_AM335x_arm.bin" into

"C:\ti\PRU-ICSS-Profibus_Master_01.00.01.00\protocols\profibus_master\projects\profibus_master_AM335x_arm\AM335x_release\profibus_master_AM335x_arm_ti.bin" using the following command

>> tiimage.exe 0x80000000 NONE "C:\ti\PRU-ICSS-Profibus_Master_01.00.01.00\protocols\profibus_master\projects\profibus_master_AM335x_arm\AM335x_release\profibus_master_AM335x_arm.bin"   "C:\ti\PRU-ICSS-Profibus_Master_01.00.01.00\protocols\profibus_master\projects\profibus_master_AM335x_arm\AM335x_release\profibus_master_AM335x_arm_ti.bin"

5) I renamed "_ti.bin" file to "app" 

6) I created SD card bootable using Win32DiskImager and prebuilt-sdcards image file 

7) I copied and pasted "app" and "MLO" files generated by myself into the bootabled SD card

8) I inserted SD card into my beagle bone black and I powered it on while I was pressing S2 button

9) I saw the following output messages on the terminal:

As you can see, the booting prusedure stopped at "Jumping to StarterWare Application ..." 

I searched about the above error and I found some solutions, but unfortunately those solutions did not work for me.

What should I do? What are my misstakes?

Thanks for your attention,

Hossein.

  • Hussein, thanks for sharing the steps. In a first glance they looks OK. But let me send you some comments/questions, for sanity check.

    1) Can you run you PRU-ICSS Profibus via CCS+JTAG? 

    2) Can you use prebuild MLO from PSDK folder (processor_sdk_rtos_am335x_4_00_00_04\prebuilt-sdcards\evmAM335x\sd_card_files)?. Being honest I am not totally sure why the same SBL can work on ICEv2 and BBB, however, from post from another user (Marcos) in your other E2E, it seems it works for him. I will ask internally to clarify this.

    3) Can you check your program entrance point address is indeed 0x80000000? You can check this in your application *.map by searching for .c_int00. If you see a different address you have 2 options.

    Option 1: force C_int00 to be at this address via *.cfg file by adding 

    Program.sectMap[".c_int00"].loadAddress = 0x80000000;

    Option 2: use current c_int00 address when converting your application binary to _ti.bin with tiimage.exe

    4) In your CCS project property -> connections, I see you have XDS100v2 pre-populated. No sure if matters, but I typically leave this space empty.

    Thank you,

    Paula

  • Thanks a lot for your comments. I'll answer you questions one by one.

    1) Unfortunately no, for the first time I attempted to run profibus application in debug mode but when I loaded my program on Cortex-A8 core and resumed the loaded program I could not see anything on the terminal. Then I switched to run my application by booting from SD card.

    2) Yes I can use prebuild MLO from PSDK folder (processor_sdk_rtos_am335x_4_00_00_04\prebuilt-sdcards\evmAM335x\sd_card_files). The application successfully runs but on the terminal it writes some messages like these:

    I2C test: Data miss match  

    I2C test: Data miss match  

    some tests have failed 

    Marcos sent for me his MLO and app files for profibus slave. Those work correctly. 

    3) I did not check this. I will check and report you as soon as possible.

    4) It does not matter. I left this space empty but nothing has changed. I don't think this option has any effect on building procedure.

    I hope my answers would helpful to you.

  • Hossein, for 1) CCS+JTAG, do you know if you are hanging somewhere? is any error report? or a crash?.. Maybe the app is the issue, if it is not working well then you would never get it working on SD card.

    Please check that first.

    thank you,

    Paula

  • Yes, I realized that the app file is the issue, because my MLO file works correctly with other application files. Actually I do not know what is the problem of app file? I just compiled the profibus master application with the properties which I mentioned above. I'm working on the app file to find the problem. I will report the results. 

  • Hello Hossein,

    Sorry for the delay, I was travelling yesterday. 

    I have tested the Profibus Master example and I can confirm it works with my setup. As I said I don't have any other slaves or BBB boards so I'm not able to test it completely, but at least I got the printouts on the terminal screen:

    Copying application image from UART to RAM is done                                                                                                 
    Jumping to StarterWare Application...                                                                                                              
                                                                                                                                                       
    Profibus Master Testing                                                                                                                            
     press any key to continue                                                                                                                         
                                                                                                                                                       
    Version - Profibus Master 1.0.1.0                                                                                                                  
    Profibus Master Sample application running on                                                                                                      
    Board name      : A335BNLT                                                                                                                         
    Chip Revision   : 00C0  BaudRate    :  12 MBaud                                                                                                    
                                                                                                                                                       
    ThisStation :  1                                                                                                                                   
    SlaveAdd    :  4, 3 , 7                                                                                                                            
                                                                                                                                                       
                                                                                                                                                       
    connecting board...                                                                                                                                
    Result of ConnectBoard:0x00                                                                                                                        
    LoadBusParameter:OK                                                                                                                                
                                                                                                                                                       
    Event: IN-RING                                                                                                                                     
    InitDPMaster:OK                                                                                                                                    
    LoadSlaveParameters:OK                                                                                                                             
    InitDPMaster:OK                                                                                                                                    
                                                                                                                                                       
    Event: IN-RING                                                                                                                                     
    StartDataExchange:OK                                                                                                                               
                                                                                                                                                       
                                                                                                                                                       
    OutputsAreOK : OK (0x00)                                                                                                                           
     - to end of program press any key....                                                                                                             
    

    If you get stuck in the Jumping to Starterware Application it means there is something wrong with your libraries. As far as I can tell, this can only happen due to the following:

    -I modified more files from the PDK than those I send (it was quite a manual and trial and error process so maybe I missed something). I will retrace my steps and try to see if this has been the case.

    -Your libraries were not compiled correctly. 

    -Some version mismatch is happening. Considering the changes in the code I don't think this is the case. 

    I'll be back to you soon with more details.

  • Hello again,

    To be completely sure I'm replicating my setup in a different computer starting from scratch. I will post step-by-step instructions later today buy in the meantime I just remembered a very silly mistake that set me back a couple of days.

    You need to make sure you are actually using the libraries you recompiled in CCStudio. To do that go to menu Windows-->Preferences and select Code Composer Studio-->Products. You should find the path where you placed the modified files under AM335x PDK--->Your version number.

    If you have a different folder you need to change the PDK's path to point to the right folder where the modified PDK files are. If you did have a different folder you were building your Profibus binaries against the original library and obviously, that won't work.

  • Hello Hossein,

    I have finally replicated my setup in a different computer starting from scratch and I can confirm the Profibus Master and Slave examples work as intended.

    There was a couple of issues though:

    1)There was a header file missing from the zip package I posted in my answer to your first question. This makes me think you were not compiling the libraries properly, otherwise you would have seen an undefined symbol error.

    2)You have to manually edit the configuration file on the Profibus example (am335x_app.cfg) and change the board to: Board.Settings.boardName = "bbbAM335x"; It seems that sometimes this is automatically changed when you define the board on the project properties menu, but double-check that you have the correct value on your files.

    These are the steps I followed:

    -Download and install TI CCStduio (805 MB for Linux, version 9.1.0.0) from
    software-dl.ti.com/.../ccs_downloads.html
    Select the Sitara AMx Processor family

    -Download and install TI Processor SDK RTOS for AM335x (674 MB for Linux, version 6.0.0.7) from software-dl.ti.com/.../index_FDS.html

    -Open CCS and add the RTOS packages to your list of products: go to menu Window-->Preferences and then select Code Composer Studio->Products, click on add to add a new path to the products discovery path and select the root folder where you installed the RTOS SDK (the default is /opt/ti on Linux). Then click on rediscover, select yes to install all new products and restart CCS.

    -Replace modified files with the ones I uploaded to your other forum question on this issue, here. Make sure you are replacing the files in the right folders and that the root is the same as the one you added in the previous step.

    -There is a header missing from the zip package. You can fix that with:

    /opt/ti/pdk_am335x_1_0_15/packages# cp ./ti/board/src/icev2AM335x/include/board_internal.h ./ti/board/src/bbbAM335x/include/board_internal.h
    

    -Prepare your environment for building the PDK:

    # export GMAKE_INSTALL_PATH=/opt/ti/ccs910/ccs/utils/bin/
    
    # export ISA=a8
    
    /opt/ti/pdk_am335x_1_0_15/packages# source pdksetupenv.sh

    -Now you are ready to build, first clean all with:

    opt/ti/pdk_am335x_1_0_15/packages# make clean
    

    -And build with:

    /opt/ti/pdk_am335x_1_0_15/packages# make all PLATFORM=am335x-evm SOC=am335x profile=release

    If you don't specify the platform and soc variables it will take longer to compile everything.  The building process should take several minutes, but you should not get any errors. Check the output carefully to see if you are getting any errors.

    -Move to the starterware folder (./ti/starterware) and compile the bootloader:

    opt/ti/pdk_am335x_1_0_15/packages/ti/starterware# make -s bootloader BUILDCFG=boot BOOTMODE=mmcsd PLATFORM=am335x-evm PROFILE=release -s KW_BUILD=no ENABLE_PRU=yes

    You can change BOOTMODE to uart if you prefer (as I do) to boot from UART.

    -Download the Profibus Master or Slave examples from here.

    -Install the example, I use folder /opt/ti/ccs910/ccs to have everything in one place and be able to run the scripts  with minor modifications.

    -Move to folder: ./PRU-ICSS-Profibus_Master_01.00.01.00/protocols/profibus_master/projects and edit projectCreate.sh
    You will need to make several modifications on this file:
    First, add a line at the top of the user configuration section with: PROFIBUS_MASTER_DOT_VERSION=01.00.01.00
    Change the first line (now second) of the user configuration section to: CCS_INSTALL_DIR=/opt/ti/ccs910/ccs/
    Change AM335x_PDK_INSTALL_PATH=$HOME/ti/pdk_am335x_1_0_7/packages to your version number, if you installed the
    latest version of the PDK that would be AM335x_PDK_INSTALL_PATH=$HOME/ti/pdk_am335x_1_0_15/packages
    Do the same with AM335x_PDK_VERSION=1.0.7, changing it to AM335x_PDK_VERSION=1.0.15
    Change the PDK install path to AM335x_PDK_INSTALL_PATH=/opt/ti/pdk_am335x_1_0_15/packages
    Update IS_SDK_HOME to IA_SDK_HOME=$CCS_INSTALL_DIR/PRU-ICSS-Profibus_Master_${PROFIBUS_MASTER_DOT_VERSION}
    Change version numbers for all products XDC, SYS_BIOS, NDK and EDMA. You can check the versions you have installed
    on your system under the CCS product section as we said above. If you go with the latest versions, those should be:

    XDC_TOOLS_VERSION=3.55.02.22_core
    SYS_BIOS_VERSION=6.75.02.00
    NDK_VERSION=3.60.00.13
    EDMA_VERSION=2.12.5

    These changes are important, if you don't use the right versions you'll be able to create the project but you might get errors while trying to compile.

    -Save and run the script to create the project with:

    opt/ti/ccs910/ccs/PRU-ICSS-Profibus_Master_01.00.01.00/protocols/profibus_master/projects# ./projectCreate.sh AM335x arm profibus_master
    

    -Now you can open CCS and import the Profibus example project you just created.

    -Then edit the project properties to change the target processor and platform to the BBB and remove the linker command line.

    -From CCS open file am335x_app.cfg and edit the board to target the BBB: update board name to Board.Settings.boardName = "bbbAM335x";

    -Build project

    -Copy the bootloader (renaming to MLO) that you compiled above and the app binary file from the Profibus Master folder

    -Boot and you should see the console output as above

  • Hello Marcos, 

    Thank you very much. You are very kind and intelligent and you really helped me. It is nice of you. 

    I do not access to my board at this time but I will check your steps very soon and I hope that it will work.

    Thanks for your guidance. 

  • Hello Hossein,

    You're welcome. No hurry, just let me know if you need further details.

  • Hello Marcos,

    I followed your instructions carefully, but I faced some problems for extracting and importing profibus master application into  CCS. 

    First of all, when I tried to creat profibus  project using  "projectCreate.bat" file, I received the  following warning 

    This warning is produced because of miss match between  GNU_4.9.3 (which is defined in projectCreate.bat file) and  GNU_7.2.1 (which is currently available version for GNU). However I think this is not important because the system chooses the current version of the GNU for creating project. I just have one question. In documents it is written that compatible version of RTOS SDK for profibus master application  is  04.00.00.04 and related version of CCS for this SDK is CCS 7.1. We are  actually  using SDK 06.00.00.07 and CCS9.1.0.00010. Why? Can profibus master application work with these versions of SDK and CCS?

    To add more, when I tried to import created profibus master application into CCS, I faced the following problem 

    As you can see I could not import the project into my CCS. What is the source of this problem?  Can you help me to solve this problem?

    Regards,

    Hossein

  • My host platform is running Windows 7. Are your modified files (which you uploaded for me before) compatible with Windows? I realized your host platform is linux and I think your modified PDK is based on linux, maybe problem is here

  • Hello Hossein,

    As far as I can tell, the changes I introduced should work for both Windows and Linux. At some point I wanted to test on Windows but I haven't done it yet.

    The GCC version warning should not be a problem either, I get it to.

    Regarding the import error I think you have to delete any other projects with the same name on CCS and you should be able to import.

  • I've deleted all the projects, but I still can not import project into CCS. You did not face this problem?

  • I did have the issue when I imported before deleting the old project but once I deleted from inside CCS the project was successfully imported. Have you deleted inside CCS?

  • You are right, I deleted projects inside CCS and I could import projects. I built the project and received 5 errors. I will upload here the errors.

  • Hossein, FYI, you can't have 2 projects with the same name in a CCS workspace. You can always create another workspace if you need to import the same project from anther location without deleting the first one.. just 2-cents comment.

    Also, if you haven't, I would recommend you to first build and run PRU-ICSS Profibus Master for AM335x board. This exercise will ensure you would have the correct tools version for building it and will help you to get more familiar with CCS. 

    thank you,

    Paula

  • Hello Hossein,

    I got those errors too. I did not have time to look at them in detail but I think it's related to the XDC version.

    According to this post:

    XDC tools used to include a system call stub library for GNU A8 targets prior to XDC 3_25_02_65. With 3_25_02_65, XDC tools has stopped shipping this library. The application now needs to be linked with librdimon/libnosys (depending on whether semi-hosting support is enabled or not).


    For the moment I just commented the line out to compile but as I said I cannot be sure if the Master is going to work. We'll probably have to link to these other libraries mentioned in the paragraph above.

  • Hello Hossein,

    I managed to fix the error you mentioned above (undefined reference to `ti_sysbios_rts_gnu_ReentSupport_checkIfCorrectLibrary').


    It was indeed a problem related to mixing different product versions. There is a nice migration guide for SYS/BIOS v6.51 and newer here.

    What you have to do is:

    1)Change SYS/BIOS library path: go to project properties-->GNU linker-->Library search path box and change the last entry ${BIOS_CG_ROOT}/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu to ${BIOS_CG_ROOT}/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/hard

    2)In the same GNU linker window go to Miscellaneus and add a new flag with: --specs=nano.specs . This will select the newlib-nano as your C runtime library.

    I found the solution in this forum post

    Once you do that you should be able to rebuild the Profibus Master app with no errors. I think this one should work out of the box but as I mentioned a number of times I don't have another BBB to test the Master-Slave combination.

    Let me know what you think.

  • Hello Paula,

    Yes you are right. I should try to be more familiar with CCS and TI-RTOS because I want to apply some modification in profibus master application. 

    Thanks a lot for your guidance,

    Hossein

  • Hello dear Marcos,

    It has been done. I could boot my BBB with profibus master application successfully. I appliyed above modifications and my program was built successfully without error. I converted ".bin" file into "_ti.bin" file and  renamed it to "app". Then I copied and pasted "MLO" and "app" files into SdCard. After that my board boots successfully with profibus master application.

    Now, I am ready to work with this application.

    Thank you and those who helped me to solve this problem.

    I will share here my future experiences about profibus.

    Sincerecly yours,

    Hossein