digitalRead Bug (ARM MCUs)

I've used the Blink code here with modification to do the digitalRead();

void setup() {
  pinMode(13, OUTPUT);
  Serial.begin(115200);
}

void loop() {
  digitalWrite(13, HIGH);
  Serial.println(digitalRead(13));
  delay(1000); 
  digitalWrite(13, LOW); 
  Serial.println(digitalRead(13));
  delay(1000); 
}

I would expect to see 0 and 1 printed in the Serial Monitor window, but I see only 0 all the time. This same code works on non-Arduino boards based on the ARM MCUs such the as Texas as well as other Ardunio boards (UNO for example) that are not using ARM MCUs. This also works as expected on the ESP 8266 with the Arduino bootloader.

See this topic and thread for more details Feather M0+ disgitalRead() doesn't work as expected

The bug in digitalRead() on the Zero has been discussed here: http://forum.arduino.cc/index.php?topic=367517.0.

This has been flagged up as an issue on Github under the heading: "digitalRead() broken on pins in output mode", hopefully it'll be resolved soon.

Thanks for the heads up @MatinL.