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.

Trying to boot off of MicroSD card

Other Parts Discussed in Thread: SYSBIOS, AM3352

I have an issue TI supplied two different utilities ti_image.exe and isdk_image.exe which one is recommended. The example all use ti_image.exe but  isdk_image.exe seems newer.

Aaron

  • Whatever I do it does not seem to boot off the microSD card.

    ..\post_build.bat "C:\ti\ccsv5" "C:\ti\ccsv5\tools\compiler\arm_5.0.6" "..\Debug" "simple" "C:\ti\am335x_sysbios_ind_sdk_1.1.0.1\sdk\tools\isdk_image" "1" "1" "0x08000000" "0x08000000"

    I build simple.out and it gets converted to an out file then then is renamed "app" which is put on with the supplied  MLO (from C:\ti\AM335X_StarterWare_02_00_01_01\binary\armv7a\cgt_ccs\am335x\evmskAM335x\bootloader\Release_MMCSD) on the microSd.

    I think I have all 16 sysboot correct. The same app woks when downloaded via the debugger.

    Aaron

  • Note we have a 4Gig microSD card. On another forum it hints that may be a problem from MMC0 is this true or not?

    Technically it is 3.7 gigs. But it is listed as 4GB Class 10 MicroSD HC.

    http://e2e.ti.com/support/arm/sitara_arm/f/791/t/258875.aspx

    Do we need a smaller microSD?

    Aaron

  • Aaron,

    Can you provide more information on which board you are using? Here are my comments on your queries

    • ti_image.exe is used by Starterware. ISDK uses isdk_image.exe as it has certain additional fields in the header attached to the binary. So if you are using  the bootloader from Starterware, and binary based on isdk_image.exe, it won't work
    • While renaming the binary to "app", make sure you rename the *_SD.bin and not the *.out file
    • In the script you provided - 
      "C:\ti\am335x_sysbios_ind_sdk_1.1.0.1\sdk\tools\isdk_image" "1" "1" "0x08000000" "0x08000000"
      The load address and start address is given to a NOR location, is this what is required? Can you try loading to DDR first?

    Regards,
    Vinesh

  • Vinesh,

    I did copy the _SD.bin version to app also, I just tried the getting the bootloader (stated that wrong) from C:\ti\am335x_sysbios_ind_sdk_1.1.0.1\sdk\starterware\binary\armv7a\cgt_ccs\am335x\evmAM335x\bootloader  instead the _SD version and copying it and renaming it to MLO.

    Also, also changed the 0x80000000s to the addresses in the map file that points to _c_int00 (entry point).

    What am I missing? 

    I even removed all the partitions off of the MicroSD card and created one active partition and reformatted it. Still no luck the same code runs if I download via the debugger out of DDR.

    Aaron

  • Aaron,

    I moved this thread over to the StarterWare forum as it seems a more appropriate place for this question and I'm hoping you'll get further responses there from the TI experts.

  • Note, this code is SYSBIOS based. So, why it was shifted out the other forum I don't know.

    Also, add that I verified in the CONTROL_STATUS register that the SYS_BOOT pins were read correctly.

    Also, note via code loaded from our debugger that we could read and write the microSD card.

    Aaron

  • For clarity...

    This now my best guess of the command line...

    ..\post_build.bat "C:\ti\ccsv5" "C:\ti\ccsv5\tools\compiler\arm_5.0.6" "..\Debug" "simple" "C:\ti\am335x_sysbios_ind_sdk_1.1.0.1\sdk\tools\isdk_image" "1" "1" "80000000" "8003ee98"

    Load address = 0x80000000

    Run address =  0x8003ee98 

    Aaron

  • Aaron,

    If you are using isdk_image.exe, the Starterware bootloader will NOT be able to load the binary as there is slight difference in the header added to the *.out . 

    You can find more info on the post build script here -  http://processors.wiki.ti.com/index.php/AM335x_SYSBIOS_Industrial_SDK_01.01.00.03_User_Guide#Generating_Executable_Binary_-_Post_Build_Script

    Please find more details on formatting the SD card here -  http://processors.wiki.ti.com/index.php/AM335x_SYSBIOS_Industrial_SDK_Getting_Started_Guide#Running_Pre-Built_Applications_on_AM335x_IDK

    Also, which board are these tests based on? Please note that ICEv1 do NOT support SD card bootloader.

    Regards,
    Vinesh

  • Vinesh,

    Our board is based on the evmskAM335x we have an AM3352. I have the SYS_BOOT set to boot off of the MMC0.

    I am not using the starterware bootloader I am using the SYSBIOS one of the boot_SD,bin (renamed it  to MLO) out of the am335x_sysbios_ind_sdk_1.1.0.1. 

    That came from C:\ti\am335x_sysbios_ind_sdk_1.1.0.1\sdk\starterware\binary\armv7a\cgt_ccs\am335x\evmAM335x\bootloader directory.

    Do you mean to tell me I can not use the bootloader provided in this directory under am335x_sysbios_ind_sdk_1.1.0.1 to boot?

    As for the post_build.bat I copied it into my local directory and it successfully builds test_SD.bin which I rename to app.

    In the end I copy over app and MLO to my microSD card.

    Aaron

  • Aaron,

    ISDK only supports ICE and IDK boards, evmsk is not supported. The bootloader might not work as desired.

    Starterware supports evmsk, so you can give a try using Starterware SD bootloader and ti_image.exe for creating binaries.

    Regards,
    Vinesh

  • Vinesh,

    It did not work. 

    Maybe I am missing a step.

    1. I start with my app that I have tested via the JTAG debugger. It is called simple.out. This is a COFF file.
    2. So, I need to get a simple.bin (which tool do you recommend to do that?). I assuming this is a stripped binary. At present the only utility which creates that stripped bin file was part of  the post_build.bat which called tiobj2bin.bat. (is this correct).
    3. Then I would take the resulting simple.bin and feed it through tiimage.exe with the following command line.
      tiimage.exe 0x80000000 NONE simple.bin app
    4. I would copy the newly created app and the MLO (from C:\ti\AM335X_StarterWare_02_00_01_01\binary\armv7a\cgt_ccs\am335x\evmskAM335x\bootloader\Release_MMCSD) to my microSD.

    A couple of notes:

    • Even if I screwed up my app file I expected to see output on UART0. Is that a reasonable expectation?
    • Aside from SYS_BOOT value which I verified the switches which drive them on our board are correct and the correct value get latched via the control_status register and by downloading the same code via the debugger what other clues does the AM3352 give to why it is not booting?
    • I would add this process needs to be better documented starting from which tools as well as how to convert the binaries and SD card rules...
    • Also what does not make sense is that if the SYS_BOOT [4:0] is 10111 then it should fallback to the UART0 (and regardless of the what is going on with the MMC0) I would see something on UART0. Is this also a correct understanding?
    • Are there any other signals I should check that need or should be set to allow it to boot from the MMC that maybe were missed by our hardware design? The board powers up and is able to run via the JTAG so, it is not completely dead. 

    Thank you,

    Aaron

  • Aaron,

    I assume there should be some UART messages in the Starterware SD bootloader, are you getting those on a Terminal? If no, then it means that the bootloader has failed to execute, so there is no question about the app getting loaded/executed.

    The starterware team might be able to give more inputs on these.

    Regards,
    Vinesh

  • Vinesh,

    Something else, is more fundamentally wrong. I have SYS_BOOT [4:0] set to 10111 which should first try MMC0, then SPI, then UART 0, then USB. Even if my images were totally wrong I should still get something on UART0 I would think. So, I just tried an experiment and set it up to boot from UART0 1st and I get a handful of Cs. But, if I go back to 10111 MMC0 1st I get no signs of life if the microSD card is in the slot if I pull the microSD card I get a steady stream of Cs out the UART.

     

     

    This proves to me in part it is trying to talk to the microSD card. Why don't I see the Cs since it clearly did not like the microSD? Note we have test that from the debugger we can do simple read and writes to the microSD card but, since I don’t know what modes the bootrom uses.


     

    My latest question: Is what if any indication does the boot rom give if it does not like the microSD card or the data on it?

     Aaron

  • One more additional data point.

    I tried booting off of UART0 as well I downloaded boot.bin from C:\ti\AM335X_StarterWare_02_00_01_01\binary\armv7a\cgt_ccs\am335x\evmskAM335x\bootloader\Release_UARTand it downloads but does not give me any signs of life.

    So, according to the wiki...

    Stages in UART Booting

    • Stage 1: On System reset, the ROM Code expects the StarterWare Bootloader via XMODEM from the UART console. (prints CCC.. on the UART console)
    • Stage 2: The StarterWare Bootloader image compiled for UART boot mode, boot.bin (without header) can be sent via XMODEM protocol. the ROM code copies the bootloader image onto OCMC RAM, hands over the execution control to StarterWare Bootloader.
    • Stage 3: The StarterWare Bootloader will expect an application image to be sent through UART console via XMODEM. (prints CCC.. on the UART console) 
    • Stage 4: The StarterWare application image (<image>.bin, without header), can be sent via XMODEM through UART console. The StarterWare Bootloader copies this application image to DDR and the application starts execution.

    But after I download boot.bin it does not look like the bootloader started. I never see the CCC.. from stage 3.

    So, I guess I might need to rebuild bootloader is thier a CCS project for it? So, might be able to debug the TI bootloader.

    Aaron

  • I suspect it is something about out board design that causes the bootloader to crash or get hung up.

    But, I have no way of debugging it until I ca build the bootloader but, I don't have the project file. Then I could compile and link my own bootloader code and walk though it on the JTAG.

    Aaron

  • Aaron, 

    The project files of the Bootloader should be available in the "build" folder of Starterware.

    Regards,
    Vinesh

  • Correction it is there but it does not build...


    **** Build of configuration Debug_MMCSD for project boot ****

    "C:\\ti\\ccsv5\\utils\\bin\\gmake" -j 4 -s -k all
    'Building file: C:/ti/AM335X_StarterWare_02_00_01_01/bootloader/src/bl_copy.c'
    'Building file: C:/ti/AM335X_StarterWare_02_00_01_01/bootloader/src/bl_hsmmcsd.c'
    'Building file: C:/ti/AM335X_StarterWare_02_00_01_01/bootloader/src/armv7a/cgt/bl_init.asm'
    'Building file: C:/ti/AM335X_StarterWare_02_00_01_01/bootloader/src/bl_main.c'
    'Invoking: ARM Compiler'
    'Invoking: ARM Compiler'
    'Invoking: ARM Compiler'
    'Invoking: ARM Compiler'
    'Finished building: C:/ti/AM335X_StarterWare_02_00_01_01/bootloader/src/armv7a/cgt/bl_init.asm'
    ' '
    'Building file: C:/ti/AM335X_StarterWare_02_00_01_01/bootloader/src/armv7a/am335x/bl_platform.c'
    'Invoking: ARM Compiler'
    'Finished building: C:/ti/AM335X_StarterWare_02_00_01_01/bootloader/src/bl_main.c'
    'Finished building: C:/ti/AM335X_StarterWare_02_00_01_01/bootloader/src/bl_copy.c'
    ' '
    ' '
    'Building file: C:/ti/AM335X_StarterWare_02_00_01_01/system_config/armv7a/cache.c'
    'Building file: C:/ti/AM335X_StarterWare_02_00_01_01/system_config/armv7a/cgt/cp15.asm'
    'Invoking: ARM Compiler'
    'Invoking: ARM Compiler'
    'Finished building: C:/ti/AM335X_StarterWare_02_00_01_01/bootloader/src/bl_hsmmcsd.c'
    'Finished building: C:/ti/AM335X_StarterWare_02_00_01_01/system_config/armv7a/cgt/cp15.asm'
    ' '
    ' '
    'Building file: C:/ti/AM335X_StarterWare_02_00_01_01/system_config/armv7a/am335x/device.c'
    'Building file: C:/ti/AM335X_StarterWare_02_00_01_01/third_party/fatfs/port/fat_mmcsd.c'
    'Finished building: C:/ti/AM335X_StarterWare_02_00_01_01/system_config/armv7a/cache.c'
    'Invoking: ARM Compiler'
    'Invoking: ARM Compiler'
    ' '
    'Building file: C:/ti/AM335X_StarterWare_02_00_01_01/third_party/fatfs/src/ff.c'
    'Invoking: ARM Compiler'
    'Finished building: C:/ti/AM335X_StarterWare_02_00_01_01/bootloader/src/armv7a/am335x/bl_platform.c'
    'Finished building: C:/ti/AM335X_StarterWare_02_00_01_01/system_config/armv7a/am335x/device.c'
    ' '
    ' '
    'Building file: C:/ti/AM335X_StarterWare_02_00_01_01/system_config/armv7a/mmu.c'
    'Invoking: ARM Compiler'
    'Finished building: C:/ti/AM335X_StarterWare_02_00_01_01/third_party/fatfs/port/fat_mmcsd.c'
    ' '
    'Finished building: C:/ti/AM335X_StarterWare_02_00_01_01/system_config/armv7a/mmu.c'
    ' '
    'Finished building: C:/ti/AM335X_StarterWare_02_00_01_01/third_party/fatfs/src/ff.c'
    ' '
    'Building target: ../../../../../../../binary/armv7a/cgt_ccs/am335x/evmskAM335x/bootloader/Debug_MMCSD/boot.out'
    'Invoking: ARM Linker'
    <Linking>
    error #10008-D: cannot find file
    "../../../../../../../binary/armv7a/cgt_ccs/utils/Debug/utils.lib"
    error #10008-D: cannot find file
    "../../../../../../../binary/armv7a/cgt_ccs/mmcsdlib/Debug/libmmcsd.lib"
    error #10008-D: cannot find file
    "../../../../../../../binary/armv7a/cgt_ccs/am335x/drivers/Debug/drivers.lib
    "
    error #10008-D: cannot find file
    "../../../../../../../binary/armv7a/cgt_ccs/am335x/evmskAM335x/platform/Debu
    g/platform.lib"

    undefined first referenced
    symbol in file
    --------- ----------------
    BoardInfoInit ./bl_platform.obj
    GPIO0ModuleClkConfig ./bl_platform.obj
    GPIODirModeSet ./bl_platform.obj
    GPIOModuleEnable ./bl_platform.obj
    GPIOModuleReset ./bl_platform.obj
    GPIOPinWrite ./bl_platform.obj
    GpioPinMuxSetup ./bl_platform.obj
    HSMMCSDBlkLenSet ./bl_hsmmcsd.obj
    HSMMCSDBusFreqConfig ./bl_hsmmcsd.obj
    HSMMCSDBusWidthConfig ./bl_hsmmcsd.obj
    HSMMCSDCardPresent ./bl_hsmmcsd.obj
    HSMMCSDCmdSend ./bl_hsmmcsd.obj

    HSMMCSDControllerInit ./bl_hsmmcsd.obj
    HSMMCSDIntEnable ./bl_hsmmcsd.obj
    >> Compilation failure
    HSMMCSDIntrStatusClear ./bl_hsmmcsd.obj
    HSMMCSDIntrStatusDisable ./bl_hsmmcsd.obj
    HSMMCSDIntrStatusEnable ./bl_hsmmcsd.obj
    HSMMCSDIntrStatusGet ./bl_hsmmcsd.obj
    HSMMCSDModuleClkConfig ./bl_platform.obj
    HSMMCSDPinMuxSetup ./bl_platform.obj
    I2C0ModuleClkConfig ./bl_platform.obj
    I2CAutoIdleDisable ./bl_platform.obj
    I2CMasterBusBusy ./bl_platform.obj
    I2CMasterControl ./bl_platform.obj
    I2CMasterDataGet ./bl_platform.obj
    I2CMasterDataPut ./bl_platform.obj
    I2CMasterDisable ./bl_platform.obj
    I2CMasterEnable ./bl_platform.obj
    I2CMasterInitExpClk ./bl_platform.obj
    I2CMasterIntClearEx ./bl_platform.obj
    I2CMasterIntRawStatus ./bl_platform.obj
    I2CMasterSlaveAddrSet ./bl_platform.obj
    I2CMasterStart ./bl_platform.obj
    I2CMasterStop ./bl_platform.obj
    I2CPinMuxSetup ./bl_platform.obj
    I2CSetDataCount ./bl_platform.obj
    I2CSoftReset ./bl_platform.obj
    I2CSystemStatusGet ./bl_platform.obj
    MMCSDBusWidthSet ./fat_mmcsd.obj
    MMCSDCardInit ./fat_mmcsd.obj
    MMCSDCardPresent ./bl_hsmmcsd.obj
    MMCSDCtrlInit ./bl_hsmmcsd.obj
    MMCSDIntEnable ./bl_hsmmcsd.obj
    MMCSDReadCmdSend ./fat_mmcsd.obj
    MMCSDTranSpeedSet ./fat_mmcsd.obj
    MMCSDWriteCmdSend ./fat_mmcsd.obj
    UARTPuts ./fat_mmcsd.obj
    UARTStdioInit ./bl_platform.obj

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "../../../../../../../binary/armv7a/cgt_ccs/am335x/evmskAM335x/bootloader/Debug_MMCSD/boot.out" not built
    gmake: *** [../../../../../../../binary/armv7a/cgt_ccs/am335x/evmskAM335x/bootloader/Debug_MMCSD/boot.out] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

    Aaron

  • Aaron,

    The console logs indicate that the library files are missing. Can you make sure that the files exist in the path? If not, it might be required to build those first.

    Regards,
    Vinesh

  • It turns out the bootloader in starterware only supplied release libraries...

    So, I go it to build if I build a debug version but pointing to release libraries. But, was able to debug one issue. We don't have the eeprom that store the board ID info. Which is not even used with evmsk boards. If you are not using the Board ID info don't read it. Either way i forced it to 1.3 board. (closest to our design).

    So, then is starts but has an invalid entry point since starterware fixes it to 0x80000000 but with SYSBIOS it is elsewhere. This is my next issue.

    Aaron

  • Notes to save others some headaches while booting from microsd card and using the bootloaders.

    1. The bootloader in starteware assumes you have an eeprom for board ID also it makes assumptions about the contents of that eeprom. Comment that out if you don't want to be tied to it.
    2. If to want to debug either bootloader (startewware or SYSBIOS) they have many hardcoded paths relative to the c:\ti directory they reside and therefore the project cannot be copied into your workspace.
    3. For either bootloader (startewware or SYSBIOS) TI only supplies the release libraries (not the debug) so, either you need to rebuild them or you need to point to the release libraries in your linker path.
    4. ti_image is to be used only with starterware (it assumes the entry point is at exactly 0x80000000.
    5. isdk_image for SYSBIOS applications,
    6. If you want to have UART access the bootloader (SYSBIOS) is set to UART3 modify the code to point to UARTx wherever your hardware needs,
    7. You make need to change the float support under compiler options to get the bootloaders to link they need to match the setting in the libraries.

    There are several important details that are spread across the wiki and many other documents...

    This is the sequence to get a .out image into the form for the microSD

    1. Build my code (simple.out).
    2. "C:/ti/ccsv5/utils/tiobj2bin/tiobj2bin" "simple.out" "simple.bin" "C:/ti/ccsv5/tools/compiler/arm_5.0.6/bin/armofd" "C:/ti/ccsv5/tools/compiler/arm_5.0.6/bin/armhex" "C:/ti/ccsv5/utils/tiobj2bin/mkhex4bin"
    3. isdk_image.exe 1 1 simple.bin app 0x80022ba0 0x8003ee9c  (the addresses here must match your map file the 0x80022ba0 is the first initialized ram the documentation is wrong is say the first ram address, the 0x8003ee9c  is address of the entry point of your code)
    4. rename app_SD.bin to app
    5. Copy to microSD card

    The same thing for the bootloader is...

    1. Build my code (boot.out).
    2. "C:/ti/ccsv5/utils/tiobj2bin/tiobj2bin" "boot.out" "boot.bin" "C:/ti/ccsv5/tools/compiler/arm_5.0.6/bin/armofd" "C:/ti/ccsv5/tools/compiler/arm_5.0.6/bin/armhex" "C:/ti/ccsv5/utils/tiobj2bin/mkhex4bin"
    3. tiimage.exe 0x402F0400 MMCSD boot.bin MLO
    4. Copy to microSD card

    Also, make sure the microSD card partition is properly activated. (see http://e2e.ti.com/support/arm/sitara_arm/f/791/p/236882/829739.aspx)

    Aaron