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.

To create .bin file from .out file

Other Parts Discussed in Thread: AM3359, SYSBIOS, PROFIBUS

Hello,

I'm using the AM3359 ICE board.

1) I want to flash the i2c_led example on to the NOR flash.In the project properties->Build->Steps->Post-Build Steps I gave the following:

"C:\ti\am335x_sysbios_ind_sdk_1.0.0.7\sdk\tools/post_build/post_build.bat" "C:\ti\ccsv5" "C:\ti\ccsv5\tools\compiler\arm_5.0.1" "C:\ti\am335x_sysbios_ind_sdk_1.0.0.7\sdk\examples\i2c_led\Debug" "i2c_led" "C:\ti\am335x_sysbios_ind_sdk_1.0.0.7\sdk\tools\isdk_image" "1" "2" "0x08010000" "0x08010000"

but the message on the console says:

'Finished building target: i2c_led.out'
' '
C:/ti/ccsv5/utils/bin/gmake --no-print-directory post-build
"C:\ti\am335x_sysbios_ind_sdk_1.0.0.7\sdk\tools/post_build/post_build.bat" "C:\ti\ccsv5" "C:\ti\ccsv5\tools\compiler\arm_5.0.1" "C:\ti\am335x_sysbios_ind_sdk_1.0.0.7\sdk\examples\i2c_led\Debug" "i2c_led" "C:\ti\am335x_sysbios_ind_sdk_1.0.0.7\sdk\tools\isdk_image" "1" "2" "0x08010000" "0x08010000"
'"C:\ti\ccsv5\tools\compiler\arm_5.0.1/bin/ofd470.exe"' is not recognized as an internal or external command,
operable program or batch file.
File does not exist: at XML_TI_OFD.pm line 877
'"C:\ti\ccsv5\tools\compiler\arm_5.0.1/bin/hex470.exe"' is not recognized as an internal or external command,
operable program or batch file.
Binary file does not exist in path
finished
' '

**** Build Finished ****

2)Where do I obtain boot_NOR.bin file????In the SDK getting started guide,it is mentioned that 

1. Flash NOR boot loader into ICE NOR flash
2. Ensure that a jumper is connected between pins 1 & 2 on J10
3. Flash application into NOR flash sector number 1

Thanks Savitha 

  • Hi Savitha,

    You are compiling with arm compiler version 5.x and unfortunately, Industrail sdk 1.0.0.7 does not support this compiler. Anyhow, there is workaround for this issue. Replace the post_build.bat found at $IA_SDK_HOME\tools\post_build with the attached one( You will have to rename this to post_build.bat) .

    I2c_led application will not execute from NOR as is. NOR build is not supported for i2c_led. I would suggest you to try the pre-built EtherCAT binary for NOR first. Also, please refer this thread http://e2e.ti.com/support/arm/sitara_arm/f/791/p/250270/895849.aspx#895849 for more details..

    Regards,

    Shahid

  • oops, missed out the attachment. Here it is..

    rem post_build.bat
    rem Copyright (c) 2012 Texas Instruments Incorporated ALL RIGHTS RESERVED
    
    rem ******************************************************
    rem This batch file Generates binary files from .out file  
    rem ******************************************************
    
    
    setlocal 
    
    set dirtemp="C:\isdk_temp_%random%_%random%"
    
    IF NOT EXIST %dirtemp% (
    mkdir %dirtemp%
    )
    
    set bintmp="%dirtemp%\appl_%random%_%random%_%random%.bin"
    
    set com_str=%2
    IF NOT x%com_str:tms470_4=%==x%com_str% (
    ECHO "COMPILER TMS_470_4_x"	
    call "%~1/utils/tiobj2bin/tiobj2bin.bat"  "%~3\%~4.out"  %bintmp% "%~2/bin/ofd470.exe"  "%~2/bin/hex470.exe"  "%~1/utils/tiobj2bin/mkhex4bin.exe"
    ) ELSE (
    ECHO "COMPILER ARM_5_x"
    call "%~1/utils/tiobj2bin/tiobj2bin.bat"  "%~3\%~4.out"  %bintmp% "%~2/bin/armofd.exe"  "%~2/bin/armhex.exe"  "%~1/utils/tiobj2bin/mkhex4bin.exe"
    )
    
    IF EXIST %bintmp% (
    copy /B %bintmp% "%~3\%~4.bin" /Y
    ) ELSE (
    echo Binary file does not exist in path
    goto FINISH
    )
    
    cd
    if "%~6" == "" (
    	echo Not adding headers
    	goto FINISH
    )
    cd "%~3"
    
    if "%~7" == "0" (
        rem Generate SPI and SD card Binaries
        "%~5\isdk_image.exe" %6 "1" "%~4.bin" "%~4" "%~8" "%~9"
        "%~5\isdk_image.exe" %6 "3" "%~4.bin" "%~4" "%~8" "%~9"
        goto FINISH
    ) ELSE (
        "%~5\isdk_image.exe" %6 %7 "%~4.bin" "%~4" "%~8" "%~9"
    )
    
    :FINISH
    
    IF EXIST %dirtemp% (
    rmdir /s /q %dirtemp%
    )
    echo  finished

    Regards,

    Shahid

  • Thanks Shahid.

    I started using the pre-built binaries.I ran i2c_led from the SPI Flash successfully.From the NOR Flash, I ran the Ethercat project. 4 green LEDs turned on but there was no display on the TeraTerm terminal as expected. Im not sure whether the result is ok or not.

    Next I intend to build my own binary files from the updated Post_Build.bat which you have attached.

  • That is the right behavior. EtherCAT is running from NOR. 

    You might not see UART messages as EtherCAT application prints messages only on startup. By the time PC detects and connects to the ICE UART, the application would have sent the messages.

  • Hi Shahid,

    Thanks for the timely help.

    1.I used the post_build.bat that you had attached and was successful in building .bin files for SPI and they worked on SPI too. Next I built .bin file for the profibus_slave (which is supposed to run from NOR).I added a few LEDs ON statements in the main so that I could see the program working.The profibus_slave example ran from SPI but No LEDs were ON from NOR. 

    2.I tried the ethercat example too from the NOR.The LEDs which were on by the prebuilt  .bin did not glow when I built it using the post_build.bat.

    What must be wrong????

    Regards

    Savitha

  • I assume you have done the boot jumper(I10) settings for NOR boot.

    Where in NOR did you flash Profibus application ? This need to be flashed to NOR sector 2.Where as EtherCAT application need to be flashed to sector 1.

    I have no clue why your application is not running from NOR. if you can give me map files for these two NOR builds, I will have a look into it.

    Meanwhile, you may do some debugging - please see this post http://e2e.ti.com/support/arm/sitara_arm/f/791/p/250270/895849.aspx#895849 

    Regards,

    Shahid

  • Hello,

    It is understood that sector 2 application runs from 0x08020000.

    But during erase, if I erase sector 2 the erase happens from 0x0810 0000. The memory sequence during erase of NOR Flash from

    0x0801 0000 to 0x0810 0000 to 0x0811 0000 to 0x0820 0000.....is not clear.The BOOT program logic supports this but we understand that size of each sector is 0x10000.

     Why the difference???

    Regards 

    Savitha

  • Hi Shahid,

    The profibus_slave executed from NOR Flash successfully. Please review this map file built for i2c_led.I have made the modifications as suggested in the thread.I put the break points and the execution halted at 0x08020010 as expected since I have flashed the application in sector 2 but the program didnt work.No LEDs turned on.Is there any change to be done in project properties????


    Regards Savitha

    8688.i2c_led._map.txt

  • Hi Savitha,

    You are right. The size of each NOR sector is 0x10000 (64K). The prints that you see can be ignored. It is erasing/flashing the sectors correctly. This came as a part of workaround that was done to overcome some pinmux restrictions .(Because of the pinmux restrictions on ICE board, some of the GPMC pins are not accessible for NOR)

    Regards,

    Shahid

  • I went through the map file and It looks fine. Since the execution halts at 0x0820010, its clear that boot loader could find the application at NOR sector 2.

    Do you know whether the application execution is coming to main ?

    To know this, once the execution is halted at main, load your application symbols(CCS->Run->Load->Load Symbols) and put a break point at main( Open Disassembly window and search for main). Resume execution and see if the execution reaches main.

  • Shahid,

    I put a breakpoint at the address where the main of i2c_led is located but the execution does not halt at that point.When I single step, it looks like there is some looping happening at TI_decompress rle core part but I am not too sure.So, the execution does not hit main at all.I also brought in the predefined symbol XIP_NOR which was present in profibus.If defined in the main there is a function call Cache_lock similar to profibus example.(I tried both with and without adding this extra code along with the symbol).The build properties also seem to match perfectly with profibus. Can you suggest me what to do next????

    Regards Savitha

  • Savitha,

    One possible cause I can think of is memory management unit (mmu) state. Can you see if mmu is disabled in .cfg file ? mmu need to be disabled by default for NOR app to work.

    Basically, you should have a line as given below. If not present, add this line to .cfg file and try again.

    Mmu.enableMMU = false;

    One more thing, you need to add the NOR memory into mmu page table.Please add below given line to application mmu ( applMmuEntries) structure.

    {(void*)0x08000000,(void*)0x08000000,0,1},  //NOR - Non bufferable| Cacheable

    Regards,

    Shahid

  • Missed out one thing. XIP_NOR is not required for i2c_led application. You may remove it from your application.

  • Thank you so much Shahid. The application started running successfully from NOR Flash after modifying the project as per your suggestions. 

    Regards Savitha

  • Ok. so the issue was mmu state .. Good to know that..

    Regards,

    Shahid