I have been working with an MKR WAN 1300 and have just tried using the SercomSPISlave library to allow the device to act as a SPI slave over Sercom0 (I would have gone for Sercom1 because its pin configurations mostly match the labels on the MKR WAN header but sadly that configuration's Slave Select line is not brought out to the header). This configuration uses the following lines:
MOSI - PA08 ("SDA" on header)
MISO - PA11 ("~3" on header)
CLK - PA09 ("SCL" on header)
~CS - PA10 ("~2" on header)
This was partially working with one of the sample sketches supplied with the library - some of the transmitted data was being received. I then changed to a different sketch that accumulated the incoming data into a buffer, waiting for a '\r' char before emptying the buffer onto the serial port for display via the monitor.
That second sketch was modified from one that had originally been written for Sercom1. Unfortunately on my first upload and run of the sketch I had failed to change the initialisation call from Sercom 1 to Sercom 0, so it didn't work.
Now I can't upload a corrected sketch. After compilation, the IDE (Arduino 1.8) sits for ages and eventually announces that there was an error uploading.
Having Googled other people's similar experiences and having read some of the official documentation re how sketches are uploaded, I tried hitting the reset button on the MKR WAN PCB during the upload process but it appears that as soon as I press the button, the PC loses the COM port and the IDE reports that it can't find a COM port.
Having read the official documentation at https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoISP, I see that SPI is used during the uploading of sketches. I am therefore guessing that my errant sketch mucks this up, and that it always runs when power is applied to the PCB, hence preventing the upload.
Is there a means by which I can apply power to an MKR WAN 1300 without running the sketch that is currently loaded onto the board, while keeping the COM channel available to the host PC?
You can try the following. Upload blink (or any other innocent sketch); when the IDE reports the memory usage, double tap the reset button.
Nice one @sterretje; that's me working again - many thanks. ![]()
Your topic was moved to its current location as it is more suitable.
Could you also take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Thank you