Possibly Bricked MKR VIDOR 4000

I was playing around with the MKR VIDOR 4000 I bought. I wanted to make use of the time / control registers for a project. I tried to see if I could simply get the timer to count up. I read through the SAMD21 datasheet to see what I needed to do. I noticed that some header files in AppData/Local/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd21 gave me access to the registers. I'm not sure if this is right, but I was under the impression that the necessary code to get the timer to start counting went like this.

  Tcc *tcc0= TCC0; 


void setup() {
  Serial.begin(9600);

  tcc0->CTRLBCLR.bit.DIR = 1; 
  tcc0->CTRLA.bit.ENABLE = 1;
  tcc0->EVCTRL.bit.EVACT0 = 3; 
  
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.print(tcc0->COUNT.reg);
  delay(1000);
}

Upon uploading this code the Vidor disconnected and could no longer be recognized by my PC. Since I my computer won't recognize it, I can't change the code I uploaded.

But I am a bit confused. I didn't think changing a few register values should eliminate the arduino's ability to communicate. Can anyone see what I did wrong, or have any suggestions for how I might fix it?

To "unbrick", try this:

  • Press the reset button on your board quickly twice. You should now see the LED on the board pulsing, which means the bootloader is running. The double press causes the bootloader to run indefinitely (until the board is reset, powered off, or an upload is done), which means you don't need to get the timing of the reset just right.
  • Select the port of your board from the Tools > Port menu. The port will be different when the bootloader is running so don't assume you already have the correct port selected.
  • Start an upload in the Arduino IDE.

The upload should now finish successfully. After this, you should be able to go back to doing normal uploads without needing to press the reset button.

As for why that code might brick your board, I don't know. Maybe someone else here will be able to provide an explanation.

Recently, my Vidor 4000 is also not recognized by my PC when I plug it.
Sometimes double-clicking the reset works, but not always.

In my case, long reset (push the reset button more than 2 seconds) is always worked.

After the long reset, the Vidor is recognized as the bootloader mode (red LED blinks slowly like breathing).
By pushing the reset again shortly, the Vidor becomes normal mode (red LED flashes).

tksm372:
In my case, long reset (push the reset button more than 2 seconds) is always worked.

After the long reset, the Vidor is recognized as the bootloader mode (red LED blinks slowly like breathing).
By pushing the reset again shortly, the Vidor becomes normal mode (red LED flashes).

I'm interested to learn more about this. I don't have much experience with the MKR Vidor 4000 and I hadn't heard of the long reset feature before. I tried the long reset on my MKR Vidor 4000 with both the stock bootloader and the most recent bootloader. With neither bootloader does a long reset result in the pulsing LED. The "double tap" reset does result in the pulsing LED of the bootloader mode. Is there something special you need to do to enable the long reset feature?

pert:
With neither bootloader does a long reset result in the pulsing LED. The "double tap" reset does result in the pulsing LED of the bootloader mode. Is there something special you need to do to enable the long reset feature?

Yes, only when my Vidoe 4000 is not recognized, the long reset works for me.

Once the Vidor is recognized, the long reset causes the same result as a normal reset as you mentioned.

In another case, when the Vidor was not recognized and waited for about 10 or 20 seconds, several times it was recognized automatically, but this situation cannot easily be reproduced.

However, I cannot deny the possibility of being dependent on my usages such as a sketch flushed in the SAMD, FPGA's configuration or NINA's firmware I wrote.
I will investigate whether the same situation is reproduced by restoring everything to the initial state.

Thanks for the information tksm372! That makes sense. I was only trying the long press reset with a normally functioning MKR Vidor 4000.

I restored NINA's firmware by "WiFi101 / WiFiNINA Firmware Updater", then my Vidor 4000 becomes recognized every time I plugged.
Additionally, the red LED becomes keeping off.

Then I re-programmed modified USBBlaster sketch which is flashed to the SAMD before, the Vidor is still recognized every time. The red LED becomes blinking due to the USBBlaster sketch.

Therefore, the cause of why my Vidor was not recognized seems my NINA's firmware.

Sorry for confusing you.

Rioghasarig:
I was playing around with the MKR VIDOR 4000 I bought. I wanted to make use of the time / control registers for a project. I tried to see if I could simply get the timer to count up. I read through the SAMD21 datasheet to see what I needed to do. I noticed that some header files in AppData/Local/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd21 gave me access to the registers. I'm not sure if this is right, but I was under the impression that the necessary code to get the timer to start counting went like this.

Rioghasarig, any news about your attempts with timer? You seems the only Vidor4000 user
interested in timers.
Thanks.