Should a delay be expected to cause deadlock?
You don't seem to use standard Arduino stuff since you defined your own main() which is normally avoided when programming Arduino.

If you take a look at Arduino provided main() (in hardware/cores/arduino/main.cpp), you'll see how it is defined:

#include &lt;Arduino.h&gt;

int main(void)
{
    init();

#if defined(USBCON)
    USBDevice.attach();
#endif

    setup();

    for (;;) {
        loop();
        if (serialEventRun) serialEventRun();
    }

    return 0;
}


Did you notice the init() function call at the beginning?

Its code is defined in hardware/cores/arduino/wiring.c; what it does is setup all timers used by Arduino functions, in particular a timer that is needed by delay().

In the same wiring.c file, you can also find the definition of delay():

void delay(unsigned long ms)
{
    uint16_t start = (uint16_t)micros();

    while (ms &gt; 0) {
        if (((uint16_t)micros() - start) &gt;= 1000) {
            ms--;
            start += 1000;
        }
    }
}


This will turn into an infinite loop if micros() always return the same value, and it does so if init() has never been called before.

This is what happens with your code.