Archive

Archive for November, 2012

An LED Glowing example with i.MX6 u-boot

November 16th, 2012

When you are booting u-boot first time, one thing you want is a visual indication that the u-boot has actually booted.

Here is an example how we can make a LED glow for the initial 3 seconds and then make it off. We will do it on the freescale's SabreLite evaluation board. Take a look at the Part of the schematics that has one GPIO pin spare for us - GPIO9 on the connector J7.

We will hook an LED between Pin 4 ( GPIO9) and 7 ( Ground) with a 200 Ohms resistor in series.

At the book time we can make the led glow using the following statement in the file mx6q_sabrelite.c in

board/freescale/mx6q_sabrelite$

It may not be a bad idea to insert it at the time we reset Phy.

void enet_board_init(void)
{
/* Sabrelite phy reset: gpio3-23 */
set_gpio_output_val(GPIO3_BASE_ADDR, (1 << 23), 0); // GPIO 9 for testing on Sabre Lite Eval Board set_gpio_output_val(GPIO1_BASE_ADDR, (1 << 9), 1); . . .

The statement

set_gpio_output_val(GPIO1_BASE_ADDR, (1 << 9), 1);

makes the LED glow.

To turn the LED off, you can use

set_gpio_output_val(GPIO1_BASE_ADDR, (1 << 9), 0);

after the point where it prints

printf("Hit any key to stop autoboot: %2d ", bootdelay);

Make sure you make the set_gpio_output_val function available in the main.c().

Uncategorized

Updating the u-boot in i.MX6 file

November 16th, 2012

In case you have a corrupt u-boot or if you wish to update to new u-boot in SabreLite board from Boundary Devices here are the steps.

1. Compile your u-boot and make your u-boot.bin file available to tftpboot directory.
2. Make sure tftpboot is working. You need to install tftboot in your host machine.
3. The the serverip address and the IP address of the Sabre Lite board.

REFERENCEDESIGNER# setenv serverip 192.168.0.132
REFERENCEDESIGNER# setenv serverip 192.168.0.129
REFERENCEDESIGNER# saveenv

4. If your board boots up - that is good news. Transfer the u-boot file using tftp

REFERENCEDESIGNER# tftpboot 192.168.0.132:u-boot.bin

tftp 192.168.0.132:u-boot.bin
FEC: Link is Up 796d
Using FEC0 device
TFTP from server 192.168.0.132; our IP address is 192.168.0.129
Filename 'u-boot.bin'.
Load address: 0x10800000
Loading: ####################################
done
Bytes transferred = 179944 (2bee8 hex)

Notice the size of the file in the end - 0x2BEE8

Use the the sf commands to program the flash

REFERENCEDESIGNER# sf probe 1
REFERENCEDESIGNER# sf erase 0 0x40000
REFERENCEDESIGNER# sf write 0x10800000 0 0x2BEE8

The first parameter of the sf write command is the location where it gets the file to write. The second is the offset in the SPI Flash were writing needs to start. The last parameter is the size of the file.

If your Flash is not booting you will have to set the switch for USB boot. You the use the imx usb loader to load the flash through the USB. Basically you will have to download the imx USB loader and compile it. Then you give the command

#./imx_usb u-boot.bin

and your board will boot giving output on the Serial Port.

Uncategorized

Compiling Kernel for i.MX6 Sabre Lite

November 6th, 2012

Here are the steps for Compiling Kernel for freescale i.MX6 for the Sabre Lite Board

1. Grab the latest kernel source from git

git clone git://github.com/boundarydevices/linux-imx6.git

Checkout your branch such as

git checkout origin/boundary-imx-3.0.35_1.1.0 -b boundary-imx-3.0.35_1.1.0

or may be for the android 13.4 ga

git checkout origin/boundary-imx-android-r13.4-ga -b boundary-imx-android-r13.4-ga

You should have compile chain for ARM. Following sets of commands should compile Linux Kernel

export ARCH=arm
export CROSS_COMPILE=/usr/bin/arm-linux-gnueabi-

// Use which arm-linux-gnueabi-cpp to find the path

Make the configuration file

make ARCH=arm nitrogen6x_defconfig

make ARCH=arm uImage module

At this point we compiled and got the final error

mkimage" command not found - U-Boot images will not be built
make[1]: *** [arch/arm/boot/uImage] Error 1
make: *** [uImage] Error 2

To overcome this

We did

sudo apt-get install uboot-mkimage

and again

make ARCH=arm uImage module

And it compiled. The output is in

~/linux-imx6/arch/arm/boot/uImage

Uncategorized