Hello,
I'm working on an Arduino Due project. Previously, my project has been working fine, however wanted to make it start logging to an SD card. In order to avoid slowing down the critical section of code, I have decided to use the ChibiOS library from here so that I can safely run multiple threads.
It's been working well except that it doesn't run at all when I initially power up the board. If I press the reset button or open the serial port on my laptop, it starts up fine. I think this is a software issue because it never occured before I started using ChibiOS.
I tried adding 100ms delays at various points in the setup() function as well as before the call to init() in int main() (in the main.cpp file). I also tried calling halInit() and chSysInit() before chBegin(). None of these fixed the problem.
My setup function looks like this
void setup()
{
pinMode(13, OUTPUT);
chBegin(mainThread);
//death blink
while(1)
{
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(100);
}
}
If anyone has any suggestions or insight, I'd love to hear it. I'm even thinking about making the board autoreset somehow.