Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Armbian doesn't boot from emmc #13

Closed
tecufanujacu opened this issue Sep 19, 2017 · 33 comments

Comments

@tecufanujacu
Copy link

@tecufanujacu tecufanujacu commented Sep 19, 2017

I just installed Armbian on the emmc and it doesn't boot. Booting it from sdcard there isn't any problem.

What can I do?

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Sep 19, 2017

Rerun the installation process. When you first start the installation, the system was copied in sections, which are described in the old version dtb. When you install the dtb in eMMC overwritten with the new version, so the sections have changed. We need to start the installation process,the system was copied in the changed sections. Pay attention at the start of the TV box, u-boot starts with a description of the partitions from eMMC. Then u-boot loads the dtb (in which the description of sections is different from what is in u-boot) and system files from external media, and transmits them to the control. When you install the OS in eMMC, the system copies the data from the beginning of the sections (using the old description) , and then replace the dtb in u-boot and the descriptions change. When you start after installation, u-boot is already starting to use the new data to sections of the dtb, and there is no need. Therefore , if the system from external media is run in the presence of the file "dtb.img", you must run the installation twice. Perform the first install, just restart the system (with the same external media or anything not changing it), and the second time to perform the installation.

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Sep 20, 2017

Yes, I believe that the presence of additional information, this problem can be solved. Maybe the solution is very simple, but it's not clear at what stage the problem occurs.

p.s.
I'm sure this problem is solved.

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Sep 23, 2017

Sorry for the delay with the answer, a lot of work. Try to use the dtb
gxbb_p200_2G.dtb

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Sep 23, 2017

Yes. I have done this many times with different systems. Why you got the error, I do not understand.

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Sep 23, 2017

Just checked the install this image

https://yadi.sk/d/ncz-V_GV3MgsNP

on Tronsmart Vega S95 Pro (1Gb\8Gb). The system is normally installed from the first file "gxbb_p200.dtb". Starts and runs from eMMC. There is not a big problem, after turning off the TV box does not turn on with remote, have to pull out the power supply (I know about this bug, but so far not enough time to fix).
I checked on Pro, in order to make sure to install enough 8Gb eMMC. After a couple of days I will try again to validate the installation on Telos.

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Sep 25, 2017

Show the log of the install script.

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Sep 26, 2017

I checked the setting on Telos. Recorded the image to a USB flash drive. Launched Armbian using (gxbb_p200_2G_vegas95.dtb). Launched the terminal under root privileges (su -) , run the installation (nand-sata-install). The system was established. Rebooted without the USB stick. Armbian start of the eMMC. Try updating the firmware to the latest official and then to complete the installation. I use the firmware from here.

http://www.tronsmart.com/?p=7572

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Sep 26, 2017

  1. the nand-sata-install is a link to the script "/root/install.sh". You can use both option, they are the same.
  2. Do I understand correctly that you have Meta does not start with a Android from the internal memory ?
  3. You need to be sure before installing to eMMC Armbian, to achieve a normal start the regular firmware Android. Only after that you can proceed to install Linux on eMMC.
@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Sep 26, 2017

only flash it through USB cable.

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Sep 26, 2017

I no longer know what is my Telos can be firmware. Many times I have re-recorded a different system in eMMC. The only thing I know, the version of u-boot.

U-Boot 2015.01-ga9e9562-dirty (Jul 26 2016 - 01:41:57)

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Sep 29, 2017

Now tested on Telos. Installed the latest firmware, which is available on the website. After launch, the system has detected an OTA update, I installed this update. After that, I installed Armbian in eMMC. The system does not run from the eMMC. Stops the run, as in not the correct dtb. I'm going to find out why this is happening.

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Sep 29, 2017

Do not wait for the new patched images, you can perform these steps.

  1. To download an image Libreelec
    https://sx05.eu/s905/8.2/8.1.9/LibreELEC-S905.arm-8.2-8.1.9.img.gz
  2. Write it to external media (you can use SD card or USB flash drive).
  3. Run from the media LE.
  4. At first the settings LE is sure to enable SSH.
  5. Conect SSH into the LE and execute the script "installtointernal". The system will start to install to eMMC and will perform the correct initialization of dtb.
  6. After that you can turn off LE.
  7. Remove media Armbian "dtb.img"
  8. Start Armbian from media and install to the eMMC.

After these steps your system should be fine to run from eMMC.

@tecufanujacu

This comment has been minimized.

Copy link
Author

@tecufanujacu tecufanujacu commented Oct 4, 2017

After a frash install, starting from Android I understood the problem, libreelec copies the dtb also in /dev/dtb, but your script doesn't do this. I solved the problem copying the dtb in /dev/dtb.

@ivomarino

This comment has been minimized.

Copy link

@ivomarino ivomarino commented Nov 4, 2017

hi all, I'm experiencing a similar issue. Hardware:

  • MXQ Pro 4K (OTT)
  • mxq_s905_v2_2 (20160428, green pub)

Steps:

  • Flashed LibreELEC-S905.arm-8.2-8.2.0.1.img.gz to SD
  • Added relative gxbb_p201.dtb as dtb.img to SD
  • Booted LE from SD
  • Installed LE to eMMC using installtointernal from LE
  • Shutdown
  • Remove SD
  • All is fine, LE boots directly from eMMC

What I really want is Armbian Debian Jessie booting from eMMC, so after having installed LE to eMMC:

  • Flashed Armbian_5.34_S9xxx_Debian_jessie_3.14.29_server_20171027.img.xz to USB
  • Added relative gxbb_p201.dtb as dtb.img to USB
  • Booted Armbian from USB
  • sh /root/install.sh, all seems fine
  • Shutdown
  • Remove USB (SD removed previously)
  • Just got S905 splash screen logo from LE, then hangs, no Armbian boot

Tried to install Armbian twice, same result. Tried to manually dd if=/boot/dtb.img of=/dev/dtb, under Armbian, didn't help. @150balbes you wrote ..."dtb.img", you must run the installation twice. Perform the first install, just restart the system (with the same external media or anything not changing it) so maybe it's important to install LE and the Armbian (twice) using the same SD? Thanks for feedback.

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Nov 4, 2017

  1. Show the output when you run the command from Armbian
    sudo /root/install.sh

  2. I think it's just a typo ?
    dd=if/boot/dtb.img of=/dev/dtb

Must be
cd /boot
dd if=dtb.img of=/dev/dtb

@ivomarino

This comment has been minimized.

Copy link

@ivomarino ivomarino commented Nov 4, 2017

hi @150balbes, yes that was a typo, fixed. In install.sh this is anyway handled fine: dd if="$IMAGE_DTB" of="/dev/dtb" bs=262144 status=none && sync.

Output of sh install.sh:

Start copy system for DATA partition.
Formatting DATA partition...
/dev/data: clean, 11/315120 files, 41091/1259520 blocks
done.
Copying ROOTFS.
Copy BIN
Copy BOOT
Create DEV
Copy ETC
Copy HOME
Copy LIB
Create MEDIA
Create MNT
Copy OPT
Create PROC
Copy ROOT
Create RUN
Copy SBIN
Copy SELINUX
Copy SRV
Create SYS
Create TMP
Copy USR
Copy VAR
Copy fstab
*******************************************
Done copy ROOTFS
*******************************************
Writing new kernel image...
writing boot image config in bootimg.cfg
extracting kernel in zImage
extracting ramdisk in initrd.img
extracting second stage image in stage2.img
reading kernel from /boot/zImage
Writing Boot Image /dev/boot
reading ramdisk from /boot/initrd.img-3.14.29
Writing Boot Image /dev/boot
done.
Writing new dtb ...
done.
Write env bootargs
*******************************************
Complete copy OS to eMMC parted DATA
*******************************************

so all seems good to me but after reboot it just hangs after S905 logo.

@ivomarino

This comment has been minimized.

Copy link

@ivomarino ivomarino commented Nov 4, 2017

I've tried the whole process again using the same USB device for LE and Amrbian, same problem.
@150balbes in comment #13 (comment) on point 7. you say Remove media Armbian "dtb.img", what do you mean exactly? thanks

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Nov 4, 2017

  1. Try to install LE.
  2. Delete from a USB flash drive with Armbian file "dtb.img" and try to start the system without it. If the media does not have the dtb file, the system should try to use dtb already available internal memory.
@ivomarino

This comment has been minimized.

Copy link

@ivomarino ivomarino commented Nov 4, 2017

I will try this, thanks. This means that the dtb file from LE is compatible with Armbian?

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Nov 4, 2017

Not all versions are compatible. But you can try.

I have previously encountered problems when installing Linux in NAND (p201 is a NAND memory). NAND memory is different from the eMMC and have to use a different algorithm install.

@ivomarino

This comment has been minimized.

Copy link

@ivomarino ivomarino commented Nov 4, 2017

Ok, I try asap and let you know. In case I hit the issue you just spoke about what would the best way to proceed? Is there a way to debug u-boot before booting or similar? Just to see what’s going on, for now I only see the S905 splash from LE. But will try your suggestion anyway ASAP.

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Nov 4, 2017

The presence of a splash from the LE (after running the installation script Armbian), reports that the installation process was not completed correctly (the data in NAND was not overwritten). If you have the opportunity to connect the console UART, it can significantly help with the search error. I don't understand the question about u-boot.

@ivomarino

This comment has been minimized.

Copy link

@ivomarino ivomarino commented Nov 4, 2017

Unfortunately I don’t have UART right now, regarding u-boot I mean is there any way to see the boot process on screen? But I think by your answer that only UART can help.

@ivomarino

This comment has been minimized.

Copy link

@ivomarino ivomarino commented Nov 4, 2017

What can be the cause for a non good flash? Also when I boot from SD or USB, which work fine, I see always the LE S905 logo before boot, as info. Should I see armbian logo also with SD/USB boots?

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Nov 4, 2017

Yes, without a UART is not possible to see the u-boot (system startup). Do I understand correctly that the image LE is displayed at every startup of the system (with SD card and USB stick) ?

@ivomarino

This comment has been minimized.

Copy link

@ivomarino ivomarino commented Nov 4, 2017

Yes

@ivomarino

This comment has been minimized.

Copy link

@ivomarino ivomarino commented Nov 4, 2017

The S905 boot Splash logo I mean, it came after flashing LE to NAND.

@ivomarino

This comment has been minimized.

Copy link

@ivomarino ivomarino commented Nov 5, 2017

I've done this test:

 - Boot LE, then:
 - # Use Armbian's DTB
    LibreELEC:~ # cp /var/media/BOOT/dtb.armbian.img /flash/dtb.img
 - installtointernal # this should now Flash Armbian's DTB to /dev/dtb

which leads to:

 - LE does not boot from eMMC (because we have an Armbian DTB, so correct)
 - Armbian boots from USB without DTB (using internal one)
 - Installed Armbian to EMMC => does not boot

So the problem must be something in the boot process which is different between LE and Armbian:

Armbian aml_autoscript:

'Vf�Y-Tq�ז��setenv bootfromnand 0
setenv bootcmd "run start_autoscript; run storeboot;"
setenv start_autoscript "if usb start ; then run start_usb_autoscript; fi; if mmcinfo; then run start_mmc_autoscript; fi;"
setenv start_mmc_autoscript "if fatload mmc 0 1020000 s905_autoscript; then autoscr 1020000; fi;"
setenv start_usb_autoscript "if fatload usb 0 1020000 s905_autoscript; then autoscr 1020000; fi; if fatload usb 1 1020000 s905_autoscript; then autoscr 1020000; fi; if fatload usb 2 1020000 s905_autoscript; then autoscr 1020000; fi; if fatload usb 3 1020000 s905_autoscript; then autoscr 1020000; fi;"
setenv upgrade_step "0"
saveenv
sleep 1
reboot

LE aml_autoscript (boots from eMMC after install):

'V՛\�Y�`fd���\defenv
setenv bootfromrecovery 0
setenv bootfromnand 0
setenv upgrade_step 2
setenv start_autoscript 'if mmcinfo; then run start_mmc_autoscript; fi; if usb start; then run start_usb_autoscript; fi;'
setenv start_mmc_autoscript 'if fatload mmc 0 1020000 s905_autoscript; then autoscr 1020000; fi;'
setenv start_usb_autoscript 'if fatload usb 0 1020000 s905_autoscript; then autoscr 1020000; fi; if fatload usb 1 1020000 s905_autoscript; then autoscr 1020000; fi; if fatload usb 2 1020000 s905_autoscript; then autoscr 1020000; fi; if fatload usb 3 1020000 s905_autoscript; then autoscr 1020000; fi;'
setenv sddtb 'if fatload mmc 0 ${dtb_mem_addr} dtb.img; then echo sd dtb.img loaded; else store dtb read $dtb_mem_addr; fi'
setenv usbdtb 'if fatload usb 0 ${dtb_mem_addr} dtb.img; then echo usb dtb.img loaded; else store dtb read $dtb_mem_addr; fi'
setenv librefromsd 'if mmcinfo; then if fatload mmc 0 ${loadaddr} kernel.img; then run sddtb; setenv bootargs ${bootargs} bootfromsd; bootm; fi; fi'
setenv librefromusb 'if usb start 0; then if fatload usb 0 ${loadaddr} kernel.img; then run usbdtb; setenv bootargs ${bootargs} bootfromusb; bootm; fi; fi'
setenv bootcmd 'if test ${bootfromnand} = 1; then setenv bootfromnand 0; saveenv; else run start_autoscript; run librefromsd; run librefromusb; fi; run storeboot'
saveenv
run storeargs
run librefromsd
run librefromusb

maybe something important here differs.
By the way I can boot LE with gxbb_p201.dtb and gxbb_p200_1G_1Gbit_RealtekWiFi.dtb so no idea if it's a p201 is a NAND memory or eMMC.

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Nov 5, 2017

  1. The reason is not in the scripts. They use the same algorithms to load the dtb. They describe commands for starting from external media.
  2. The fact that you have run your system with a different dtb (p200 and p201) are important, they are differently described work with the internal memory (which use eMMC or NAND). Try to run Armbian to media with p200 and install Armbian with p200.
  3. You have the file of the factory firmware for your Android TV box ?
@ivomarino

This comment has been minimized.

Copy link

@ivomarino ivomarino commented Nov 5, 2017

  1. OK, thanks for info.
  2. I'll try that with Armbian gxbb_p200.dtb (boot from USB OK, to see what happens after install)
  3. No;(

why can my system work both with p200 and p201?

@ivomarino

This comment has been minimized.

Copy link

@ivomarino ivomarino commented Nov 5, 2017

installed Armbian with gxbb_p200.dtb, does not but, just the S905 logo. Should I try the process again installing first LE and the Armbian with gxbb_p200.dtb? Do I also need to install Armbian two times? thanks

@ivomarino

This comment has been minimized.

Copy link

@ivomarino ivomarino commented Nov 5, 2017

The original firmware could be this: http://mediaboxent.com/mxq-pro-tv-box/ -- I don't know how to flash it anyway as fare as I have no male-to-male USB cable, just SD and USB.

@150balbes

This comment has been minimized.

Copy link
Owner

@150balbes 150balbes commented Nov 5, 2017

The firmware does not need to install in the TV box. It needs to handle a special program that can pull of the image of the firmware separately all the elements (including the dtb file). Here is a link to the program to extract the firmware into separate elements.

http://freaktab.com/forum/tv-player-support/allwinner-tv-players/freaktab-tools-utulities-collection/569730-customization-tool-2-0-7

http://freaktab.com/forum/tv-player-support/allwinner-tv-players/freaktab-tools-utulities-collection/667396-customization-tool-2-0-10-latest-tf-sd-burn-card-maker-2-0-3-usb-burn-tool-2-1-2-amlogic-pdfs-amlogic-sdks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.