COM iMX25 Linux

From Wiki-DB
Revision as of 07:58, 7 October 2016 by Lzenz (talk | contribs) (→‎How to build a kernel)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Linux virtual machine for development

Building your own Kernel

Sources for the iMX25 Linux Kernel v3.2.9 / v3.2.81:

How to build a kernel

Get sources from Github and build the linux kernel

1. Start a terminal on Linux
2. # git clone https://github.com/dh-electronics/linux-imx25.git
3. # git checkout BRANCH
(BRANCH=dev/3.2.9_dhcom or BRANCH=dev/3.2.81_dhcom)
4. # ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make imx25_dhcom_defconfig
5. # ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make uImage
  • Your new uImage file is available in arch/arm/boot


Sources older than February 2014

Sources for the iMX25 Linux Kernel v2.6.38:

Sources for the iMX25 Linux Kernel v3.2.9:

How to build a kernel

1. Start a terminal on Linux
2. Copy the above mentioned source files (linux-3.x.y.tar.bz2, .config, *.patch) into our work_path
3. # cd work_path
4. # tar xfjv linux-2.6.38.tar.bz2
5. # cd work_path/linux-2.6.38
6. # patch -p1 <linux-2.6.38_DHCOM_iMX25.patch
7. # cp .config work_path/linux-2.6.38
8. # ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make uImage
  • Your new uImage file is available in work_path/linux-2.6.38/arch/arm/boot

Update the kernel with U-Boot

The linux kernel will be updated by the U-Boot flash update.
1. Copy the uImage and uImage.env file onto a microSD card with a FAT file system (you can use the 1st partition on the microSD card)
2. Insert the microSD card and start the system
3. Go to the U-Boot console by pressing BACKSPACE on a RS232 terminal (during startup)
4. update linux

Debian Rootfilesystem

Available Rootfilesystems

Please have a look at the iMX25 Downloads section.

External Documentation

Login

Debian GNU/Linux 6.0 dhcom ttymxc1

dhcom login: root
Password: foo

Calibrating the touchscreen

# TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate

Running example Qt Apps

# QWS_MOUSE_PROTO=Tslib:/dev/input/event0 /usr/qt/demos/demoname/demoname -qws
  • Remark: To start the Qt-Browser replace demoname with browser

Shutdown

# shutdown -h now

How to create a microSD-card with a rootfilesystem on it

1. Format a microSD card like following (in linux e.g. gparted, palimpsest) with Master Boot Record partition scheme

P1 FAT (Primary partition: 100MB)
P2 ext3 (Primary partition: Residual space)

2. Untar the root file system to the ext3 partition of the microSD card (Don't copy the tar archive directly to the microSD card)

Start the Console on Linux
# su
# chmod 755 /path/of/the/microSD_card
# cd /path/of/the/microSD_card
# tar xfjv path/to/RootFS/Name_of_RootFS_file.tar.bz2

Remark: If you got a *.tar.gz file so type tar xfzv ... to extract the rootfilesystem.

Busybox Rootfilesystem

Calibrating the touchscreen

TSLIB_TSDEVICE=/dev/event0 ts_calibrate

Running example Qt Apps

QWS_MOUSE_PROTO=Tslib:/dev/event0 /usr/qt/demos/demoname/demoname -qws
For the Qt-Browser change demoname to browser

Login/Shutdown system

Username: root
Password: n/a
halt


Kernel Userspace Interfaces to Access Hardware

Serial (UART) Interfaces

DHCOM (FF) UART 1 /dev/ttymxc1
DHCOM (BT) UART 2 /dev/ttymxc2
DHCOM (STD) UART 3 /dev/ttymxc4

I2C Interfaces

DHCOM I2C 1 /dev/i2c-1
DHCOM I2C 2 /dev/i2c-2

SPI Interfaces

DHCOM SPI 1 /dev/spidev1.0
DHCOM SPI 2 /dev/spidev2.0

Control the display brightness

echo <value> >/sys/devices/platform/imx-fb.0/backlight/imxfb-bl/brightness
value range: 0..255

Control GPIOs

DHCOM Name: alt. DHCOM Name: Port: Pin: SO-DIMM Pin# Linux <GPIO#>
GPIO A 2 12 154 44
GPIO B 3 21 156 85
GPIO C 2 4 162 36
GPIO D 2 5 163 37
GPIO E 2 6 164 38
GPIO F 2 7 165 39
GPIO G 2 8 167 40
GPIO H 2 9 173 41
GPIO I 3 17 175 81
CIF HSYNC GPIO J 1 10 74 10
CIF PCLK GPIO K 1 11 72 11
CIF MCLK GPIO L 1 8 70 8
CIF VSYNC GPIO M 1 9 68 9
CIF D9 GPIO N 4 21 66 117
CIF D8 GPIO O 1 7 64 7
CIF D7 GPIO P 1 6 62 6
CIF D6 GPIO Q 1 31 60 31
CIF D5 GPIO R 1 30 58 30
CIF D4 GPIO S 1 29 56 29
CIF D3 GPIO T 1 28 54 28
CIF D2 GPIO U 1 27 52 27
Export
echo <GPIO#> >/sys/class/gpio/export
Set direction
echo in >/sys/class/gpio/gpioXX/direction
echo out >/sys/class/gpio/gpioXX/direction
Set value
echo 0 >/sys/class/gpio/gpioXX/value
echo 1 >/sys/class/gpio/gpioXX/value
Get value
cat /sys/class/gpio/gpioXX/value
unexport
echo <GPIO#> >/sys/class/gpio/unexport


Initialize and test CAN

Initialize:
ip link set can0 up type can bitrate 500000
Send test message via cansend (part of can-utils):
cansend can0 100#11.2233.44556677.88
Receive message via candump (part of can-utils):
candump can0
Get can-utils:

Test display / framebuffer

fb_1Colorfill Fills the framebuffer device with a given RGB color
Syntax: fb_1Colorfill [fb (0..31)] [Display Bits (1..8)] [Red value (0..255)] [Green value (0..255)] [Blue value (0..255)]
fb_fb2BMP Copies framebuffer device data into a 24Bit BMP-File
Syntax: fb_fb2BMP [fb (0..31)] [24-Bit BMP-File]
fb_LoadBMP Loads a 24Bit BMP-file into a 32Bit framebuffer device
Syntax: fb_LoadBMP [fb (0..31)] [24-Bit BMP-File] [Display Bits (1..8)] [Transparency (0..100)]
In most common cases the "Display Bits" should be "8"


Get DH framebuffer tools:

Additional Information