My CerbBee takes long to start running the program

I know this problem has something to do with the program, but I fixed what I could think of and now I don’t know what else to change. The effect is that after I hit F5 and the assembly deploys, it takes another minute (60~ seconds) to actually start running the program. It wasn’t doing this before. I’ve run a different program on the device and it still took a minute to start up. I tried powering it from a stronger USB port; no change. Even when I just unplug and re-insert the usb cable, the device appears to take a long time to start up. I have the debug led flash at a certain rate to indicate certain activity, including network activity. There was one point where it was so bad, I had to wipe the firmware (including tinybooter) just to get the device back. That problem turned out to be related to setting the time. There was a function I used that I shouldn’t have.

I am running 3 main threads in the program. I’ve put the program main in a loop with a Sleep call of 1000 ms. I don’t recall why; it was just to solve some sort of program I was having a long time ago. Then there is the loop that controls the flashing of the debug led. The loop turns off the led every 100ms. So if somewhere in the program the led is requested to turn on, this thread turns it off again. Then there is the dispatcher. This is a large work thread that receives incoming data, executes them on the robot and responds with the result. All of these loops are continuously running

@ andre.m - it takes 47 seconds to print out the Debug.Print command from the time I press F5. And when I try to run the same program again, it get “Unable to communicate with device USB:Gadgeteer”. This is spooky, gonna test a few things.

So I pulled out everything attached to the board, but after I pulled out the micro SD card, it started working properly. Is there something known that can cause this problem with SD cards?

chkdsk says everything is ok. i formatted it anyways Fat32 default allocation.

@ andre.m - Its Sandsk but there is no model. Just an ordinary 2gb drive. Gonna test it now.

@ Mr. John Smith - The startup was normal even with the disk in. Must have needed a format. I’ll keep and eye on it.