]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M0_STM32F0518_IAR/RegTest.s
Update version number to 9.0.0rc2.
[freertos] / FreeRTOS / Demo / CORTEX_M0_STM32F0518_IAR / RegTest.s
1 /*\r
2     FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.\r
3     All rights reserved\r
4 \r
5     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 \r
7     This file is part of the FreeRTOS distribution.\r
8 \r
9     FreeRTOS is free software; you can redistribute it and/or modify it under\r
10     the terms of the GNU General Public License (version 2) as published by the\r
11     Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
12 \r
13     ***************************************************************************\r
14     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
15     >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
16     >>!   obliged to provide the source code for proprietary components     !<<\r
17     >>!   outside of the FreeRTOS kernel.                                   !<<\r
18     ***************************************************************************\r
19 \r
20     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
21     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
22     FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
23     link: http://www.freertos.org/a00114.html\r
24 \r
25     ***************************************************************************\r
26      *                                                                       *\r
27      *    FreeRTOS provides completely free yet professionally developed,    *\r
28      *    robust, strictly quality controlled, supported, and cross          *\r
29      *    platform software that is more than just the market leader, it     *\r
30      *    is the industry's de facto standard.                               *\r
31      *                                                                       *\r
32      *    Help yourself get started quickly while simultaneously helping     *\r
33      *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
34      *    tutorial book, reference manual, or both:                          *\r
35      *    http://www.FreeRTOS.org/Documentation                              *\r
36      *                                                                       *\r
37     ***************************************************************************\r
38 \r
39     http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
40     the FAQ page "My application does not run, what could be wrong?".  Have you\r
41     defined configASSERT()?\r
42 \r
43     http://www.FreeRTOS.org/support - In return for receiving this top quality\r
44     embedded software for free we request you assist our global community by\r
45     participating in the support forum.\r
46 \r
47     http://www.FreeRTOS.org/training - Investing in training allows your team to\r
48     be as productive as possible as early as possible.  Now you can receive\r
49     FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
50     Ltd, and the world's leading authority on the world's leading RTOS.\r
51 \r
52     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
53     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
54     compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
55 \r
56     http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
57     Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
58 \r
59     http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
60     Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
61     licenses offer ticketed support, indemnification and commercial middleware.\r
62 \r
63     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
64     engineered and independently SIL3 certified version for use in safety and\r
65     mission critical applications that require provable dependability.\r
66 \r
67     1 tab == 4 spaces!\r
68 */\r
69 \r
70         RSEG    CODE:CODE(2)\r
71         thumb\r
72 \r
73         EXTERN ulRegTest1LoopCounter\r
74         EXTERN ulRegTest2LoopCounter\r
75 \r
76         PUBLIC vRegTest1Task\r
77         PUBLIC vRegTest2Task\r
78 \r
79 /*-----------------------------------------------------------*/\r
80 vRegTest1Task\r
81 \r
82         /* Fill the core registers with known values.  This is only done once. */\r
83         movs r1, #101\r
84         movs r2, #102\r
85         movs r3, #103\r
86         movs r4, #104\r
87         movs r5, #105\r
88         movs r6, #106\r
89         movs r7, #107\r
90         movs r0, #108\r
91         mov      r8, r0\r
92         movs r0, #109\r
93         mov  r9, r0\r
94         movs r0, #110\r
95         mov      r10, r0\r
96         movs r0, #111\r
97         mov      r11, r0\r
98         movs r0, #112\r
99         mov  r12, r0\r
100         movs r0, #100\r
101 \r
102 reg1_loop\r
103         /* Repeatedly check that each register still contains the value written to\r
104         it when the task started. */\r
105         cmp     r0, #100\r
106         bne     reg1_error_loop\r
107         cmp     r1, #101\r
108         bne     reg1_error_loop\r
109         cmp     r2, #102\r
110         bne     reg1_error_loop\r
111         cmp r3, #103\r
112         bne     reg1_error_loop\r
113         cmp     r4, #104\r
114         bne     reg1_error_loop\r
115         cmp     r5, #105\r
116         bne     reg1_error_loop\r
117         cmp     r6, #106\r
118         bne     reg1_error_loop\r
119         cmp     r7, #107\r
120         bne     reg1_error_loop\r
121         movs r0, #108\r
122         cmp     r8, r0\r
123         bne     reg1_error_loop\r
124         movs r0, #109\r
125         cmp     r9, r0\r
126         bne     reg1_error_loop\r
127         movs r0, #110\r
128         cmp     r10, r0\r
129         bne     reg1_error_loop\r
130         movs r0, #111\r
131         cmp     r11, r0\r
132         bne     reg1_error_loop\r
133         movs r0, #112\r
134         cmp     r12, r0\r
135         bne     reg1_error_loop\r
136 \r
137         /* Everything passed, increment the loop counter. */\r
138         push { r1 }\r
139         ldr     r0, =ulRegTest1LoopCounter\r
140         ldr r1, [r0]\r
141         adds r1, r1, #1\r
142         str r1, [r0]\r
143         pop { r1 }\r
144 \r
145         /* Start again. */\r
146         movs r0, #100\r
147         b reg1_loop\r
148 \r
149 reg1_error_loop\r
150         /* If this line is hit then there was an error in a core register value.\r
151         The loop ensures the loop counter stops incrementing. */\r
152         b reg1_error_loop\r
153         nop\r
154 \r
155 \r
156 \r
157 vRegTest2Task\r
158 \r
159         /* Fill the core registers with known values.  This is only done once. */\r
160         movs r1, #1\r
161         movs r2, #2\r
162         movs r3, #3\r
163         movs r4, #4\r
164         movs r5, #5\r
165         movs r6, #6\r
166         movs r7, #7\r
167         movs r0, #8\r
168         mov     r8, r0\r
169         movs r0, #9\r
170         mov r9, r0\r
171         movs r0, #10\r
172         mov     r10, r0\r
173         movs r0, #11\r
174         mov     r11, r0\r
175         movs r0, #12\r
176         mov r12, r0\r
177         movs r0, #10\r
178 \r
179 reg2_loop\r
180         /* Repeatedly check that each register still contains the value written to\r
181         it when the task started. */\r
182         cmp     r0, #10\r
183         bne     reg2_error_loop\r
184         cmp     r1, #1\r
185         bne     reg2_error_loop\r
186         cmp     r2, #2\r
187         bne     reg2_error_loop\r
188         cmp r3, #3\r
189         bne     reg2_error_loop\r
190         cmp     r4, #4\r
191         bne     reg2_error_loop\r
192         cmp     r5, #5\r
193         bne     reg2_error_loop\r
194         cmp     r6, #6\r
195         bne     reg2_error_loop\r
196         cmp     r7, #7\r
197         bne     reg2_error_loop\r
198         movs r0, #8\r
199         cmp     r8, r0\r
200         bne     reg2_error_loop\r
201         movs r0, #9\r
202         cmp     r9, r0\r
203         bne     reg2_error_loop\r
204         movs r0, #10\r
205         cmp     r10, r0\r
206         bne     reg2_error_loop\r
207         movs r0, #11\r
208         cmp     r11, r0\r
209         bne     reg2_error_loop\r
210         movs r0, #12\r
211         cmp     r12, r0\r
212         bne     reg2_error_loop\r
213 \r
214         /* Everything passed, increment the loop counter. */\r
215         push { r1 }\r
216         ldr     r0, =ulRegTest2LoopCounter\r
217         ldr r1, [r0]\r
218         adds r1, r1, #1\r
219         str r1, [r0]\r
220         pop { r1 }\r
221 \r
222         /* Start again. */\r
223         movs r0, #10\r
224         b reg2_loop\r
225 \r
226 reg2_error_loop\r
227         /* If this line is hit then there was an error in a core register value.\r
228         The loop ensures the loop counter stops incrementing. */\r
229         b reg2_error_loop\r
230         nop\r
231 \r
232         END\r