Do I need to initialize the pins in fast mode upfront?
IOMUXC_GPR_GPR27 = 0xFFFFFFFF; // Initialize pins
GPIO9_GDIR |= (1<<4); // pinMode(2,OUTPUT);
GPIO9_DR_SET &= ~0xF7; // digitalWrite(2,LOW);
GPIO6_GDIR |= (1<<2); //...
Thanks for the input guys. Pauls hint " I can tell you programs which crash early" pushed me into the right direction.
I was able to cut down the problem to this code:
extern "C" void startup_early_hook(void) {
pinMode(2,OUTPUT)...