COM AM35 Linux: Difference between revisions
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Linux virtual machine for development == | == Linux virtual machine for development == | ||
* Please have a look at: '''[[Virtual Machine for Application Development]]''' | |||
==Building your own Kernel == | ==Building your own Kernel == | ||
==== Sources for the AM35x Linux Kernel v3.2.12 ==== | ==== Sources for the AM35x Linux Kernel v3.2.12 / v3.2.81 ==== | ||
* The latest Linux Kernel source code is available on GitHub: [https://github.com/dh-electronics/linux-am35x https://github.com/dh-electronics/linux-am35x] | |||
* We recommend to use on new projects the latest v3.2.81 Linux Kernel | |||
==== How to build a kernel ==== | ==== How to build a kernel ==== | ||
Line 46: | Line 19: | ||
|4. <tt># ''cd linux-am35x''</tt> | |4. <tt># ''cd linux-am35x''</tt> | ||
|- | |- | ||
|5. <tt># ''ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make O=../build/ dhcm3517_defconfig''</tt> | |5. <tt># ''git checkout BRANCH''<br/>(BRANCH=dev/3.2.12_dhcom or BRANCH=dev/3.2.81_dhcom)</tt> | ||
|- | |||
|6. <tt># ''ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make O=../build/ dhcm3517_defconfig''</tt> | |||
|- | |- | ||
| | |7. <tt># ''ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make -j5 O=../build/ uImage''</tt> | ||
|} | |} | ||
* Your new <tt>uImage</tt> file is available in <tt>../build/arch/arm/boot</tt> | * Your new <tt>uImage</tt> file is available in <tt>../build/arch/arm/boot</tt> |
Latest revision as of 13:16, 7 October 2016
Linux virtual machine for development
- Please have a look at: Virtual Machine for Application Development
Building your own Kernel
Sources for the AM35x Linux Kernel v3.2.12 / v3.2.81
- The latest Linux Kernel source code is available on GitHub: https://github.com/dh-electronics/linux-am35x
- We recommend to use on new projects the latest v3.2.81 Linux Kernel
How to build a kernel
Get sources from Github and build the linux kernel using 5 threads and a build directory
1. Start a terminal on Linux |
2. # git clone https://github.com/dh-electronics/linux-am35x.git |
3. # mkdir build |
4. # cd linux-am35x |
5. # git checkout BRANCH (BRANCH=dev/3.2.12_dhcom or BRANCH=dev/3.2.81_dhcom) |
6. # ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make O=../build/ dhcm3517_defconfig |
7. # ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make -j5 O=../build/ uImage |
- Your new uImage file is available in ../build/arch/arm/boot
Remark:
- On linux-am35x.git we use the git branch "master".
Sources older than April 2014Sources for the AM35 Kernel based on 3.2.12 Mainline
How to build a kernel
|
Update the kernel with U-Boot
- The linux kernel will be updated by the U-Boot flash update.
1. Copy the uImage
anduImage.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/DEL on a RS232 terminal (during startup) 4. update linux
Debian Rootfilesystem
Available Rootfilesystems
Please have a look at the AM35x Downloads section.
External Documentation
- The Debian Administrator's Handbook: A reference book presenting the Debian distribution, from initial installation to configuration of services. The administration and configuration chapters apply to our Debian based root filesystems.
- Debian Documentation
Login
Debian GNU/Linux 6.0 dhcom ttyO0 dhcom login: root |
Shutdown
# shutdown -h now |
Calibrating the touchscreen
# ts_calibrate |
- Check the enviroment variable "TSLIB_TSDEVICE=/dev/input/event0" with
printenv
if an error occurs.
Running Qt Demos
# cd /usr/qt/demos/demoname # ./demoname -qws |
- For the Qt-Browser change
demoname
tobrowser
- If the touchscreen does not work please check the enviroment variable "QWS_MOUSE_PROTO=Tslib:/dev/input/event0" with
printenv
.
Run Qt demos with powerVR (3d acceleration) support
# cd /usr/qt/demos/embedded/demoname # ./demoname -qws |
Run Qt demos with usb mouse input device
# cd /usr/qt/demos/demoname # export QWS_MOUSE_PROTO=Auto:/dev/input/mice # ./demoname -qws |
Remark: Just remember that you need to run the Qt demos with the options -qws. Omitting -qws results in the app waiting to connect to the QWS Server, which is not running.
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) |
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 |
Remark: If you got a *.tar.gz file so type tar xfzv ... to extract the rootfilesystem.
Kernel Userspace Interfaces to Access Hardware
Serial (UART) Interfaces
DHCOM (FF) UART 1 /dev/ttyO0
DHCOM (BT) UART 2 /dev/ttyO2
DHCOM (STD) UART 3 /dev/ttyO1
I2C Interfaces
DHCOM I2C 1 /dev/i2c-3
DHCOM I2C 2 /dev/i2c-2
On Module Devices /dev/i2c-1
SPI Interfaces
DHCOM SPI 1 /dev/spidev1.0
DHCOM SPI 2 /dev/spidev2.0
Control the display brightness
echo <value> >/sys/class/backlight/omap-pwm-backlight/brightness
- value range: 0..255
Control GPIOs
DHCOM Name: alt. DHCOM Name: SO-DIMM Pin# Linux <GPIO#> GPIO A 154 116 GPIO B 156 117 GPIO C 162 118 GPIO D 163 119 GPIO E 164 125 GPIO F 165 140 GPIO G 167 141 GPIO H 173 155 GPIO I 175 152 CIF HSYNC GPIO J 74 96 CIF PCLK GPIO K 72 94 CIF MCLK GPIO L 70 58 CIF VSYNC GPIO M 68 97 CIF D9 GPIO N 66 98 CIF D8 GPIO O 64 95 CIF D7 GPIO P 62 106 CIF D6 GPIO Q 60 105 CIF D5 GPIO R 58 104 CIF D4 GPIO S 56 103 CIF D3 GPIO T 54 102 CIF D2 GPIO U 52 101 CIF D1 GPIO V 50 100 CIF D0 GPIO W 48 99
- Remark: Depending on your board configuration some of the additional gpios shared with the camera interface are not available on your system.
- Export
echo <GPIO#> >/sys/class/gpio/export
- Remark: Have a look into
/sys/class/gpio/
for already configured gpios.
- Remark: Have a look into
- Set direction
echo in >/sys/class/gpio/gpio<GPIO#>/direction
echo out >/sys/class/gpio/gpio<GPIO#>/direction
- Set state
echo 0 >/sys/class/gpio/gpio<GPIO#>/value
echo 1 >/sys/class/gpio/gpio<GPIO#>/value
Initialize and Test CAN Interface
- 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 can messages (part of can-utils):
candump can0
- Get can-utils:
Testing display / framebuffer
- In most common cases the "Display Bits" should be "8"
- With "fb" you select the number of the framebuffer device (e.g. /dev/fb0)
fb_1Colorfill
Fills the framebuffer device with a given RGB color fb_1Colorfill [fb (0..31)] [Display Bits (1..8)] [Red value (0..255)] [Green value (0..255)] [Blue value (0..255)]
fb_fb2BMP
Copies the framebuffer device data into a 24Bit BMP-File fb_fb2BMP [fb (0..31)] [24-Bit BMP-File]
fb_LoadBMP
Loads a 24Bit BMP-file into a 32Bit framebuffer device fb_LoadBMP [fb (0..31)] [24-Bit BMP-File] [Display Bits (1..8)] [Transparency (0..100)]
- Get DH farmebuffer tools: