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.

Booting Linux on AM3359 ICE

Other Parts Discussed in Thread: AM3359, TLK110, AM3358, CODECOMPOSER, SYSBIOS

I would first like to apologize for my ignorance, I am very new to ARM processors.

Several posts have made it clear that there is no official support for using Linux on the ICE (yet...). The reason I am attempting this is because I need two Ethernet ports for a networking project I'm working on.

After spending about a week reading through all the Wiki articles I might actually be more confused than before. My main question is, can I use Starterware to boot Linux from an SD card? It seems to me that with the appropriate SD card configuration Starterware would be able to load U-Boot which could then boot the Linux kernel. If this is true what would that configuration be? My first thought was a two partition setup with MLO, u-boot (renamed to APP) and the kernel image on the boot partition then a filesystem on the other partition.

Maybe I'm way off but any guidance would be greatly appreciated!

  • Mason,

    you should be able to boot Linux from SD on ICE the same way you do it on other platforms (e.g. BeagleBone). The issue is not boot I think but the kernel and driver adaptation and test. For a new comer this is not trivial. Also ICE does not provide you two full Ethernet ports. What you see are two RJ-45 jacks driven by Ethernet Phys. The Phys are connected to MII interfaces ending up at PRU-ICSS subsystem. But there are no Ethernet MACs in the PRU-ICSS. You would require MAC code for that implemented on PRU. This is also not available (yet).

    Just to make sure your expectations are right...

    Regards.

  • Frank,

    Thank you for the immediate response!! I did not realize that the MACs could not be used within the PRU-ICSS ... kind of a bummer. But I have experience with Linux and embedded software just not together on an ARM and I understand that a custom kernel will be needed with lots of adapted/custom drivers. That is not a concern of mine at this point, I would like to get the EVM kernel at least attempting boot first.

    I followed the Wiki articles about creating an SD card for booting Linux and had no trouble with that. When I insert the SD card and power up the first thing displayed through the terminal is Starterware. I assumed that I would instead see X-Loader run from the card. With a properly formatted SD card is that assumption correct?

    Also, there are only two boot mode configurations available on the ICE board via J10. Neither of these modes check the MMC first so is it even possible to boot from ROM code to the MMC instead of Starterware?

    Thanks again for your help and try to bare with me as I learn more about this type of system.

    Regards

  • Mason,

    it seems you booted the Starterware boot loader from SPI Flash. ICE ships with that as default. It then checks further SPI FLASH for more code or trys SDcard and the file APP. If you rename u-boot to APP it might work... that assumes code starts at 0x80000000 (DDR start). You might want to check Starterware in IA-SDK. Normal Starterware does not support ICE and IDK.

    Any other boot modes require mods to the sysboot resistors on the board (not really recommended as there might be side effects).

    Regards.

  • I can't seem to get a download link for the IA-SDK so I can't look into the code for Starterware.

    In my first attempt I renamed 'u-boot.img' to APP and kept MLO and the kernel tarball the same. When Starterware loaded it successfully copied the application and said the app was executing but nothing happened after that. Does that likely mean that the u-boot code doesn't start at 0x80000000?

    Thanks again,

    Regards

  • Helping with a link is easy: http://www.ti.com/tool/sysbiossdk-ind-sitara

    Now what do you expect from your u-boot on ICE? Did you modify the serial comms to use a UART available (and connected to your PC)? When you compile u-boot you should be able to get a map file showing addresses. I am not a u-boot expert... If u-boot assumes MMU is enabled and configured you have another issue. Starterware bootloader does not touch MMU I think. As I said I never tried that approach but MLO should not be needed in that case.

    Regards.

  • Hi Mason!

    By default MLO send debug information to UART0. But for ICE uart0 connect to CAN Phy..

    I was try redefine debug out to UART5 because he connect to Serial-USB and connect to PC..

    Zero. This not work.. 

    At current time I desolder R185,R186 and solder primitive selfmade serial-usb converter. Now I can see "CCCCCCC"  - ARM wait binary loader for xmodem protocol

    Next. I am get BSP source for am3359 from ti.com (spl, uboot, kernel, crosscompiler etc) and make modification..

    In current time I have following chain of load:

    by xmodem load "spl"  binary (~32KB)

    by ymodem load "u-boot" binary (~180KB)

    uSD have two partitions (vfat, ext3) 

    from vfat load "uImage"

    from ext3 mount Debian 6.0 rootfs (full functionality)

    Good luck! 

  • Hi Jury/Mason

    So I'm basically in the same boat as Mason. I have a Beaglebone booting Linux etc etc however I wanted to play with CAN so I picked up an ICE board....guess I should have done more homework :)

    Is anybody booting MLO, u-boot and Linux on this board?

    Thanks

  • Hi Jury / Alll

    I'm also trying to get u-boot running on ICE. Currently I have a cross-compiled u-boot (compiled with Sourcery_CodeBench_Lite_for_ARM_GNU_Linux for am335x_evm).

    Now I'm a bit stuck. Jury, what MLO are do you mean? The MLO from u-boot?
    If it is the MLO from U-Boot. Where did you place it?

    Also has someone successfully run U-Boot from SD-Card?

    I'm sorry for my ignorance... But I'm confused...

    Thank you for your Answers and Regards
    Cyril

  • Also:

    Frank Walzer said:
    If you rename u-boot to APP it might work... that assumes code starts at 0x80000000 (DDR start)

    Do you think that would be right?:

    u-boot.map

    [...]

    Memory Configuration

    Name             Origin             Length             Attributes
    *default*        0x00000000         0xffffffff

    Name             Origin             Length             Attributes
    *default*        0x00000000         0xffffffff

    Linker script and memory map

                    0x00000000                . = 0x0
                    0x00000000                . = ALIGN (0x4)

    .text           0x80800000    0x24318
                    0x80800000                __image_copy_start = .
     arch/arm/cpu/armv7/start.o(.text)
     .text          0x80800000      0x4a0 arch/arm/cpu/armv7/start.o
                    0x80800000                _start
                    0x80800040                _end_vect
                    0x80800040                _TEXT_BASE
                    0x80800044                _bss_start_ofs
                    0x80800048                _image_copy_end_ofs
                    0x8080004c                _bss_end_ofs
    [...]

    See complete File: u-boot.map

    Thanks!

    Update
    Found the tool mkimage in u-boot /tools/

    cyril@XX-laptop:~/u-boot-ti/am335x/tools$ ./mkimage -l ../u-boot.img
    Image Name:   U-Boot 2012.07-08491-g56540ed-di
    Created:      Tue Aug 28 16:34:58 2012
    Image Type:   ARM U-Boot Firmware (uncompressed)
    Data Size:    210984 Bytes = 206.04 kB = 0.20 MB
    Load Address: 80800000
    Entry Point:  00000000

  • Hi Cyril!

     >If it is the MLO from U-Boot. Where did you place it?

    MLO is loaded from Serial Port (xmodem protocol from built-in loader) 

    next, MLO boot UBOOT from Serial (ymodem)..

    > Also has someone successfully run U-Boot from SD-Card?

    It is impossible (for ICE) - beacause SD-card connected to MMC1, but no MMC0 :(

     Good luck! 

    update log from real boot debian for ice board 

  • Hi Jury,

    Could you explain how you managed to boot from UART?

    I can't seem to find a bootloader for the ICE that boots from UART.

    And did you manage to output the data via UART5? (onboard USB FTDI chip)

  • Hi Cyril!

     >Could you explain how you managed to boot from UART?

    "At current time I desolder R185,R186 and solder primitive selfmade serial-usb converter. Now I can see "CCCCCCC" - ARM wait binary loader for xmodem protocol"

    >And did you manage to output the data via UART5? (onboard USB FTDI chip)

    no, I manage via UART0. Correct sources for uart5 very hard.. 

  • Hi all!

    jury noname said:

    >And did you manage to output the data via UART5? (onboard USB FTDI chip)

    no, I manage via UART0. Correct sources for uart5 very hard.. 

    It's not!

    Open File [u-boot]/include/configs/am335x_evm.h

    Edit Line 163 from:

    #define CONFIG_SYS_NS16550_COM1        0x44e09000    /* Base EVM has UART0 */

    to:

    #define CONFIG_SYS_NS16550_COM1        0x481aa000    /* Base EVM has UART5 */

    The Base-Adress can be found in the Reference of am3359...

    And it works!
    I've managed to put the u-boot on the SD-Card and boot it via Starterware Bootloader. I have the following Output:

    U-Boot 2012.07-08491-g56540ed-dirty (Sep 03 2012 - 12:39:03)

    I2C:



    then it's hanging... Probably have to flash the u-boot on SPI...

    Regards Cyril   



  • Cyril,

    I did exaclty the same but I am not getting any output from u-boot. Did you rename the MLO/u-boot.bin/u-boot.img to APP?

  • Also: If some is interested in how I build the sources:
    Toolchain: Sourcery_CodeBench_Lite_for_ARM_GNU_Linux
    Build-Script
    : Build.sh
    ti-image-Script
    : ti_image.sh
    ti-image Source-Code: ti_image.c
    (sorry not able to upload files)
  • Henk de Vriesch said:
    I did exaclty the same but I am not getting any output from u-boot. Did you rename the MLO/u-boot.bin/u-boot.img to APP?

    Used tiimage (compile the Source from above for Linux or use the Windows Binary) and made an App File for SD-Card.

    Update

    My command was the following:

    tiimage[.exe] 1 1 u-boot.bin u-boot 0x80800000 0x80800000

    this will generate u-boot_SD.bin. I've renamed to "app" and placed this file on the SD-Card.

  • I changed [u-boot]/include/configs/am335x_evm.h

    Compiled u-boot

    make O=am335x CROSS_COMPILE=/ti-sdk-am335x-evm-05.05.00.00/linux-devkit/bin/arm-arago-linux-gnueabi- ARCH=arm am335x_evm

    Then created the app

    tiimage 1 1 u-boot.bin u-boot 0x80800000 0x80800000

    Still nothing....no output from u-boot...

    *** StarterWare Boot Loader. Build - ***
    Copying application image from MMCSD to RAM
    Copying to RAM completed successfully
    Image Copy Successful, Executing Application..

    Could you maybe share you're build of u-boot (app)? (just to test if it works)

  • Henk de Vriesch said:
    Could you maybe share you're build of u-boot (app)? (just to test if it works)

    Sure (had to add .123):

     u-boot_SD.bin

    u-boot_SD.bin.123
  • Your app indeed works until I2C displays.......

    Do you use the u-boot source from ti-sdk-am335x-evm-05.05.00.00 ?

  • Henk de Vriesch said:
    Do you use the u-boot source from ti-sdk-am335x-evm-05.05.00.00 ?

    I don't know why but I'm not using it..

    I'm using TI ARM U-Boot

    You can get the code if you have git installed with the command

    git clone git://git.denx.de/u-boot-ti.git

    I don't know if it is a better idea to use the code from ti-sdk-am335x-evm-05.05.00.00 or to directly download it.

    Regards

  • The u-boot-ti.git is indeed 'working'. I can compile it and see output on UART5 now.

    I also flashed u-boot to SPI but it still hangs on the I2C message.

  • Henk de Vriesch said:
    I also flashed u-boot to SPI but it still hangs on the I2C message.

    The same at my board.

    Check out this link: Can U-Boot be configured such that it can be started in RAM?
    Thought that this could be reason for our problem...? :/ (or using Starterware-Bootloader?)

    I found this link (for OMAP) but its not working: Running u-boot directly from RAM

    seems like the easiest way to run u-boot correctly, is to load it via serial?

    >At current time I desolder R185,R186 and solder primitive selfmade serial-usb converter. Now I can see "CCCCCCC" - ARM wait binary loader for xmodem protocol

    > >If it is the MLO from U-Boot. Where did you place it?
    >MLO is loaded from Serial Port (xmodem protocol from built-in loader)
    >next, MLO boot UBOOT from Serial (ymodem)..

    But I'm looking for a better solution! My Reasons are the following:

    1. >[...] SPI [...] SD-Card [...] Any other boot modes require mods to the sysboot resistors on the board (not really recommended as there might be side effects).
    2. Don't want to modify Hardware
    3. Should be able to quickly change Software Code

    Hoping for some good news!

    Regards

  • I disabled I2C from the config file and got past the I2C freeze.

    U-Boot 2012.07-08501-gc2640a1-dirty (Sep 04 2012 - 11:03:02)
    DRAM: 256 MiB
    WARNING: Caches not enabled

    But now it freezes after this last message........

  • I see we have the same problems...

  • The I2C-Freeze is made this line in /drivers/i2c/omap24xx_i2c.c:

    if (readw(&i2c_base->con) & I2C_CON_EN) {

    Dont' know if this helps..

    Update:

    This line checks if the I2C Port0 is enabled. The Base-address and Register-address are both correct. I2C_CON_EN is also correct defined as (1<<15).

       I2C-Base
        i2c_base          : 0x44e0b000
       I2C-Controll-Register
        &i2c_base->con    : 0x44e0b0a4

    and readw is defined:

    #define readw(addr)            (__readwrite_bug("readw"),0)

    i don't get it...

  • I'm now trying to boot u-boot through UART. But i'm not getting "CCCCCC" on UART0 (I desolderd R185/R186). Jury do you have any bootloader flashed into the SPI/NOR? Standard it ships with Starterware, did you erase this ?

    Update:

    http://processors.wiki.ti.com/index.php/AM335x_Hardware_Design_Guide#Selecting_the_Boot_Mode

    If the first boot source fails to boot, the ROM will move on to the next one in the sequence...

    So the NAND/SPI/NOR have to be all blank........But there is no tool to erase the NAND/SPI.......or i can't seem to find it

  • I've managed to boot u-boot via UART....but i can't select any MMC slot.

    U-boot responds with: Card did not respond to voltage select!

    Jury where did you get the MLO / U-boot from?

  • Henk de Vriesch said:
    I've managed to boot u-boot via UART

    Hi Henk

    Could you tell us how?

    Regards

  • I had to change the sysboot resistors on the ICE board to get it to boot from UART. 

  • Hi! Sorry for timeout - many work.. 

    I get BSP from here (may 2012):

    http://software-dl.ti.com/dsps/dsps_public_sw/am_bu/sdk/AM335xSDK/latest/index_FDS.html

    but my version 05.04.02.01 .. current version on site 05.05.xx.xx

     at next week I try find my old sources for this frozen project..

    my last step - stand up eth0 eth1 physical headers for network - failed, because wrong mixed wires between am3359 and tlk110 (kit am3359-ice) 
    :(

  • You talk about side effect on ICE board: I've just configured SYSBOOT[4:0]=11100b to force ROM bootloader to search for MLO loader in MMC1 microSD.

    I've done these modifications to ICE board:

    SYSBOOT[0]---> R91= removed; R107=100K

    SYSBOOT[1]---> J10=shorted pin 2+3;

    SYSBOOT[2]---> R93= 9K1; R109=removed

    After resetting the board, nothing happens. I can't see any activity on MMC1 signals (all steady at high level) after a reset.

    I've noticed SYSBOOT[0] is clocking at 2,5MHz (maybe coming from TLK110 U12). Is this the side effect you mentioned?

    Actually is possibile to get MMC1 to work with ROM bootloader in ICE board?

  • >Actually is possibile to get MMC1 to work with ROM bootloader in ICE board?

    Hi!

    Imho, impossible.. Check carefully:

    1. from UG am3359: 

     Table 26-27. Pins Used for MMC1 Boot
    Signal name Pin Used in Device
    clk gpmc_csn1

    2. from ICE board schematic:

    GPMC_CSN1/GPMC_CLK/MMC1_CLK/PRT1EDIO_DATA_IN6/PRT1_EDIO_DATA_OUT6/PR1_PRU1_PRU_R30_12/PR1_PRU1_PRU_R31_12/GPIO1_30 is not connect to MMC1

  • Thank you for your remark!

    Actually MMC1_CLK is connected to GPIO0_28:

    GMII1_TXD0/RMII1_TXD0/RGMII1_TD0/MCASP1_AXR2/MCASP1_ACLKR/EQEP0B_IN/MMC1_CLK/GPIO0_28

    I can see now that MMC1 peripheral can have multiple pin muxes, so booting from MMC1 in ICE board is defintely not possible.

  • jury noname: Did you find the sources of your project?
    What i managed so far:
    u-boot via UART and from there I can load the kernel from the SD.
    Only one problem remains:
    [    1.261962] Waiting for root device /dev/mmcblk0p2...

    What did you change (except the mux settings) in Linux?

    Full log: http://pastebin.com/xgbNq6yh

  • Hi Henk!

    I found my old sources - this good news..

    but can't check status of binary, because I lost (or me help lost) my homemade USB-Serial (bad news) :))

    I tar and share arch/arm/mach-omap2 "as is"

     Imho - is board - very bad board :/

    ps instead "rootwait=5" write "rootwait"

    ps2 if Y need pause use "rootdelay=xx" where xx seconds for delay 

    mach-omap2-jury.tar.gz
  • Thank you for your sources! I managed to boot Linux this morning. ( I had a pinmux fault :| ).

    Also I  now have output on UART5 ( u-boot and linux ). The last thing that remains is to get u-boot starting from SPI flash instead of loading via UART0....

    I'm almost there....:)

  • I can now start Linux from a unmodified ICE board.

    U-boot is in the SPI flash and the kernel is loaded from the SD card. The output will appear on UART5 (USB). Only the beginning part of linux is corrupted on UART5 but I can always read that back with dmesg. Still figuring out on how to solve that (hopefully last) issue.

  • Good work, congratulation!

    But design this board very-very restricted for network facilities..

    Onboard 2 phy 1GBit and strange connect to ARM interfaces.. Next, MDC/MDIO is connected for wrong pins. I solded 2 wires from PHY to native pins ARM and kernel (after boot) show me found tlk110

    Imho, this ice-board - candidate to trash :)

     Good luck!

    Jury 

  • Jury,

    thanks for the positive wording of your feedback. However it seems you did not understand very well the purpose of the ICE board.

    Just to make it clear we did not plan this as a Linux development platform. We use it with Sys/Bios. Also the two Phys are not connected to the internal EMAC switch (and therefore also not to the corresponding MDIO pins). Instead the phys are connected to MDIO and MII of the PRU-ICSS and we use it for industrial real-time communication. We implement standards such as EtherCAT, Powerlink and Profinet. In our software the (PRU-)MDIO is working well...

    If you are looking for Linux dev platforms please refer to the AM3358 EVM, BeagleBone or Starterkit. They have standard Ethernet interfaces and work well with Linux.

    Please send the ICE board back to us before you trash it :-). We will donate this to a university for further research work.

    Regards.

  • Hi Frank! Thank Your for answer..

    No-no, I know - real target for this device (ice-board) more specific (I read documents on this site).. But I was need information about am3359 in role ethernet switch 1G - performance, reliability, ease of setup..

    >Please send the ICE board back to us before you trash it :-) 

     on the basket - it certainly is a joke. we also have students missing - there is someone to donate :D

    Sorry for my ugly "english" ..

    Good luck!

    Jury 

  • Hello Dennie,

    can you tell how you achieved to get U-Boot into the internal SPI Flash?

    Greets

    Friedrich

  • Hi Friedrich,

    Ofcourse, when you build u-boot this will give you a MLO.spi and u-boot.bin. Flash the MLO.spi via Code Composer with an offset of 0x0 and u-boot.bin with an offset of 0x20000. Then u-boot will start from the SPI flash. The AM335x SYS/BIOS Industrial SDK contains the SPI flasher tool for Code Composer.

    Note that i had to make some changes to the u-boot source (git://arago-project.org/git/projects/u-boot-am33x.git) for uart5 output and correct spi boot on the ICE.

  • Hi Dennie,

    thank you.

    I now can flash MLO.spi and u-boot.bin to the spi flash.

    I modified the u-boot/include/configs/am335x_evm.h to UART5: CONFIG_SYS_NS16550_COM1         0x481aa000 and then compiled u-boot with option am335x_evm_spiboot. But i have no output on the UART5 when i start the ICE.

    You said that you corrected the spi boot on ICE. What do you mean with that? SYSBOOT resistors?

  • No I meant in the uboot source code. Just changing the uart address won't do it... the source needs more changes then that.

    I have included the patches that I created for the ICE. These patches can be cleanly applied against the current arago u-boot source.

    Good luck!

    3312.u-boot-ice-patches.zip

  • Hello Dennie,

    i also tried to run U-Boot from SPI flash, but had no success yet: No Output on UART5. I applied your patches and had to provide CONFIG_MAX_RAM_BANK_SIZE    (1024 << 20) in am335x_ice.h to compile u-boot. I did the following: compiled u-boot with make am335x_ice_spiboot followed by a make. Then i used CodeComposer Studio to first flash the MLO.spi to address 0x0 then flashed u-boot.bin to address 0x20000 (is it correct that i have to use the SPI_Flasher_Tool.out from the SDK twice to first flash MLO and with a new start the u-boot?) I used AM335x_15x15_EVM.gel in CCS to initialize the ICE Board.

    Is there a possibility to debug u-boot and the second stage MLO loader in CCS?

    Torsten

  • You could try to compile it with am335x_ice this will also give you a MLO.spi. You seem to be flashing correctly, you indeed have to start the flasher twice. You can add a #define DEBUG in the am335x_ice.h file (gives more output on UART5) but i don't know if you can debug it via CCS. I find it strange that you had to add code, are you using the arago u-boot source?

  • I cloned http://arago-project.org/git/projects/u-boot-am33x.git and applied your 4 patches (patch -p1 < ...).

    Without modifying the header file i get following compile error:

    make -C board/ti/am335x/
    make[1]: Entering directory `/home/tkoester/u-boot-ice/board/ti/am335x'
    /home/tkoester/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc  -g  -Os   -fno-common -ffixed-r8 -msoft-float   -D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x80100000 -DCONFIG_SPL_TEXT_BASE=0x402F0400 -I/home/tkoester/u-boot-ice/include -fno-builtin -ffreestanding -nostdinc -isystem /home/tkoester/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/include -pipe  -DCONFIG_ARM -D__ARM__ -marm  -mabi=aapcs-linux -mno-thumb-interwork -march=armv5 -Wall -Wstrict-prototypes -fno-stack-protector -Wno-format-nonliteral -Wno-format-security   -o evm.o evm.c -c
    evm.c: In function 'dram_init':
    evm.c:167: error: 'CONFIG_MAX_RAM_BANK_SIZE' undeclared (first use in this function)
    evm.c:167: error: (Each undeclared identifier is reported only once
    evm.c:167: error: for each function it appears in.)
    make[1]: *** [evm.o] Fehler 1
    make[1]: Leaving directory `/home/tkoester/u-boot-ice/board/ti/am335x'
    make: *** [board/ti/am335x/libam335x.o] Fehler 2

  • You are right...the config file is indeed missing that line. I have included working binaries. Maybe you can try these.

    8664.uboot.zip

  • Hello Dennie,

    it works to start u-boot from spi-flash. Thank you.

    Which Kernel and Root-FS do you use? I´ve got some little problems with my custom Kernel...

  • The standard arago kernel should work with some modifications to support the ICE board (MMC / UART5 / Board id patches). I have tried multiple filesystems and have had no problems. The arago filesystem works so you can try that.