Hi,
I'm trying to speed up the arduino zero boot times. I'm using a custom board based on the SAMD21, and using the Arduino IDE for development. I normally upload my code via USB, but I also have an Atmel-ICE programmer.
So far, with a simple blink sketch (no serial or anything in it), I get a boot time of ~1.7s from power on to first light out.
int laserPin = 8;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(laserPin, OUTPUT);
digitalWrite(laserPin, HIGH); // turn the LED on (HIGH is the voltage level)
}
// the loop function runs over and over again forever
void loop() {
for (int aux = 0; aux < 10; aux++){
digitalWrite(laserPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a second
digitalWrite(laserPin, LOW); // turn the LED off by making the voltage LOW
delay(500);
}
for (int aux = 0; aux < 10; aux++){
digitalWrite(laserPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(50); // wait for a second
digitalWrite(laserPin, LOW); // turn the LED off by making the voltage LOW
delay(50);
}
// wait for a second
}
I checked on an oscilloscope, power on the microcontroller is instant, and although there might be some propagation delay (I use a driver to power a laser) it is in the microseconds range, not 1.7s. Again, I checked on an oscilloscope, and the delay is from power on to first activity on the pins of the SAMD
I think I read that removing the bootloader I might achieve faster (instant??) boot. I followed the advice of the great AloyseTech here ([Solved] Programming a SAMD21 with the ATMEL-ICE from the IDE - Arduino Zero - Arduino Forum) to remove the bootloader of my boards, and program them straight from the programmer, and I have the same boot times if I program it from the IDE using the no bootloader option, if I export the binary from the IDE and flash it with Atmel Studio and if I flash the bootloader, and export the binary and I flash it from Atmel studio without erasing the chip and starting in address 0x2000.
So for me, I have the same boot times with and without the bootloader and I was wondering if it's just the time it takes the M0 to boot. Does anyone have any idea about this?