Difference: RaspiElf (21 vs. 22)

Revision 222017-12-20 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 75 to 75
 

How to get and build the RaspiElf tools

Get the source from the GIT repository (if you have not installed GIT yet, then install it with

Changed:
<
<
sudo apt-get install git):
pi@cosmac:~/elf $ git clone https://github.com/spyren/RaspiElf
>
>
sudo apt-get install git), type only the bold text after the $ sign:
pi@cosmac:~/elf $ git clone https://github.com/spyren/RaspiElf

 Cloning into 'RaspiElf'... remote: Counting objects: 68, done. remote: Compressing objects: 100% (37/37), done.
Line: 85 to 85
 Unpacking objects: 100% (68/68), done. Checking connectivity... done. pi@cosmac:~/elf $
Changed:
<
<
>
>
  Build (compile) from the sources:
Changed:
<
<
pi@cosmac:~/elf $ cd RaspiElf
pi@cosmac:~/elf/RaspiElf $ cd tools/
pi@cosmac:~/elf/RaspiElf/tools $ make
>
>
pi@cosmac:~/elf $ cd RaspiElf
pi@cosmac:~/elf/RaspiElf $ cd tools/
pi@cosmac:~/elf/RaspiElf/tools $ make

 cc -g -c elf2bin.c cc -g -c raspi_gpio.c cc -g -o elf2bin -lwiringPi elf2bin.o raspi_gpio.o
Line: 100 to 100
 cc -g -c elf.c cc -g -o elf -lwiringPi elf.o raspi_gpio.o pi@cosmac:~/elf/RaspiElf/tools $
Changed:
<
<
>
>
  Install the binaries into /usr/local/bin
Changed:
<
<
pi@cosmac:~/elf/RaspiElf/tools $ sudo make install
>
>
pi@cosmac:~/elf/RaspiElf/tools $ sudo make install

 install -m 557 elf2bin bin2elf elf /usr/local/bin
Changed:
<
<
>
>
 

Sample session

Added:
>
>
Type only the bold text after the $ sign.
  Initialise the Elf memory with 00H (32 Kib):
Changed:
<
<
pi@cosmac:~/elf/RaspiElf/chase $ bin2elf -e 7fff </dev/zero
>
>
pi@cosmac:~/elf/RaspiElf/chase $ bin2elf -e 7fff </dev/zero

 0x8000 bytes written
Changed:
<
<
>
>
  Upload and run the chase lighting program (details see ChaseLighting):
Changed:
<
<
pi@cosmac:~/elf/RaspiElf/chase $ bin2elf -w -r chase.bin
>
>
pi@cosmac:~/elf/RaspiElf/chase $ bin2elf -w -r chase.bin

 0x002d bytes written
Changed:
<
<
>
>
  Stop the program an go into the load state:
Changed:
<
<
pi@cosmac:~/elf/RaspiElf/chase $ elf load
>
>
pi@cosmac:~/elf/RaspiElf/chase $ elf load

 01 1 0 0 1 1 0 0c
Changed:
<
<
>
>
  Hexdump the Elf memory until address 0x3f (hexdump is standard UNIX tool and is included in Raspbian and other GNU/Linux'):
Changed:
<
<
pi@cosmac:~/elf/RaspiElf/chase $ elf2bin -e 3f | hexdump -C 
>
>
pi@cosmac:~/elf/RaspiElf/chase $ elf2bin -e 3f | hexdump -C

 0x0040 bytes read 00000000 c0 00 03 e3 90 b3 f8 30 a3 f8 01 53 64 6c 23 fa |.......0...Sdl#.| 00000010 fe 3a 1a f0 f6 c7 f8 80 30 1f f0 fe c7 f8 01 53 |.:......0......S| 00000020 f8 14 b2 22 92 3a 23 c5 7a 38 7b 30 0c 00 00 00 |...".:#.z8{0....| 00000030 04 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040
Changed:
<
<
>
>
  Get the mode and the data (LEDs and swiches)
Changed:
<
<
pi@cosmac:~/elf/RaspiElf/chase $ elf
>
>
pi@cosmac:~/elf/RaspiElf/chase $ elf

 02 1 1 0 1 1 1 ff
Changed:
<
<
pi@cosmac:~/elf/RaspiElf/chase $ elf -v
>
>
pi@cosmac:~/elf/RaspiElf/chase $ elf -v
 LED:01 Q:1 Rx:1 IN:0 WAIT:1 CLR:1 READ:0 SWITCH:0c
Changed:
<
<
>
>
  Write enable (not READ)
Changed:
<
<
pi@cosmac:~/elf/RaspiElf/chase $ elf -n read
>
>
pi@cosmac:~/elf/RaspiElf/chase $ elf -n read

 02 1 1 0 1 1 0 ff
Changed:
<
<
>
>
  Run mode (starts the chase lighting again)
Changed:
<
<
pi@cosmac:~/elf/RaspiElf/chase $ elf run
>
>
pi@cosmac:~/elf/RaspiElf/chase $ elf run
  Put 0000'0000B to the switches (chase LEDs from right to left)
Changed:
<
<
pi@cosmac:~/elf/RaspiElf/chase $ elf put 0
>
>
pi@cosmac:~/elf/RaspiElf/chase $ elf put 0

 40 1 1 0 0 0 0 00
Changed:
<
<
>
>
  Put 1000'0000B to the switches (chase LEDs from left to right)
Changed:
<
<
pi@cosmac:~/elf/RaspiElf/chase $ elf put 80
>
>
pi@cosmac:~/elf/RaspiElf/chase $ elf put 80

 10 1 1 0 0 0 0 80
Changed:
<
<
>
>
  Get the mode and data while the program is running (LEDs and Q are changing)
Changed:
<
<
pi@cosmac:~/elf/RaspiElf/chase $ elf -v
>
>
pi@cosmac:~/elf/RaspiElf/chase $ elf -v

 LED:40 Q:1 Rx:1 IN:0 WAIT:0 CLR:0 READ:0 SWITCH:80
Changed:
<
<
pi@cosmac:~/elf/RaspiElf/chase $ elf -v
>
>
pi@cosmac:~/elf/RaspiElf/chase $ elf -v
 LED:02 Q:0 Rx:1 IN:0 WAIT:0 CLR:0 READ:0 SWITCH:80
Changed:
<
<
>
>
 

Wiring

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback