Odroid C2

  • Dez Yes, I was trying the zalaare version, I will now pull the other tree and try it. Thanks a lot for the input.

    Jeroen Thank you for the proper command line to use.

    I'll give this a shot and let you all know how it goes. Thanks again.

  • I ported the Odroid_C2 project to my libreelec checkout, and it seems to build fine with some minor ajustments, but it doesn't boot atm, i fused uboot but kernel doesn't give any response atm.

    i think the boot.ini is not ok, will check it tomorrow.

  • Okay, I seem to have successfully built the SYSTEM and KERNEL files as well as a tar file that contains these pieces and what seems to go into the fat partition of the SD card. I have some (maybe stupid) questions about this stuff. In the tar file 3rdparty directory there is a BL1 file and a u-boot file as well as a boot.ini and meson dtb file. I see that my Ubuntu installation on my C2 has a boot.ini and a meson dtb file, but it also has an Image and a InitRD file.

    Can anyone explain (or point me to a good explanation) of how the system comes up from power on. I don't think it works like a PC with mbr. I assume that it's something like the RPi in that the C2 hardware contains some kind of microcode that can mount and look through the fat partition of the SD card (or MMC device). I'm trying to gain a better understanding of how this stuff works, in detail. I apologize if this is basic information that I should know before attempting any of this, but I promise to learn from this experience and hopefully help others later on. I know there is no magic here, but it's looking like that to me right now because I don't know the details.

    EDIT: I downloaded the toolkit to help create the SD card, but it appears that the binaries are for a 32 bit OS. For whatever reason, I can't seem to get the libraries installed that they need. I'm using a 64 bit Mythbuntu installation that is less than 1 year old and has all the updates applied, so I'm not sure what the problem is. I'm going to look for a source version of the toolkit that I can compile from scratch.

    EDIT2: The answer to the problem with not being able to run the 32 bit stuff was to do this:

    Code
    apt-get install lib32stdc++6


    I also found this to be informative:
    U-Boot on ARM32, AArch64 and beyond
    This might be handy as well:
    Linaro Releases

    Edited once, last by afremont (March 31, 2016 at 12:53 PM).

  • Woohoo, finally got the SD card "initialized". I also copied the meson-blah-blah.dtb file to the fat16 partition along with the boot.ini and the KERNEL and SYSTEM files. I don't think the meson*.dtb file was used for anything. I powered it on and got the LibreELEC graphical splash screen and a message indicating:

    sh: can't access tty: job control turned off
    #

    I didn't see any kernel output messages, but obviously something is running. I appear to be able to see some kind of minimal file system. I'm guessing that busybox is providing my prompt, but I don't know that for sure. No ps command available.

    My ubuntu install has a meson*.dtb file in the boot directory and also has a uInitrd ramdisk file. I'm wondering if the missing ramdisk file is what is preventing it from booting on up. The ubuntu system also has an Image file in the boot directory.

    Are you guys having any luck getting beyond this point?

  • I got it to boot now, seems there is somthing fishy with the hardkernel uboot source, it builds and loads fine, but doesn't boot the kernel, if i used the binary uboot provided by hardkernel it boots.

    system boots up, but kodi segfaults:

    LibreELEC:~ # /usr/lib/kodi/kodi.bin
    Segmentation fault (core dumped)


    i did notice this errors while booting:

    ./platform_init: line 12: can't create /sys/kernel/debug/aml_reg/paddr: nonexistent directory

    kodi_crashlog_20160329172617.log
    IbfD

    kodi.log:
    IbfD


    is it craching beacus of missing cpu scaling?
    17:26:01 T:548259504128 ERROR: AML: no rw on /sys/class/ppmgr/ppmgr_3d_mode
    17:26:01 T:548259504128 ERROR: AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
    17:26:01 T:548259504128 ERROR: AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
    17:26:01 T:548259504128 ERROR: AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

    any ideas?


  • I think kodi is already running. But maybe I'm wrong...

    I really have to hurry up and make a console cable to try see if that is the case.

    From @lrusak's post on the Hard Kernel forum ODROID Forum • View topic - OpenELEC for Odroid-C2 it doesn't appear so.

    Some slight progress.....I think;

    Before rebuilding, I modified the linux config file (linux.aarch64.conf) in /LibreELEC/projects/Odroid_C2/linux to set CONFIG_MALI_SHARED_INTERRUPTS=y and CONFIG_AMLOGIC_ION to not set.

    The result was that instead of the blue LED staying on solid (indicating a lockup during boot), it was flashing (indicating that at least the kernel was now running).

    Unfortunately it still didn't progress beyond the LibreELEC splash screen.
    I guess much more work is still needed, possibly on boot.ini.

    Did anyone else have the flashing blue LED or did it just stay on?
    [hr]


    any ideas?

    Here's the difference between OpenELEC working on a s905 box compared to what's in the linux.aarch64.conf we are using.

    Could the differences here maybe be causing a problem?

    Edited once, last by Dez (March 31, 2016 at 8:17 PM).

  • I only have a solid blue light, but I do have a root prompt that responds to the few commands that can be issued. The main filesystem is obviously not mounted, but the SD card is mounted under /flash. There is apparently a Linux kernel of some sort running, but I have no idea how to get the filesystem mounted. If the console IO port is 3.3V, I have a usb to serial type cable that works with the RPi I can connect. It might be helpful to be able to see the kernel messages. I hope that's a valid way to get them displayed somewhere.

    I'm going to try rebuilding the kernel using the options that Dez listed and see what happens.

    Is the serial console port 3.3V??? Yes it is 3.3V

    Oddly enough, my default kernel config file doesn't exactly match the first one listed, I have one difference:
    CONFIG_CPU_FREQ_GOV_ONDEMAND=y

    EDIT:

    This was already set in my kernel config:
    [font="Open Sans, sans-serif, Arial"]CONFIG_MALI_SHARED_INTERRUPTS=y[/font]

    [font="Open Sans, sans-serif, Arial"]Why is my kernel config different from Dez'?[/font]

    [font="Open Sans, sans-serif, Arial"]EDIT2: So much for using my RPi serial cable, it won't fit. :( I'm ordering the correct one now, ouch.[/font]

    Edited once, last by afremont (April 1, 2016 at 3:07 AM).

  • Can you guys pastebin your linux.aarch64.conf files?
    Here's mine (original):
    Ubuntu Pastebin

    I made the change to disable ION, but got the same exact results -- splash screeen, no heartbeat on the blue LED, root prompt, flash card mounted on /flash, very rudimentary root filesystem (I'm guessing the initramfs or whatever you wish to call it) No sign of the "real" root filesystem.

    I'd like to compare config files. Maybe we have slightly different github clones??? How do I "update" my clone of the github with any changes they might have made since I did my clone? Do I do a git pull, git fetch, or what?

    Thanks, I wish I could be of more help to you guys. Just trying to learn here. :)

    Over 20 years of Linux tinkering and I still feel like I just downloaded slackware floppy images yesterday. At least I got my console cable ordered, it should be here early next week.

  • Mine is as per LibreELEC.tv/linux.aarch64.conf at aarch64-odroid-c2 · lrusak/LibreELEC.tv · GitHub with the 2 changes; [font="Open Sans, sans-serif, Arial"]CONFIG_MALI_SHARED_INTERRUPTS=y and # CONFIG_AMLOGIC_ION is not set[/font]

    [font="Open Sans, sans-serif, Arial"]That, once built, boots only to the splash screen but at least has the blue "heart beat" LED now flashing. [/font]
    [font="Open Sans, sans-serif, Arial"]I found a USB to TTL converter so should hopefully be able to make a console cable soon to try to see what is going on.[/font]

    lrusak appears to have made a few recent changes to the Odroid-C2 branch, so may be worth cloning again and trying.

    I wouldn't make many changes to [font="Open Sans, sans-serif, Arial"]linux.aarch64.conf as it can make building a real pain in the arse and may only make things worse.[/font]

    Edited once, last by Dez (April 1, 2016 at 5:06 AM).


  • Mine is as per LibreELEC.tv/linux.aarch64.conf at aarch64-odroid-c2 · lrusak/LibreELEC.tv · GitHub with the 2 changes; [font="Open Sans, sans-serif, Arial"]CONFIG_MALI_SHARED_INTERRUPTS=y and # CONFIG_AMLOGIC_ION is not set[/font]

    [font="Open Sans, sans-serif, Arial"]That, once built, boots only to the splash screen but at least has the blue "heart beat" LED now flashing. [/font]
    [font="Open Sans, sans-serif, Arial"]I found a USB to TTL converter so should hopefully be able to make a console cable soon to try to see what is going on.[/font]

    lrusak appears to have made a few recent changes to the Odroid-C2 branch, so may be worth cloning again and trying.

    I wouldn't make many changes to [font="Open Sans, sans-serif, Arial"]linux.aarch64.conf as it can make building a real pain in the arse and may only make things worse.[/font]

    That's interesting as mine already has the CONFIG_MALI_SHARED_INTERRUPTS=y. I just cloned LibreELEC yesterday (March 30) at 13:07 central time, perhaps my stuff is later than yours? I always make backup copies of files before changing them so that I can put things back and/or do a diff command to see where I'm currently at. I did comment out CONFIG_AMLOGIC_ION, but it made no difference. You might want to compare your config file to the one I pastebined to see what (if any) differences exist. The one I uploaded is the original that came when I did the clone yesterday, unchanged.

    I downloaded the binary for u-boot and the bl1.... file is identical to the one I built from source. The u-boot.bin file is exactly the same size as the one I built from source, but it differs according to the diff command. hmmm... I'm going to switch to the binary version and see if I get any difference in behavior. I'm not getting the flashing blue LED (heartbeat), just a solid blue.

    I wanted so bad to hook up my serial to USB cable from my RPi, but it simply won't plug on and I'm not going to chop it up or risk damaging my C2. I'll wait for the cable I ordered tonight, it should only be a few days. Probably Monday if they process it as fast as they did my C2.

    I'll go ahead and clone the whole thing again, but I was hoping to avoid compiling it all since it takes so long.

    There have been S905 based boxes running OpenELEC for at least 3 months now, it doesn't seem like it should be this hard to get the C2 running it. Since we get (or at least I do) an actual root Linux command line prompt, we have the kernel running, it's just that Kodi isn't getting launched at my house anyway.

    Do you have two partitions on your boot device? I only had the fat16 partition created. I went ahead and created (but didn't make a filesystem) a second Linux partition (Type 83). That didn't seem to make any difference in my situation. Do I need that partition to exist and be formatted, or will OpenELEC take care of that once it launches?

    Do you have the meson64_odroidc2.dtb file on your fat partion? u-boot.ini seems to expect it to be there, so I put it there from the start.

    This stuff is slowly starting to come together in my head. I'm getting a feel for how the hardware comes up now and how u-boot loads from the SD card in sort of an MBR type fashion, and then loads in the KERNEL file. I finally found and read a few things that started to clear this up to me. What I don't see is how the SYSTEM file plays into this unless that's taken care of by OpenELEC itself when it loads. I'm thinking that it sees the file and then unpacks it onto the second partition. The confusing thing right now is that there doesn't appear to be something to start OpenELEC in the ramdisk that is mounted, at least I haven't found it anyway unless /platform_init or /functions is what starts it. Do you know?


  • Just saw @lrusak's post here ODROID Forum • View topic - OpenELEC for Odroid-C2

    Great news!!

    I just did a make clean on the first clone I did and re-cloned it into another directory (running a small SSD on the system I'm using to build so space is tight, it's a mythbackend machine with a 60GB SSD root filesystem drive and a 5TB storage drive) It's takes 15GB to do a build, amazing. Looks like we all might have been running slightly different versions of things since the developer was working on it.

    That's excellent that he got it running. I wonder what kind of problem he is having with u-boot. I'm confused as to why he needs a "bare metal" compiler to fix it, but then I find a lot of this stuff confusing right now.

    I don't know for sure yet, but so far it seems like Amlogic is a lot more open about their hardware than Broadcomm (RPi chipset). That's the main thing I dislike about the RPi, you have to sign an NDA and get blessed before they let you know how their stuff works. I miss the old days of companies proudly documenting their hardware so that developers could implement it, now corporate lawyers don't want anyone to know how to actually write a driver for anything out there, they treat datasheets like they're military secrets.

    Anyway, I hope what I just pulled from github is going to work, it's compiling anyway. Thanks for reading and for all the help you've provided to me.

  • Okay, it's running. Kodi (LibreELEC) is up and running after cloning the github branch again and rebuilding it all. I also used the u-boot binary instead of the one I built from source. No modifications to the boot.ini file.

    Now for the bad news:
    1) no PVR addons can I find and I absolutely have to have MythPVR so I'll see if I can install from zip or something
    2) the LibreELEC repository isn't there (might be temporary), but the Kodi repository is

    I haven't tried to actually do much of anything. I don't know if sound is working, but it looks like it should be from the dmesg out and the kodi.log.

    dmesg output: jPPY
    kodi.log: KSOB

    What I did:

    git clone GitHub - lrusak/LibreELEC.tv: 'Just enough OS' for Kodi --branch aarch64-odroid-c2
    ARCH=aarch64 PROJECT=Odroid_C2 make -j8

    The stuff on this page, but I downloaded the binary:
    en:c2_building_u-boot [Odroid Wiki]

    Edited once, last by afremont (April 1, 2016 at 2:09 PM).


  • Any update? Does video playback work? I got my c2 yesterday and have been disappointed using android thus far...I hate needing a keyboard and mouse so if this build works I'd be elated!

  • I am building it now, i did notice the options file says:

    case $TARGET_ARCH in
    arm64)

    instead of aarch64, but don't think it makes much difference.

  • I don't know yet. I haven't had time to try anything, including sound, but the developer said that there was some kind of problem with that right now. My usage is mostly as a front-end for MythTV, so I'm going to work towards getting the addon loaded. Later on, I will give video playback a try and see what happens.
    [hr]


    I am building it now, i did notice the options file says:

    case $TARGET_ARCH in
    arm64)

    instead of aarch64, but don't think it makes much difference.


    When I built it, it stopped to ask me a couple of questions at one point about root ownership and something else I forgot. There was only one stopping point and then it completed on its own as I slept. I did switch to the binary download of u-boot, but I don't know if that was absolutely necessary. I need to figure out how to sync my clone with github so that I don't have to pull everything over and over and build from scratch each time I update.

    Edited once, last by afremont (April 1, 2016 at 4:35 PM).