DHCOM iMX25-D2

From Wiki-DB
Revision as of 14:34, 24 November 2011 by Christoph (talk | contribs)
Jump to navigationJump to search

400px|COM iMX25

Hardware


Bootloader U-Boot


WinCE


Linux



Hardware

Hardware Errata

Version 406-200: 
  Affected serial numbers:
    1164AA KA11.0328 ...
    11641A KA11.0328 ...
  VCC_BAT errata: 
    Description: If VCC_BAT does not go down to 0V the processor may hang during a power-on cycle.
    Workaround: Don't connect a battery or a gold cap to the VCC_BAT pin (pin 200) on the SODIMM-200 connector. In addition to that you can't buffer the date and time information.
  SPI Flash errata:
    Description: Boot from SPI Flash is not possible, because the wrong CS is connected to the serial flash memory.
    Workaround: -

SD interface wire length

The max. wire length from the SODIMM-200 connector to the SD Card Slot is 80mm (without buffer).

Released MicroSD Cards

ATP AF128UDI141313M82LTAAS-10	128MB	Industrial Card
Delkin SD128HSSD-S2047-B	128MB	Industrial Card
ATP AF1GUDI261313M82LTAAS-10	1GB	Industrial Card
Delkin SD01GHSSD-S2047-B	1GB	Industrial Card
ATP AF2GUDI461313M82LTAAS-10	2GB	Industrial Card
Transcend TS2GUSD		2GB	No industrial Card

Bootloader U-Boot

Console commands

NAND Flash

Nand Flash Read
nand read <SDRAM address> <NAND Flash address> <Bytes>
Example: nand read 80000000 400000 b40000
Description: Copies 11,25MByte from NAND Flash address 0x40_0000 to SDRAM address 0x8000_0000
Nand Flash Erase
nand erase <Block base address> <Bytes>
Example: nand erase 400000 40000
Description: Deletes NAND Flash content from address 0x40_0000 to 0x43_FFFF
Note: The Bytes information needs to be block size aligned!
Nand Flash Write
nand write <SDRAM address> <NAND Flash address> <Bytes>
Example: nand write 80000000 400000 b40000
Description: Cpoies 11,25MByte from SDRAM address 0x8000_0000 to NAND Flash address 0x40_0000
Note: The Bytes information needs to be page size aligned!
Show bad NAND Flash blocks
nand bad
Description: Shows the bad NAND Flash blocks.
Show NAND FLash content
nand dump <NAND Flash address>
Example: nand dump 400000
Description: Shows the content of the specified NAND Flash block

LCD contoller

Show LCD controller settings
lcdinfo
Example:
 Display Resolution: 800 x 480 pixels
 Display Type:       Active Color Display
 Pixel Clock:        22 MHz
 Bits per Pixel:     16 Bits/Pixel
 Pixel Polarity:     Active High
 VSYNC Polarity:     Active Low
 HSYNC Polarity:     Active Low
 Clock Polarity:     Pos. Edge
 Output En Polarity: Active High
 HSYNC Puls Width:   64 Clock Cycles
 HSYNC Back Porch:   86 Clock Cycles
 HSYNC Front Porch:  42 Clock Cycles
 VSYNC Puls Width:   2 Line Cycles
 VSYNC Back Porch:   33 Line Cycles
 VSYNC Front Porch:  10 Line Cycles

GPIO's

Show DHCOM GPIO settings
gpioinfo
Example:
 GPIO_A: Direction = Input
         State     = 0
 GPIO_B: Direction = Input
         State     = 0
 GPIO_C: Direction = Input
         State     = 0
 GPIO_D: Direction = Input
         State     = 0
 GPIO_E: Direction = Input
         State     = 1
 GPIO_F: Direction = Input
         State     = 1
 GPIO_G: Direction = Output
         State     = 1
 GPIO_H: Direction = Input
         State     = 1
 GPIO_I: Direction = Input
         State     = 1
 GPIO_J: Direction = Input
         State     = 1
 GPIO_K: Direction = Input
         State     = 0

SD/MMC Card

Switch between MicroSD and SD Slot
mmcswitch <Slot number>
Example: mmcswitch 2
Description: Switch between SD/MMC Slots: 1 --> SD/MMC Slot, 2 --> MicroSD Slot
Initialize SD/MMC Card
mmcinit
Description: Initialize new inserted SD Card

Filesystem

Show Filesystem information
fatinfo <interface> <device>
Example: fatinfo mmc 1
Interface: MMC
 Device 1: Vendor: Man 094150 Snr 266e068c Rev: 1.0 Prod: AF UD
           Type: Removable Hard Disk
           Capacity: 121.2 MB = 0.1 GB (248320 x 512)
 Partition 1: Filesystem: FAT16 "NO NAME    "
List files
fatls <interface> <device> <directory>
Example 1: fatls mmc 1
Example 2: fatls mmc 1 /folder
Load Files from SD Card to SDRAM
fatload <interface> <device> <SDRAM address> <directory+filename>
Example 1: fatload mmc 1 80100000 nk.gz
Example 2: fatload mmc 1 80100000 /folder/nk.gz

Ethernet

Load File via TFTP to SDRAM
tftp <SDRAM address> <directory+filename>
Example: tftp 80100000 nk.gz
Example TFTP Server: "Winagents TFTP Server Manager"
Note: For TFTP download it is necessary to config the ENV variables "ipaddr" and "serverip"
Ping
ping <IP address>
Example: ping 192.168.55.32
Read PHY register via MII interface
mii dump <PHY address> <PHY register>
Example: mii dump 1 0
Description: Shows PHY control register content.

Environment

Show ENV variables
printenv
bootdelay=0
baudrate=38400
ipaddr=192.168.55.230
serverip=192.168.55.36
gatewayip=192.168.55.36
netmask=255.255.255.0
frias=5
kernel=uImage
bootargs=console=ttymxc0,115200 root=/dev/mmcblk0p2
nandbootwince=update;bootwince 00200000
splashimage=0x000c0000
save_ENV_to_flash=setenv ENVinFlash 1; saveenv
ENVinFlash=1
ethaddr=00:04:a3:34:b6:0d
ethact=FEC0
winceimagetype=nk.gz
winceimagesize=00ba55ee
loadaddr=00200000
bootcmd=run nandbootwince
filesize=212050
Environment size: 449/262140 bytes
Set ENV variables
setenv <ENV name> <ENV value>
Example: setenv ipaddr 192.168.55.2
Note: If you need to edit "bootcmd" it is necessary to insert ";" between the unique commands. You can enter ";" at the command line with "\;".
Save ENV variables
saveenv

Update

Note: See also Bootloader subitem Flash Update.
iMX25_update.bmp file
update
Description: Starts Flash update with "iMX25_update.bmp" file.
Command line
update <type> [filename]
Type:
wince = WinCE image update (default file names nk.gz or nk.bin) + ENV update
linux = Linux image update (default file name uImage) + ENV update (default script file name uImage.env)
flash = Complete flash image update
bootloader = Bootloader update (default file name u-boot.bin)
splash = Bootbitmap update (default file name splash.bmp)
settings = Settings block update (default file name settings.bin)

I2C

List available devices
i2c probe
Valid chip addresses: 00 57 6F
0x5F = DHCOM i.MX25 Core Module EEPROM
0x6F = DHCOM i.MX25 Core Module Real Time Clock
Read
i2c md <I2C address> <I2C register> <Bytes>
Example: i2c md 57 0 10
Description: Reads 10 Bytes from the offset 0.
Write
i2c mw <I2C address> <I2C register> <Value> <Bytes>
Example: i2c mw 57 0 aa 5
Description: Writes 0xaa to 5 Bytes from the offset 0.

OS Boot

WinCE
bootwince <Image address> [debug]
Example: bootwince 200000
Description: The address 0x20_0000 specifies NAND Flash image address. The image is loaded from NAND flash to SDRAM. Next to that u-boot starts WinCE. The "debug" option make sure that the image wouldn't be started after uncompressing.
Note: The Image address could also be an SDRAM address. But it is necessary to copy the Image (via tftp or nand flash commands) to the SDRAM before calling "bootwince".
bootwince tftp
Note: The ENV variables "loadaddr" and "bootfile" needs to be set before calling the command. For *.gz image types the "loadaddr" should be set to 0x8290_0000 and for *.bin images the address should be 0x8100_0000.
Linux
bootm <Kernel address> [arg]
Note: When booting a Linux kernel,‘arg' can be the address of an initrd image.

Unzip

unzip <source address> <destination address>
Example: unzip 82900000 80100000
Note: The unzip command is supporting the gzip file format.

Bitmap

Information
bmp info <Bitmap address>
Image size    : 800 x 480
Bits per pixel: 8
Compression   : 0
Display
bmp display <Bitmap SDRAM address> [x y]

Memory

Display
md[.b, .w, .l] <address> [count]
Example: md.b 80100000 100
Write
mw[.b, .w, .l] <address> <value> [count]
Example: mw.b 80100000 aa 100
Description: Writes the value 0xaa to the next 0x100 bytes from the address 0x8010_0000.
Copy
cp[.b, .w, .l] <source> <destination> <count>

Hardware settings

The Hardware settings could be configured via the settings.bin file in the NAND flash memory. The file contains the following settings:

- LCD Controller settings
- Backlight PWM settings
- Backlight enable GPIO
- DHCOM GPIO default direction and state
- FFUART outputs from Bootloader and OS at the starting time
- Default SD Slot for updates

An exact description about creating the file and about the file content could be found on the "iMX25CreateSettingsBin - Bedienungsanleitung.pdf".

Flash Update

The follwing updates are possible with the Bootloader:

  1. Bootloader
  2. Splashimage
  3. Settings
  4. Complete Flash content
  5. Linux image
  6. WinCE image

The following Update Types are possible:

  1. Via iMX25_update.bmp file
  2. From the bootloader console (command line)

iMX25_update.bmp File

For this update Type you need the "iMX25_update.bmp" file and the image file (e.g. nk.gz for WinCE) on the SD Card. After power on the update starts automatically. The "iMX25_update.bmp" file contains three pictures (Update in progress, Update done and Update error) which are shown on the display during the update process. The file contains also an argument which defines the update type (WinCE image, Linux image, ...). An exact description can be found on "iMX25CreateUpdateBmp - Bedienungsanleitung.pdf".

Command line Update

It is possible to update the DHCOM i.MX25 Core Module form the command line without "iMX25_update.bmp" file. The advantage is the possibility to run multiple updates in series. This update type dosen't use the display to show the progress. You need only the corresponding files on the SD Card for the update.
update <type> [filename]
Type:
wince = WinCE image update (default file names nk.gz or nk.bin) + ENV update
linux = Linux image update (default file name uImage) + ENV update (default script file name uImage.env)
Note: If you run an linux update, u-boot searches also for an update ENV script. This script modifies the ENV for Linux. The name of the script must be the image name with the ending .env. You can also run an update without an script file. In this case u-boot only updates the image and the ENV remains unchanged.
You could create the Linux ENV script from an Linux_uboot_env.txt file with the tool "Linux_uboot_env_make.exe". See this example for the Linux_uboot_env.txt file:
echo Set ENV for Linux
echo ----------------- 
setenv frias 5 
setenv kernel uImage
setenv loadaddr 80200000
setenv bootdelay 0
setenv machid 1770
setenv bootargs console=ttymxc1,38400 root=/dev/mmcblk0p1 rootwait ip=dhcp
setenv bootcmd run nandbootlinux\; 
saveenv
flash = Complete flash image update
bootloader = Bootloader update (default file name u-boot.bin)
Note: The ENV in Flash memory is created on the first start of u-boot. If you run a bootloader update and the ENV at the new bootloader has changed, the ENV in Flash memory remains unchanged with the bootloader update. But you could delete the ENV block in flash memory before the update, then u-boot will create the new default ENV at the next start after the bootloader update.
splash = Bootbitmap update (default file name splash.bmp)
settings = Settings block update (default file name settings.bin)
Note: Please have a look at the Bootloader subitem Hardware settings.

WinCE

Registry Settings

LCD Controller

[HKEY_LOCAL_MACHINE\Drivers\Display\LCDC]
  "PanelType"=dword:1    ; LCD Panel identifier 
                         ; Description: Set "PanelType" = 0 to use the bootloader LCD controller settings, which can be programmed to NAND Flash via settings.bin file.
[HKEY_LOCAL_MACHINE\SYSTEM\GDI\ROTATION]
  "Angle"=dword:0        ; no rotation
                         ; "Angle"=dword:5A --> 90 degrees rotated clockwise
                         ; "Angle"=dword:B4 --> 180 degrees rotated clockwise
                         ; "Angle"=dword:10E --> 270 degrees rotated clockwise

Task Bar Look

[HKEY_LOCAL_MACHINE\Explorer]
  “QVGA“=dword:00000001  ; Change Task bar style: 0 --> normal Windows look, 1 --> PDA look

NAND Flash (FlashDisk) base address

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\NAND_Flash]
  “FlashDiskBaseAddress“=dword:02000000  ; Configures the WinCE NAND FlashDisk Base address

Linux

General

Greate a root file system

1. Format a SD card with ext3 file system
2. Copy root file system onto the SD card
   -Start terminal 
   -su
   -chmod 755 /directory/of/the/SD-card
   -cd /directory/of/the/SD-card
   -tar jxvf rootFS_file.tar.bz2

Debian system

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
For the Qt-Browser change demoname to browser

Login/Shutdown system

Name:     root
password: foo

shutdown -h now

Busybox system

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

Name: root

halt