Skip to content

Commit 12a6291

Browse files
authored
Merge pull request #48 from ABOSTM/FREERTOS_10.3.1
Update to Freertos 10.3.1 Add CortexM33 support
2 parents c319f99 + 17f8eb3 commit 12a6291

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+6926
-1107
lines changed

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ CMSIS-RTOSv2.
4949

5050
* MPU: not supported.
5151
* No CMSIS-RTOSv2 support provided. It is provided as example.
52+
* On Cortex-M0 and Cortex-M0+, all IT are disabled between xTaskCreate() and vTaskStartScheduler().
53+
So it is not possible to use IT inbetween, like Serial.print() ...
54+
This is the reason why, in example "frLiyLayland", between xTaskCreate() and vTaskStartScheduler(),
55+
we use direct printf(), which will access directly USART without interrupt
5256

5357
## Files & Configuration
5458

@@ -105,3 +109,14 @@ CMSIS-RTOSv2.
105109
| [P-Nucleo-WB55RG](https://www.st.com/en/evaluation-tools/p-nucleo-wb55.html) | PASSED | PASSED | FAILED | PASSED | PASSED |
106110

107111
\* PASSED with `configUSE_NEWLIB_REENTRANT` set to 0 due to small RAM.
112+
113+
### STM32FreeRTOS v10.3.1
114+
| Board | AnalogRead_DigitalRead | frBlinkPrint | frLiuLayland | frBlink (CMSIS-RTOSv2) | Blinky (CMSIS-RTOSv2) |
115+
| --- | :---: | :---: | :---: | :---: | :---: |
116+
| [Nucleo F091RC (Cortex-M0)](http://www.st.com/en/evaluation-tools/nucleo-f091rc.html) | PASSED | PASSED | PASSED | PASSED | PASSED |
117+
| [Nucleo G071RB (Cortex-M0+)](http://www.st.com/en/evaluation-tools/nucleo-g071rb.html) | PASSED | PASSED | PASSED | PASSED | PASSED |
118+
| [Nucleo F103RB (Cortex-M3)](http://www.st.com/en/evaluation-tools/nucleo-f103rb.html) | PASSED | PASSED | PASSED | PASSED | PASSED |
119+
| [Nucleo L476RG (Cortex-M4)](http://www.st.com/en/evaluation-tools/nucleo-l476rg.html) | PASSED | PASSED | PASSED | PASSED | PASSED |
120+
| [Nucleo H743ZI (Cortex-M7)](https://www.st.com/en/evaluation-tools/nucleo-h743zi.html) | PASSED | PASSED | PASSED | PASSED | PASSED |
121+
| [Nucleo L552ZE-Q (Cortex-M33)](https://www.st.com/en/evaluation-tools/nucleo-l552ze-q.html) | PASSED | PASSED | PASSED | PASSED | PASSED |
122+
| [Nucleo U575ZI-Q (Cortex-M33)](https://www.st.com/en/evaluation-tools/nucleo-u575zi-q.html) | PASSED | PASSED | PASSED | PASSED | PASSED |

examples/frLiuLayland/frLiuLayland.ino

+21-17
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,28 @@ void calibrate() {
6464
uint32_t t = micros();
6565
burnCPU(1000);
6666
t = micros() - t;
67-
cal = (TICK_USEC*1000*cal)/t;
67+
cal = (TICK_USEC * 1000 * cal) / t;
6868
}
6969
//------------------------------------------------------------------------------
7070
// print helpers
71+
// On Cortex-M0 and Cortex-M0+, all IT are disabled between xTaskCreate() and vTaskStartScheduler().
72+
// So it is not possible to use IT inbetween, like Serial.print() ...
73+
// This is the reason why, in example "frLiyLayland", between xTaskCreate() and vTaskStartScheduler(),
74+
// we use direct printf(), which will access directly USART without interrupt
7175
void printTask(task_t* task) {
72-
Serial.print(task->period);
73-
Serial.write(',');
74-
Serial.print(task->cpu);
75-
Serial.write(',');
76-
Serial.println(task->priority);
76+
printf("%u, ", task->period);
77+
printf("%u, ", task->cpu);
78+
printf("%u\r\n", task->priority);
7779
}
7880
void done(const char* msg, task_t* task, TickType_t now) {
7981
vTaskSuspendAll();
8082
Serial.println(msg);
8183
Serial.print("Tick: ");
8284
Serial.println(now);
8385
Serial.print("Task: ");
86+
Serial.flush();
8487
printTask(task);
85-
while(1);
88+
while (1);
8689
}
8790
//------------------------------------------------------------------------------
8891
// start tasks at 1000 ticks
@@ -120,7 +123,7 @@ void setup() {
120123
portBASE_TYPE s; // task create status
121124

122125
Serial.begin(9600);
123-
while(!Serial) {}
126+
while (!Serial) {}
124127
Serial.println("Rate Monotonic Scheduling Examples.");
125128
Serial.println("Cases 1 and 3 should fail");
126129
Serial.println("Cases 2 and 4 should succeed");
@@ -149,28 +152,29 @@ void setup() {
149152

150153
uint32_t t = micros();
151154
burnCPU(1000);
152-
Serial.println(micros() -t);
155+
Serial.println(micros() - t);
153156
Serial.println("Starting tasks - period and CPU in ticks");
154157
Serial.println("Period,CPU,Priority");
158+
Serial.flush();
155159
for (int i = 0; i < n; i++) {
156160
printTask(&tasks[i]);
157-
cpuUse += tasks[i].cpu/(float)tasks[i].period;
161+
cpuUse += tasks[i].cpu / (float)tasks[i].period;
158162

159163
s = xTaskCreate(task, NULL, 200, (void*)&tasks[i], tasks[i].priority, NULL);
160164
if (s != pdPASS) {
161-
Serial.println("task create failed");
162-
while(1);
165+
printf("task create failed\n");
166+
while (1);
163167
}
164168
}
165-
Serial.print("CPU use %: ");
166-
Serial.println(cpuUse*100);
167-
Serial.print("Liu and Layland bound %: ");
168-
Serial.println(LiuLayland[n - 1]);
169169

170+
char CPU[10];
171+
char bound[10];
172+
printf("CPU use %%: %s\r\n", dtostrf(cpuUse*100, 6, 2, CPU));
173+
printf("Liu and Layland bound %%: %s\r\n", dtostrf(LiuLayland[n - 1], 6, 2, bound));
170174
// start tasks
171175
vTaskStartScheduler();
172176
Serial.println("Scheduler failed");
173-
while(1);
177+
while (1);
174178
}
175179
//------------------------------------------------------------------------------
176180
// WARNING idle loop has a very small stack (configMINIMAL_STACK_SIZE)

0 commit comments

Comments
 (0)