SRD Standelone programmation box: FM25V20MemTest.c File Reference

| SRD Standelone programmation box 2.0 (16/11/15 10:00:00) Documentation of the SRD standelone programmation box

- Main Page
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Enumerations Enumerator Macros Pages
Functions
FM25V20MemTest.c File Reference

Source file for FRAM Memory test. More...

`#include "FM25V20MemTest.h"`
Include dependency graph for FM25V20MemTest.c:

Go to the source code of this file.

## Functions

void | FM25V20MemTest_Main (void)
unsigned long | FM25V20MemTest_Set (void)
unsigned long | FM25V20MemTest_Clear (void)
unsigned long | FM25V20MemTest_HighFreqUp (void)
unsigned long | FM25V20MemTest_HighFreqDown (void)
unsigned long | FM25V20MemTest_PulseP (unsigned char pulsePosition)
unsigned long | FM25V20MemTest_PulseN (unsigned char pulsePosition)

## Detailed Description

Source file for FRAM Memory test.

Author
  Thibaut LALUQUE 3D-Ouest

Date
  05/11/2014

Version
  1.0

All Right Reserved.

Definition in file FM25V20MemTest.c.

## Function Documentation

unsigned long FM25V20MemTest_Clear | ( | void |  | ) |

Definition at line 157 of file FM25V20MemTest.c.

References FM25V20_MEMTEST_SUBGROUP_LENGTH, FM25V20_NBR_BYTE, FM25V20ReadData(), FM25V20WriteData(), and WatchdogKick().

Referenced by FM25V20MemTest_Main().

157 {
158
159 unsigned long addr = 0;
160 unsigned char data[FM25V20_MEMTEST_SUBGROUP_LENGTH] = {[0 ... FM25V20_MEMTEST_SUBGROUP_LENGTH-1] = 0x00};
161 unsigned char result[FM25V20_MEMTEST_SUBGROUP_LENGTH] = {0};
162 unsigned long counterError = 0;
163 unsigned short i;
164
165 while(addr < FM25V20_NBR_BYTE) {
166 WatchdogKick();
167 FM25V20WriteData(addr,data,FM25V20_MEMTEST_SUBGROUP_LENGTH);
168 addr += FM25V20_MEMTEST_SUBGROUP_LENGTH;
169 }
170
171 addr = 0;
172
173 while(addr < FM25V20_NBR_BYTE) {
174 WatchdogKick();
175 FM25V20ReadData(addr,result,FM25V20_MEMTEST_SUBGROUP_LENGTH);
176
177 for(i=0 ; i<FM25V20_MEMTEST_SUBGROUP_LENGTH ; i++) {
178 if(result[i] != data[i]) {
179 counterError++;
180 }
181 }
182
183 addr += FM25V20_MEMTEST_SUBGROUP_LENGTH;
184 }
185
186 return counterError;
187
188 }
FM25V20WriteData
signed char FM25V20WriteData(unsigned long addr, unsigned char data[], unsigned long dataLength)
Write data to the memory.
Definition: FM25V20.c:199
FM25V20_NBR_BYTE
#define FM25V20_NBR_BYTE
Define the memory number of bits and bytes available in this memory device.
Definition: FM25V20.h:67
WatchdogKick
void WatchdogKick(void)
Kick the watchdog to avoid reset after the watchdog have started.
Definition: watchdog.c:86
FM25V20_MEMTEST_SUBGROUP_LENGTH
#define FM25V20_MEMTEST_SUBGROUP_LENGTH
Definition: FM25V20MemTest.h:29
FM25V20ReadData
signed char FM25V20ReadData(unsigned long addr, unsigned char data[], unsigned long dataLength)
Read data from the memory.
Definition: FM25V20.c:224

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned long FM25V20MemTest_HighFreqDown | ( | void |  | ) |

Definition at line 221 of file FM25V20MemTest.c.

References FM25V20_MEMTEST_SUBGROUP_LENGTH, FM25V20_NBR_BYTE, FM25V20ReadData(), FM25V20WriteData(), and WatchdogKick().

Referenced by FM25V20MemTest_Main().

221 {
222 unsigned long addr = 0;
223 unsigned char data[FM25V20_MEMTEST_SUBGROUP_LENGTH] = {[0 ... FM25V20_MEMTEST_SUBGROUP_LENGTH-1] = 0x55};
224 unsigned char result[FM25V20_MEMTEST_SUBGROUP_LENGTH] = {0};
225 unsigned long counterError = 0;
226 unsigned short i;
227
228 while(addr < FM25V20_NBR_BYTE) {
229 WatchdogKick();
230 FM25V20WriteData(addr,data,FM25V20_MEMTEST_SUBGROUP_LENGTH);
231 addr += FM25V20_MEMTEST_SUBGROUP_LENGTH;
232 }
233
234 addr = 0;
235
236 while(addr < FM25V20_NBR_BYTE) {
237 WatchdogKick();
238 FM25V20ReadData(addr,result,FM25V20_MEMTEST_SUBGROUP_LENGTH);
239
240 for(i=0 ; i<FM25V20_MEMTEST_SUBGROUP_LENGTH ; i++) {
241 if(result[i] != data[i]) {
242 counterError++;
243 }
244 }
245
246 addr += FM25V20_MEMTEST_SUBGROUP_LENGTH;
247 }
248
249 return counterError;
250 }
FM25V20WriteData
signed char FM25V20WriteData(unsigned long addr, unsigned char data[], unsigned long dataLength)
Write data to the memory.
Definition: FM25V20.c:199
FM25V20_NBR_BYTE
#define FM25V20_NBR_BYTE
Define the memory number of bits and bytes available in this memory device.
Definition: FM25V20.h:67
WatchdogKick
void WatchdogKick(void)
Kick the watchdog to avoid reset after the watchdog have started.
Definition: watchdog.c:86
FM25V20_MEMTEST_SUBGROUP_LENGTH
#define FM25V20_MEMTEST_SUBGROUP_LENGTH
Definition: FM25V20MemTest.h:29
FM25V20ReadData
signed char FM25V20ReadData(unsigned long addr, unsigned char data[], unsigned long dataLength)
Read data from the memory.
Definition: FM25V20.c:224

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned long FM25V20MemTest_HighFreqUp | ( | void |  | ) |

Definition at line 190 of file FM25V20MemTest.c.

References FM25V20_MEMTEST_SUBGROUP_LENGTH, FM25V20_NBR_BYTE, FM25V20ReadData(), FM25V20WriteData(), and WatchdogKick().

Referenced by FM25V20MemTest_Main().

190 {
191 unsigned long addr = 0;
192 unsigned char data[FM25V20_MEMTEST_SUBGROUP_LENGTH] = {[0 ... FM25V20_MEMTEST_SUBGROUP_LENGTH-1] = 0xAA};
193 unsigned char result[FM25V20_MEMTEST_SUBGROUP_LENGTH] = {0};
194 unsigned long counterError = 0;
195 unsigned short i;
196
197 while(addr < FM25V20_NBR_BYTE) {
198 WatchdogKick();
199 FM25V20WriteData(addr,data,FM25V20_MEMTEST_SUBGROUP_LENGTH);
200 addr += FM25V20_MEMTEST_SUBGROUP_LENGTH;
201 }
202
203 addr = 0;
204
205 while(addr < FM25V20_NBR_BYTE) {
206 WatchdogKick();
207 FM25V20ReadData(addr,result,FM25V20_MEMTEST_SUBGROUP_LENGTH);
208
209 for(i=0 ; i<FM25V20_MEMTEST_SUBGROUP_LENGTH ; i++) {
210 if(result[i] != data[i]) {
211 counterError++;
212 }
213 }
214
215 addr += FM25V20_MEMTEST_SUBGROUP_LENGTH;
216 }
217
218 return counterError;
219 }
FM25V20WriteData
signed char FM25V20WriteData(unsigned long addr, unsigned char data[], unsigned long dataLength)
Write data to the memory.
Definition: FM25V20.c:199
FM25V20_NBR_BYTE
#define FM25V20_NBR_BYTE
Define the memory number of bits and bytes available in this memory device.
Definition: FM25V20.h:67
WatchdogKick
void WatchdogKick(void)
Kick the watchdog to avoid reset after the watchdog have started.
Definition: watchdog.c:86
FM25V20_MEMTEST_SUBGROUP_LENGTH
#define FM25V20_MEMTEST_SUBGROUP_LENGTH
Definition: FM25V20MemTest.h:29
FM25V20ReadData
signed char FM25V20ReadData(unsigned long addr, unsigned char data[], unsigned long dataLength)
Read data from the memory.
Definition: FM25V20.c:224

Here is the call graph for this function:

Here is the caller graph for this function:

void FM25V20MemTest_Main | ( | void |  | ) |

Definition at line 78 of file FM25V20MemTest.c.

References FM25V20MemTest_Clear(), FM25V20MemTest_HighFreqDown(), FM25V20MemTest_HighFreqUp(), FM25V20MemTest_PulseN(), FM25V20MemTest_PulseP(), and FM25V20MemTest_Set().

78 {
79 unsigned long errorSet;
80 unsigned long errorClear;
81 unsigned long errorHFU;
82 unsigned long errorHFD;
83 unsigned long errorPulseP0;
84 unsigned long errorPulseP1;
85 unsigned long errorPulseP2;
86 unsigned long errorPulseP3;
87 unsigned long errorPulseP4;
88 unsigned long errorPulseP5;
89 unsigned long errorPulseP6;
90 unsigned long errorPulseP7;
91 unsigned long errorPulseN0;
92 unsigned long errorPulseN1;
93 unsigned long errorPulseN2;
94 unsigned long errorPulseN3;
95 unsigned long errorPulseN4;
96 unsigned long errorPulseN5;
97 unsigned long errorPulseN6;
98 unsigned long errorPulseN7;
99
100 errorSet = FM25V20MemTest_Set();
101 errorClear = FM25V20MemTest_Clear();
102 errorHFU = FM25V20MemTest_HighFreqUp();
103 errorHFD = FM25V20MemTest_HighFreqDown();
104 errorPulseP0 = FM25V20MemTest_PulseP(0);
105 errorPulseP1 = FM25V20MemTest_PulseP(1);
106 errorPulseP2 = FM25V20MemTest_PulseP(2);
107 errorPulseP3 = FM25V20MemTest_PulseP(3);
108 errorPulseP4 = FM25V20MemTest_PulseP(4);
109 errorPulseP5 = FM25V20MemTest_PulseP(5);
110 errorPulseP6 = FM25V20MemTest_PulseP(6);
111 errorPulseP7 = FM25V20MemTest_PulseP(7);
112 errorPulseN0 = FM25V20MemTest_PulseN(0);
113 errorPulseN1 = FM25V20MemTest_PulseN(1);
114 errorPulseN2 = FM25V20MemTest_PulseN(2);
115 errorPulseN3 = FM25V20MemTest_PulseN(3);
116 errorPulseN4 = FM25V20MemTest_PulseN(4);
117 errorPulseN5 = FM25V20MemTest_PulseN(5);
118 errorPulseN6 = FM25V20MemTest_PulseN(6);
119 errorPulseN7 = FM25V20MemTest_PulseN(7);
120 }
FM25V20MemTest_HighFreqUp
unsigned long FM25V20MemTest_HighFreqUp(void)
Definition: FM25V20MemTest.c:190
FM25V20MemTest_PulseP
unsigned long FM25V20MemTest_PulseP(unsigned char pulsePosition)
Definition: FM25V20MemTest.c:252
FM25V20MemTest_HighFreqDown
unsigned long FM25V20MemTest_HighFreqDown(void)
Definition: FM25V20MemTest.c:221
FM25V20MemTest_PulseN
unsigned long FM25V20MemTest_PulseN(unsigned char pulsePosition)
Definition: FM25V20MemTest.c:283
FM25V20MemTest_Set
unsigned long FM25V20MemTest_Set(void)
Definition: FM25V20MemTest.c:122
FM25V20MemTest_Clear
unsigned long FM25V20MemTest_Clear(void)
Definition: FM25V20MemTest.c:157

Here is the call graph for this function:

unsigned long FM25V20MemTest_PulseN | ( | unsigned char | pulsePosition | ) |

Definition at line 283 of file FM25V20MemTest.c.

References FM25V20_MEMTEST_SUBGROUP_LENGTH, FM25V20_NBR_BYTE, FM25V20ReadData(), FM25V20WriteData(), and WatchdogKick().

Referenced by FM25V20MemTest_Main().

283 {
284 unsigned long addr = 0;
285 unsigned char data[FM25V20_MEMTEST_SUBGROUP_LENGTH] = {[0 ... FM25V20_MEMTEST_SUBGROUP_LENGTH-1] = ~(1<<pulsePosition)};
286 unsigned char result[FM25V20_MEMTEST_SUBGROUP_LENGTH] = {0};
287 unsigned long counterError = 0;
288 unsigned short i;
289
290 while(addr < FM25V20_NBR_BYTE) {
291 WatchdogKick();
292 FM25V20WriteData(addr,data,FM25V20_MEMTEST_SUBGROUP_LENGTH);
293 addr += FM25V20_MEMTEST_SUBGROUP_LENGTH;
294 }
295
296 addr = 0;
297
298 while(addr < FM25V20_NBR_BYTE) {
299 WatchdogKick();
300 FM25V20ReadData(addr,result,FM25V20_MEMTEST_SUBGROUP_LENGTH);
301
302 for(i=0 ; i<FM25V20_MEMTEST_SUBGROUP_LENGTH ; i++) {
303 if(result[i] != data[i]) {
304 counterError++;
305 }
306 }
307
308 addr += FM25V20_MEMTEST_SUBGROUP_LENGTH;
309 }
310
311 return counterError;
312 }
FM25V20WriteData
signed char FM25V20WriteData(unsigned long addr, unsigned char data[], unsigned long dataLength)
Write data to the memory.
Definition: FM25V20.c:199
FM25V20_NBR_BYTE
#define FM25V20_NBR_BYTE
Define the memory number of bits and bytes available in this memory device.
Definition: FM25V20.h:67
WatchdogKick
void WatchdogKick(void)
Kick the watchdog to avoid reset after the watchdog have started.
Definition: watchdog.c:86
FM25V20_MEMTEST_SUBGROUP_LENGTH
#define FM25V20_MEMTEST_SUBGROUP_LENGTH
Definition: FM25V20MemTest.h:29
FM25V20ReadData
signed char FM25V20ReadData(unsigned long addr, unsigned char data[], unsigned long dataLength)
Read data from the memory.
Definition: FM25V20.c:224

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned long FM25V20MemTest_PulseP | ( | unsigned char | pulsePosition | ) |

Definition at line 252 of file FM25V20MemTest.c.

References FM25V20_MEMTEST_SUBGROUP_LENGTH, FM25V20_NBR_BYTE, FM25V20ReadData(), FM25V20WriteData(), and WatchdogKick().

Referenced by FM25V20MemTest_Main().

252 {
253 unsigned long addr = 0;
254 unsigned char data[FM25V20_MEMTEST_SUBGROUP_LENGTH] = {[0 ... FM25V20_MEMTEST_SUBGROUP_LENGTH-1] = 1<<pulsePosition};
255 unsigned char result[FM25V20_MEMTEST_SUBGROUP_LENGTH] = {0};
256 unsigned long counterError = 0;
257 unsigned short i;
258
259 while(addr < FM25V20_NBR_BYTE) {
260 WatchdogKick();
261 FM25V20WriteData(addr,data,FM25V20_MEMTEST_SUBGROUP_LENGTH);
262 addr += FM25V20_MEMTEST_SUBGROUP_LENGTH;
263 }
264
265 addr = 0;
266
267 while(addr < FM25V20_NBR_BYTE) {
268 WatchdogKick();
269 FM25V20ReadData(addr,result,FM25V20_MEMTEST_SUBGROUP_LENGTH);
270
271 for(i=0 ; i<FM25V20_MEMTEST_SUBGROUP_LENGTH ; i++) {
272 if(result[i] != data[i]) {
273 counterError++;
274 }
275 }
276
277 addr += FM25V20_MEMTEST_SUBGROUP_LENGTH;
278 }
279
280 return counterError;
281 }
FM25V20WriteData
signed char FM25V20WriteData(unsigned long addr, unsigned char data[], unsigned long dataLength)
Write data to the memory.
Definition: FM25V20.c:199
FM25V20_NBR_BYTE
#define FM25V20_NBR_BYTE
Define the memory number of bits and bytes available in this memory device.
Definition: FM25V20.h:67
WatchdogKick
void WatchdogKick(void)
Kick the watchdog to avoid reset after the watchdog have started.
Definition: watchdog.c:86
FM25V20_MEMTEST_SUBGROUP_LENGTH
#define FM25V20_MEMTEST_SUBGROUP_LENGTH
Definition: FM25V20MemTest.h:29
FM25V20ReadData
signed char FM25V20ReadData(unsigned long addr, unsigned char data[], unsigned long dataLength)
Read data from the memory.
Definition: FM25V20.c:224

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned long FM25V20MemTest_Set | ( | void |  | ) |

Definition at line 122 of file FM25V20MemTest.c.

References FM25V20_MEMTEST_SUBGROUP_LENGTH, FM25V20_NBR_BYTE, FM25V20ReadData(), FM25V20WriteData(), and WatchdogKick().

Referenced by FM25V20MemTest_Main().

122 {
123
124 unsigned long addr = 0;
125 unsigned char data[FM25V20_MEMTEST_SUBGROUP_LENGTH] = {[0 ... FM25V20_MEMTEST_SUBGROUP_LENGTH-1] = 0xFF};
126 unsigned char result[FM25V20_MEMTEST_SUBGROUP_LENGTH] = {0};
127 unsigned long counterError = 0;
128 unsigned short i;
129
130 while(addr < FM25V20_NBR_BYTE) {
131 WatchdogKick();
132 FM25V20WriteData(addr,data,FM25V20_MEMTEST_SUBGROUP_LENGTH);
133 addr += FM25V20_MEMTEST_SUBGROUP_LENGTH;
134 }
135
136 addr = 0;
137
138 while(addr < FM25V20_NBR_BYTE) {
139 WatchdogKick();
140 FM25V20ReadData(addr,result,FM25V20_MEMTEST_SUBGROUP_LENGTH);
141
142 for(i=0 ; i<FM25V20_MEMTEST_SUBGROUP_LENGTH ; i++) {
143 if(result[i] != data[i]) {
144 counterError++;
145 }
146 }
147
148 addr += FM25V20_MEMTEST_SUBGROUP_LENGTH;
149 }
150
151 return counterError;
152
153 }
FM25V20WriteData
signed char FM25V20WriteData(unsigned long addr, unsigned char data[], unsigned long dataLength)
Write data to the memory.
Definition: FM25V20.c:199
FM25V20_NBR_BYTE
#define FM25V20_NBR_BYTE
Define the memory number of bits and bytes available in this memory device.
Definition: FM25V20.h:67
WatchdogKick
void WatchdogKick(void)
Kick the watchdog to avoid reset after the watchdog have started.
Definition: watchdog.c:86
FM25V20_MEMTEST_SUBGROUP_LENGTH
#define FM25V20_MEMTEST_SUBGROUP_LENGTH
Definition: FM25V20MemTest.h:29
FM25V20ReadData
signed char FM25V20ReadData(unsigned long addr, unsigned char data[], unsigned long dataLength)
Read data from the memory.
Definition: FM25V20.c:224

Here is the call graph for this function:

Here is the caller graph for this function: