Activating ARM9 with a working OS » History » Version 5

Vanč Levstik, 04.01.2011 16:34

1 1 Aleksander Bešir
h1. Activating ARM9 with a working OS
2 1 Aleksander Bešir
3 2 Aleksander Bešir
{{toc}}
4 2 Aleksander Bešir
5 1 Aleksander Bešir
h2. Basic concept
6 3 Vanč Levstik
7 3 Vanč Levstik
h3. Hardware
8 3 Vanč Levstik
9 3 Vanč Levstik
!http://www.shrani.si/f/2A/128/4kJtfyhW/arm-picture.jpg!
10 3 Vanč Levstik
We will be using FRI-SMS 32-bit microcontroller based on AT91SAM9620 chip from ARM9 family. It has fast ROM and RAM memories and embedds  Ethernet MAC, one USB Device Port, and a USB Host controller. It also integrates several standard peripherals, such as the USART, SPI, TWI, Timer 
11 3 Vanč Levstik
Counters, Synchronous Serial Controller, ADC and MultiMedia Card Interface. 
12 3 Vanč Levstik
More about microcontroller can be found in "Manual":http://laps.fri.uni-lj.si/fri-sms/datoteke/AT91SAM9260.pdf
13 3 Vanč Levstik
14 3 Vanč Levstik
h3. Software
15 3 Vanč Levstik
16 3 Vanč Levstik
For programming the device we will be using AT91 In-System programmer "SAM-BA":http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3883.
17 3 Vanč Levstik
We will also use "U-BOOT":http://www.denx.de/wiki/U-Boot as a second-step bootloader.
18 3 Vanč Levstik
Our operating system will be Linux, kernel version 2.6.27.
19 3 Vanč Levstik
20 5 Vanč Levstik
h3. Additional hardware
21 3 Vanč Levstik
22 5 Vanč Levstik
For programming flash memory we need additional USB (A-B) cable.
23 5 Vanč Levstik
24 5 Vanč Levstik
For using the arm from our PC, we need RS232 cable, which is made from serial DB9 cable. We open the DB9 cable and connect only three signals(RX, TX and GND) with CRIMP according to "RS232 cable plan":http://laps.fri.uni-lj.si/fri-sms/datoteke/rs232.pdf
25 5 Vanč Levstik
26 5 Vanč Levstik
For our file-system we use SD card (and not SD-hc), which we previously format on PC with linux to ext3, and extract our "Filesystem":http://laps.fri.uni-lj.si/fri-sms/datoteke/rootfs-frisms.ext3.tar.bz2 on it.
27 5 Vanč Levstik
28 3 Vanč Levstik
h2. Installing OS
29 3 Vanč Levstik
30 3 Vanč Levstik
h3. Concept
31 3 Vanč Levstik
32 3 Vanč Levstik
FRI-SMS is built, so it boots from integrated ROM memory. It looks for bootloader into serial flash memory, if it is found it loads into internal SDRAM. This first-step bootloader then sets SDRAM controller and loads second-step bootloader(U-BOOT) into external SDRAM end executes it.
33 3 Vanč Levstik
Second-step bootloader takes care of other microcontroller settings and runs the OS.
34 3 Vanč Levstik
35 3 Vanč Levstik
If bootloader is not found in ROM it searches for bootloader thtrough USB interface and then through RS232 interface and waits there in loop.
36 3 Vanč Levstik
37 3 Vanč Levstik
38 3 Vanč Levstik
h3. Loading software into flash ROM memory
39 3 Vanč Levstik
40 3 Vanč Levstik
* Installing SAM-BA
41 4 Vanč Levstik
       After installing SAM-BA we have to set the drivers correctly. SAM-BA is based on setting connection throuogh COM port, so we have to install a  driver which sets the PC, so it recognizes the USB as COM port. SAM-BA install includes a driver, but it does not work on x64 
42 4 Vanč Levstik
based operating systems such as Windows Vista 64-bit and Windows 7 64-bit. Attached is a modified driver, so it works on those systems (tested on Windows 7).
43 1 Aleksander Bešir
44 1 Aleksander Bešir
45 4 Vanč Levstik
With SAM-BA we establish a connection between PC and FRI-SMS, then we enable DataFlash on external flash memory.
46 4 Vanč Levstik
# First we load second-step bootloader U-BOOT from address *0x8400* onward
47 4 Vanč Levstik
# Next step is Linux OS kernel, which we load on address *0x42000*
48 4 Vanč Levstik
# Last step is first-step bootloader, which must be loaded last, because we can't load any more files after we load first step loader (at least until system restore)
49 5 Vanč Levstik
50 5 Vanč Levstik
51 5 Vanč Levstik
h2. Using the OS
52 5 Vanč Levstik
53 5 Vanč Levstik
h3. Establishing connection
54 5 Vanč Levstik
55 5 Vanč Levstik
For connecting our PC to ARM console we use beforementioned RS232 cable.
56 5 Vanč Levstik
Then we need a program for establishing serial connection. I used Minicom on Ubuntu Linux, in Windows we can use Putty.
57 5 Vanč Levstik
The settings for connection should be as follows:
58 5 Vanč Levstik
- speed 115.200 baud
59 5 Vanč Levstik
- data bits: 8
60 5 Vanč Levstik
- stop bits: 1
61 5 Vanč Levstik
- parity: NO
62 5 Vanč Levstik
- flow control: XON/XOFF