- Timestamp:
-
09/18/13 22:26:04 (11 years ago)
- Author:
-
Shubhamsomani
- Comment:
-
/* Using generated header with Applications */
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v41
|
v42
|
|
85 | 85 | |
86 | 86 | |
| 87 | {{{ |
| 88 | This post will cover on how to use the generated header with applications. |
| 89 | |
87 | 90 | For using the header there are basically 3 major steps- |
88 | 91 | |
… |
… |
|
94 | 97 | examples-v2 has a lot of sample applications. You can choose any one of them to use with the header. |
95 | 98 | For the purpose of this tutorial I will choose the ticker application. |
96 | | |
97 | 99 | Step 2) Generate the header- |
98 | 100 | |
99 | 101 | Now open the editor you are most comfortable with and open the init.c file of the particular application. |
100 | | init.c is the file which contains configuration data of the application. Scroll down and you would see configuration information. For the ticker application the configuration information looks as follows-https://docs.google.com/file/d/0B41ApxXt-m4jckZqN29PMXVXUms/edit |
| 102 | init.c is the file which contains configuration data of the application. Scroll down and you would see configuration information. For the ticker application the configuration information looks as follows- {{{ https://docs.google.com/file/d/0B41ApxXt-m4jckZqN29PMXVXUms/edit }}} |
101 | 103 | |
102 | 104 | Now since we wish to use the header generated by the GUI for storing our configuration information, we open the GUI. On opening the GUI you will be greeted by a welcome screen. On the welcome screen you would see a box saying open conf.t. Click on that box and go to the location of conf.t (http://git.rtems.org/rtems/tree/doc/user/conf.t) . It should be present in rtems/doc/user/conf.t. |
… |
… |
|
112 | 114 | |
113 | 115 | 3) Click on the classic API initialization tasks table and set |
114 | | |
115 | 116 | CONFIGURE_RTEMS_INIT_TASKS_TABLE |
116 | | |
117 | 117 | CONFIGURE_INIT_TASK_STACK_SIZE (2 * RTEMS_MINIMUM_STACK_SIZE) |
118 | 118 | |
119 | 119 | 4) Click on the basic system information tab and set |
120 | | |
121 | 120 | CONFIGURE_EXTRA_TASK_STACKS (4 * RTEMS_MINIMUM_STACK_SIZE) |
122 | 121 | |
… |
… |
|
124 | 123 | |
125 | 124 | Now that you have the header, remove the configuration information from init.c and instead replace it with |
126 | | |
127 | 125 | # include "header.h" |
128 | 126 | |
129 | | If you do a git diff then it contents should be like this (for ticker's init.c) - http://pastebin.com/d646i1uy |
| 127 | If you do a git diff then it contents should be like this (for ticker's init.c) - {{{ http://pastebin.com/d646i1uy }}} |
130 | 128 | |
131 | 129 | If you wish you can also save this configuration and use it later for future applications. |
… |
… |
|
136 | 134 | |
137 | 135 | These 2 sections would be of great help for learning how to compile and run the application- |
138 | | |
139 | 136 | -> http://www.rtems.org/wiki/index.php/Example_Application_Compiling |
140 | | |
141 | 137 | -> http://www.rtems.org/wiki/index.php/Quick_Start |
142 | 138 | |
143 | 139 | Here I would take SPARC for the purpose of compiling. |
144 | | Please go to the ticker sub directory do the following steps for compiling and running - |
145 | | |
146 | | 1) export RTEMS_MAKEFILE_PATH=prefix/sparc-rtems4.11/sis/ |
147 | | |
148 | | 2) export PATH=/opt/rtems-4.11/bin:$PATH |
149 | | |
150 | | 3) ../rtems/configure --target=sparc-rtems4.11 --enable-rtemsbsp=sis \ |
151 | | --enable-tests=samples --disable-posix |
152 | | |
153 | | 4) make |
154 | | |
155 | | 5) find the ticker executable- |
156 | | |
| 140 | |
| 141 | 1) Configure the shell to compile the BSP |
| 142 | {{{ |
| 143 | export RTEMS_MAKEFILE_PATH=prefix/sparc-rtems4.11/sis/ |
| 144 | }}} |
| 145 | |
| 146 | 2)Add the RTEMS toolset to the PATH |
| 147 | |
| 148 | {{{ |
| 149 | export PATH=/opt/rtems-4.11/bin:$PATH |
| 150 | }}} |
| 151 | |
| 152 | |
| 153 | 3) clone examples-v2 {{{ http://git.rtems.org/examples-v2/ }}} and cd into it |
| 154 | {{{ |
| 155 | cd examples-v2 |
| 156 | }}} |
| 157 | |
| 158 | 4) build the executable |
| 159 | {{{ |
| 160 | make |
| 161 | }}} |
| 162 | |
| 163 | 5) Run the the ticker executable in GDB |
| 164 | {{{ |
157 | 165 | sparc-rtems4.11-gdb `find . -name ticker.exe` |
158 | | |
159 | | 5) |
160 | | |
| 166 | }}} |
| 167 | |
| 168 | 5) Select the sim target in GDB |
| 169 | {{{ |
161 | 170 | (gdb) target sim |
162 | | |
163 | | Connected to the simulator. |
164 | | |
| 171 | Connected to the simulator. |
| 172 | }}} |
| 173 | |
| 174 | Load and run the executable |
| 175 | {{{ |
165 | 176 | (gdb) load |
166 | | |
167 | 177 | (gdb) run |
| 178 | }}} |
168 | 179 | |
169 | 180 | |
170 | 181 | And voila! your application runs with ease! :) |
| 182 | }}} |
171 | 183 | = TUI Directory Structure = |
172 | 184 | |