]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M0_STM32F0518_IAR/RegTest.s
Prepare for V7.2.0 release.
[freertos] / FreeRTOS / Demo / CORTEX_M0_STM32F0518_IAR / RegTest.s
1 /*\r
2     FreeRTOS V7.2.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
3 \r
4 \r
5     ***************************************************************************\r
6      *                                                                       *\r
7      *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
8      *    Complete, revised, and edited pdf reference manuals are also       *\r
9      *    available.                                                         *\r
10      *                                                                       *\r
11      *    Purchasing FreeRTOS documentation will not only help you, by       *\r
12      *    ensuring you get running as quickly as possible and with an        *\r
13      *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
14      *    the FreeRTOS project to continue with its mission of providing     *\r
15      *    professional grade, cross platform, de facto standard solutions    *\r
16      *    for microcontrollers - completely free of charge!                  *\r
17      *                                                                       *\r
18      *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
19      *                                                                       *\r
20      *    Thank you for using FreeRTOS, and thank you for your support!      *\r
21      *                                                                       *\r
22     ***************************************************************************\r
23 \r
24 \r
25     This file is part of the FreeRTOS distribution.\r
26 \r
27     FreeRTOS is free software; you can redistribute it and/or modify it under\r
28     the terms of the GNU General Public License (version 2) as published by the\r
29     Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
30     >>>NOTE<<< The modification to the GPL is included to allow you to\r
31     distribute a combined work that includes FreeRTOS without being obliged to\r
32     provide the source code for proprietary components outside of the FreeRTOS\r
33     kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
34     WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
35     or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
36     more details. You should have received a copy of the GNU General Public\r
37     License and the FreeRTOS license exception along with FreeRTOS; if not it\r
38     can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
39     by writing to Richard Barry, contact details for whom are available on the\r
40     FreeRTOS WEB site.\r
41 \r
42     1 tab == 4 spaces!\r
43     \r
44     ***************************************************************************\r
45      *                                                                       *\r
46      *    Having a problem?  Start by reading the FAQ "My application does   *\r
47      *    not run, what could be wrong?                                      *\r
48      *                                                                       *\r
49      *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
50      *                                                                       *\r
51     ***************************************************************************\r
52 \r
53     \r
54     http://www.FreeRTOS.org - Documentation, training, latest information, \r
55     license and contact details.\r
56     \r
57     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
58     including FreeRTOS+Trace - an indispensable productivity tool.\r
59 \r
60     Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
61     the code with commercial support, indemnification, and middleware, under \r
62     the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
63     provide a safety engineered and independently SIL3 certified version under \r
64     the SafeRTOS brand: http://www.SafeRTOS.com.\r
65 */\r
66 \r
67         RSEG    CODE:CODE(2)\r
68         thumb\r
69 \r
70         EXTERN ulRegTest1LoopCounter\r
71         EXTERN ulRegTest2LoopCounter\r
72 \r
73         PUBLIC vRegTest1Task\r
74         PUBLIC vRegTest2Task\r
75 \r
76 /*-----------------------------------------------------------*/\r
77 vRegTest1Task\r
78 \r
79         /* Fill the core registers with known values.  This is only done once. */\r
80         movs r1, #101\r
81         movs r2, #102\r
82         movs r3, #103\r
83         movs r4, #104\r
84         movs r5, #105\r
85         movs r6, #106\r
86         movs r7, #107\r
87         movs r0, #108\r
88         mov      r8, r0\r
89         movs r0, #109\r
90         mov  r9, r0\r
91         movs r0, #110\r
92         mov      r10, r0\r
93         movs r0, #111\r
94         mov      r11, r0\r
95         movs r0, #112\r
96         mov  r12, r0\r
97         movs r0, #100\r
98 \r
99 reg1_loop\r
100         /* Repeatedly check that each register still contains the value written to\r
101         it when the task started. */\r
102         cmp     r0, #100\r
103         bne     reg1_error_loop\r
104         cmp     r1, #101\r
105         bne     reg1_error_loop\r
106         cmp     r2, #102\r
107         bne     reg1_error_loop\r
108         cmp r3, #103\r
109         bne     reg1_error_loop\r
110         cmp     r4, #104\r
111         bne     reg1_error_loop\r
112         cmp     r5, #105\r
113         bne     reg1_error_loop\r
114         cmp     r6, #106\r
115         bne     reg1_error_loop\r
116         cmp     r7, #107\r
117         bne     reg1_error_loop\r
118         movs r0, #108\r
119         cmp     r8, r0\r
120         bne     reg1_error_loop\r
121         movs r0, #109\r
122         cmp     r9, r0\r
123         bne     reg1_error_loop\r
124         movs r0, #110\r
125         cmp     r10, r0\r
126         bne     reg1_error_loop\r
127         movs r0, #111\r
128         cmp     r11, r0\r
129         bne     reg1_error_loop\r
130         movs r0, #112\r
131         cmp     r12, r0\r
132         bne     reg1_error_loop\r
133 \r
134         /* Everything passed, increment the loop counter. */\r
135         push { r1 }\r
136         ldr     r0, =ulRegTest1LoopCounter\r
137         ldr r1, [r0]\r
138         adds r1, r1, #1\r
139         str r1, [r0]\r
140         pop { r1 }\r
141 \r
142         /* Start again. */\r
143         movs r0, #100\r
144         b reg1_loop\r
145 \r
146 reg1_error_loop\r
147         /* If this line is hit then there was an error in a core register value.\r
148         The loop ensures the loop counter stops incrementing. */\r
149         b reg1_error_loop\r
150         nop\r
151 \r
152 \r
153 \r
154 vRegTest2Task\r
155 \r
156         /* Fill the core registers with known values.  This is only done once. */\r
157         movs r1, #1\r
158         movs r2, #2\r
159         movs r3, #3\r
160         movs r4, #4\r
161         movs r5, #5\r
162         movs r6, #6\r
163         movs r7, #7\r
164         movs r0, #8\r
165         mov     r8, r0\r
166         movs r0, #9\r
167         mov r9, r0\r
168         movs r0, #10\r
169         mov     r10, r0\r
170         movs r0, #11\r
171         mov     r11, r0\r
172         movs r0, #12\r
173         mov r12, r0\r
174         movs r0, #10\r
175 \r
176 reg2_loop\r
177         /* Repeatedly check that each register still contains the value written to\r
178         it when the task started. */\r
179         cmp     r0, #10\r
180         bne     reg2_error_loop\r
181         cmp     r1, #1\r
182         bne     reg2_error_loop\r
183         cmp     r2, #2\r
184         bne     reg2_error_loop\r
185         cmp r3, #3\r
186         bne     reg2_error_loop\r
187         cmp     r4, #4\r
188         bne     reg2_error_loop\r
189         cmp     r5, #5\r
190         bne     reg2_error_loop\r
191         cmp     r6, #6\r
192         bne     reg2_error_loop\r
193         cmp     r7, #7\r
194         bne     reg2_error_loop\r
195         movs r0, #8\r
196         cmp     r8, r0\r
197         bne     reg2_error_loop\r
198         movs r0, #9\r
199         cmp     r9, r0\r
200         bne     reg2_error_loop\r
201         movs r0, #10\r
202         cmp     r10, r0\r
203         bne     reg2_error_loop\r
204         movs r0, #11\r
205         cmp     r11, r0\r
206         bne     reg2_error_loop\r
207         movs r0, #12\r
208         cmp     r12, r0\r
209         bne     reg2_error_loop\r
210 \r
211         /* Everything passed, increment the loop counter. */\r
212         push { r1 }\r
213         ldr     r0, =ulRegTest2LoopCounter\r
214         ldr r1, [r0]\r
215         adds r1, r1, #1\r
216         str r1, [r0]\r
217         pop { r1 }\r
218 \r
219         /* Start again. */\r
220         movs r0, #10\r
221         b reg2_loop\r
222 \r
223 reg2_error_loop\r
224         /* If this line is hit then there was an error in a core register value.\r
225         The loop ensures the loop counter stops incrementing. */\r
226         b reg2_error_loop\r
227         nop\r
228 \r
229         END\r