Coder Social home page Coder Social logo

kihwanoh / u-boot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from csimmonds/u-boot

0.0 2.0 0.0 51.87 MB

U-Boot for BeagleBone Black with fastboot support

License: Other

Roff 0.37% Shell 0.09% Makefile 3.16% C 89.61% Assembly 3.47% Objective-C 0.41% C++ 2.76% Awk 0.01% GDB 0.01% Python 0.02% PHP 0.10% CSS 0.01%

u-boot's Introduction

U-Boot with fastboot for the BeagleBone Black

This is a fork of U-Boot which adds support for the Android fastboot protocol. The changes are somewhat specific to the BeagleBone Black.

Build from source

Clone this repository:

$ git clone https://github.com/csimmonds/u-boot.git
$ cd u-boot
$ git checkout am335x-v2013.01.01-bbb-fb

Since you are likely to be building this along with AOSP, I suggest using the Android cross compiler from prebuilts, but probably any recent arm eabi toolchain will do. If you have sourced build/envsetup.sh and selected the lunch combo the path will be set up already. If not, set it now, substituting ${AOSP} with the place where you installed your AOSP. I used Android 4.4, which has gcc v4.7:

$ PATH=${AOSP}/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin:$PATH

Then configure and build U-Boot:

$ make CROSS_COMPILE=arm-eabi- distclean
$ make CROSS_COMPILE=arm-eabi- am335x_evm_config
$ make CROSS_COMPILE=arm-eabi- 

This produces the two files: MLO and u-boot.img

Create a bootable micro SD card

Take a micro-SD card and connect it to your PC, either using a direct SD slot if available, in which case the card will appear as "/dev/mmcblk0" or, using a memory card reader in which case the card wil be seen as "/dev/sdb", or "/dev/sdc", etc

Now type the command below to partition the micro-SD card, assuming that the card is seen as "/dev/mmcblk0"

sudo sfdisk -D -H 255 -S 63 /dev/mmcblk0 << EOF
,9,0x0C,*
,,,-
EOF

Format the first partition as FAT32

sudo mkfs.vfat -F 32 -n boot /dev/mmcblk0p1

Remove the card and insert it again. It should automatically be mounted as "/media/boot".

Now, copy the files to this partition:

cp MLO u-boot.img /media/boot

Finally, umount it.

Flash U-Boot to the BeagleBone Black

You will need

  • A BeagelBone Black rev A/B/C
  • A micro SD card of any capacity since you are only going to use the first 70 MiB to write a small flasher image
  • The mini USB to USB A cable supplied with the BeagleBone
  • A 5V power supply because the current used when writing to the eMMC chip may exceed that supplied by a typical USB port.

The procedure is:

  1. With no power on the BeagleBone, insert the microSD card

  2. Press and hold the 'Boot button' on the BeagleBone, power up the board using the external 5V power connector and release the button after the fastboot LED (USER 0 led) lights up, showing that it is running this version of U-Boot and is ready to accept fastboot commands

  3. Plug in the USB cable between the mini USB port on the BeagleBone and the PC. Then, using the fastboot command from the Android SDK or an AOSP build, check that the BeagleBone has been detected by typing (on the PC)

$ fastboot devices
90:59:af:5e:94:81	fastboot
  1. If instead you see
$ fastboot devices
no permissions	fastboot

Add this line to /etc/udev/rules.d/51-android.rules

SUBSYSTEM =="usb", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="d022" , MODE="0666"

Then unplug the mini USB cable and plug it back in again. Check that the permissions problem has gone away.

  1. Use fastboot to format the eMMC chip and then flash the images
$ fastboot oem format
$ fastboot flash spl MLO
$ fastboot flash bootloader u-boot.img
  1. Power off the board and remove the SD card

  2. Power on again. Your BeagleBone will boot into U-Boot and it will be once again ready to accept fastboot commands

u-boot's People

Contributors

3x380v avatar ben-skyportsystems avatar calris avatar dgibson avatar dirkbehme avatar glikely avatar grandwolf avatar hippo5329 avatar hsdenx avatar iwamatsu avatar joakim-tjernlund avatar kimphill avatar kumargala avatar michalsimek avatar minkyukang avatar paulgortmaker avatar plagnioj avatar remybohmer avatar sbabic avatar semihalf-bernacki-grzegorz avatar semihalf-jaworowski-rafal avatar semihalf-sieka-bartlomiej avatar sposelenov-emcraft avatar stelian42 avatar stroese avatar vaibhavbedia-xx avatar vapier avatar vdsao avatar wdenx avatar yuri-tikhonov avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.