yaffs_rtems: Add yaffs_cache to RTEMS makefile and tweak RTEMS
[yaffs2.git] / rtems / RTEMS_NOTES
1
2
3 Building with Makeifle
4
5 Assuming the BSP is the sparc erc32 BSP in:
6 /home/charles/quick-start/rtems/5/sparc-rtems5/erc32/
7
8
9
10 Set up environment variuables
11
12 export RTEMS_MAKEFILE_PATH=/home/charles/quick-start/rtems/5/sparc-rtems5/erc32/
13 export PATH=/home/charles/quick-start/rtems/5/bin/:$PATH
14
15 Now we can build and install the Yaffs library:
16
17 $cd /opt/y/git/yaffs2/rtems
18
19 $make -f Makefile.rtems clean
20 $make -f Makefile.rtems all
21    output is build-erc32/libyaffs2.a
22 $make -f Makefile.rtems install
23    mkdir -p /home/charles/quick-start/rtems/5/sparc-rtems5/erc32/lib/include/yaffs
24    install -m 644 build-erc32/libyaffs2.a /home/charles/quick-start/rtems/5/sparc-rtems5/erc32/lib
25    install -m 644 rtems_yaffs.h yportenv.h ydirectenv.h yaffs_osglue.h yaffs_hweight.h yaffscfg.h yaffs_list.h yaffsfs.h yaffs_guts.h yaffs_packedtags2.h yaffs_ecc.h /home/charles/quick-start/rtems/5/sparc-rtems5/erc32/lib/include/yaffs
26
27
28 Building test application
29
30
31 $ cd rtems-y-test/basic-test
32 $ make
33
34 $ sparc-rtems5-sis o-optimize/yaffs-rtems-test.exe 
35
36  SIS - SPARC/RISCV instruction simulator 2.20,  copyright Jiri Gaisler 2019
37  Bug-reports to jiri@gaisler.se
38
39  ERC32 emulation enabled
40
41  Loaded o-optimize/yaffs-rtems-test.exe, entry 0x02000000
42 sis> go
43 resuming at 0x02000000
44 Starting
45 Created simulated flash device 0x2d203c8
46 yaffs: 0 blocks to be sorted...
47 ....
48
49
50 Running with GDB
51
52 Open a second terminal to run sis in gdb mode
53
54 $ sparc-rtems5-sis -gdb
55
56  SIS - SPARC/RISCV instruction simulator 2.20,  copyright Jiri Gaisler 2019
57  Bug-reports to jiri@gaisler.se
58
59  ERC32 emulation enabled
60
61 gdb: listening on port 1234 connected
62 X2000000,0:#40
63
64
65 *** HELLO WORLD TEST ***
66 Hello World 123
67 *** END OF HELLO WORLD TEST ***
68
69 *** FATAL ***
70 fatal source: 5 (RTEMS_FATAL_SOURCE_EXIT)
71 fatal code: 0 (0x00000000)
72 RTEMS version: 5.0.0.e22554535796fc29a7ed7c5e2338128e324a621d-modified
73 RTEMS tools: 7.5.0 20191114 (RTEMS 5, RSB 5 (599c4d7c87fa), Newlib d14714c69)
74 executing thread ID: 0x08a010001
75 executing thread name: UI1 
76
77
78
79
80
81
82 From other window use gdb
83
84
85
86 $ sparc-rtems5-gdb hello.exe
87 GNU gdb (GDB) 8.3
88 Copyright (C) 2019 Free Software Foundation, Inc.
89 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
90 This is free software: you are free to change and redistribute it.
91 There is NO WARRANTY, to the extent permitted by law.
92 Type "show copying" and "show warranty" for details.
93 This GDB was configured as "--host=x86_64-linux-gnu --target=sparc-rtems5".
94 Type "show configuration" for configuration details.
95 For bug reporting instructions, please see:
96 <http://www.gnu.org/software/gdb/bugs/>.
97 Find the GDB manual and other documentation resources online at:
98     <http://www.gnu.org/software/gdb/documentation/>.
99
100 For help, type "help".
101 Type "apropos word" to search for commands related to "word"...
102 Reading symbols from hello.exe...
103 (gdb) target remote :1234
104 :1234: Connection timed out.
105 (gdb) target remote :1234
106 Remote debugging using :1234
107 0x00000000 in ?? ()
108 (gdb) load
109 Loading section .text, size 0x12880 lma 0x2000000
110 Loading section .rtemsroset, size 0x40 lma 0x2012880
111 Loading section .data, size 0x530 lma 0x20138c0
112 Start address 0x2000000, load size 77296
113 Transfer rate: 2434 KB/sec, 270 bytes/write.
114 (gdb) c
115 Continuing.
116
117 Program received signal SIGTERM, Terminated.
118 syscall () at /home/charles/quick-start/src/rtems/c/src/../../cpukit/score/cpu/sparc/syscall.S:44
119 44              ta      0                       ! syscall 1, halt with %g1,%g2,%g3 info
120 (gdb) 
121