Replies: 6 comments
-
The first issue you have is that the Also, the idle task has a small stack allocated of 192 bytes. Beyond very simple examples this will not be sufficient, and is certainly not enough for using Any real things should be done in tasks (as per both the simple examples provided), and |
Beta Was this translation helpful? Give feedback.
-
Hi, Thanks for the reply. By loop function, I meant completely removing FreeRTOS and going by the normal approach. I used the same following function for both the options,
I actually wanted to point out that, this worked well when used without RTOS and doesn't work with RTOS. I hope I am clear now. |
Beta Was this translation helpful? Give feedback.
-
Similarly, the first issue have is that you are disabling interrupts for potentially several hundred milliseconds and therefore critically disabling the RTOS scheduler. From the SD card physical layer specification. ACMD41 is part of the initialisation command sequence.
Any code using Arduino (or other) SD card functions has to be aware that SD cards have hundreds of milli-seconds of delay built into their interfaces. You can't use an SD card with the global interrupt disabled and expect that a RTOS can survive. Why are you disabling interrupts in this code? |
Beta Was this translation helpful? Give feedback.
-
Actually, I tried it previously without disabling interrupts, but it was not working. |
Beta Was this translation helpful? Give feedback.
-
Hi, I tried with different SD card library and now it is working as expected. Best Regards, |
Beta Was this translation helpful? Give feedback.
-
Good to hear. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Phillip,
I am trying to get SD card working with the FreeRTOS, but it does not work at all.
I even disabled interrupts but with no luck.
The SD functions always return 0.
When I try this in loop() function by disabling #include <Arduino_FreeRTOS.h>, it works perfect.
Please suggest,
noInterrupts();
myFile = SD.open("171230s.csv", FILE_WRITE);
Serial.println(myFile); //Returns 0
Serial.println(myFile.println("1,2,3,4,5,6")); //Returns 0
myFile.close();
interrupts();
Beta Was this translation helpful? Give feedback.
All reactions