I was trying to write simple porting for the Arduino Vidor 4000. It has a Samd21 processor and Intel FPGA. Leaving the FPGA part aside at this moment, I just created a new board and created the required files for a new board. I followed the other MKR boards and pasted the makefiles, include/files.h etc. for samd21 based boards.
Then I created a simple application to turn on the GPIO pin on the board. It has failed.!! The example build successfully and flashed but the LED didn’t turn on
For MKR board there is most of the board-specific code inside a boards/comman/arduino_mkr folder. The board itself has only makefile and board.h files.
I am not sure what has gone wrong. BTW the board is working when I flash with make flash.
Did you create your application for turn on the LED ? Or did you use RIOT tests application, like tests/leds for this purpose ?
If your plan is only to turn on the board LED, you need to change your LED0_* macros.
Looking at the schematic of this board, the LED will be ON if GPIO is LOW.
Thus, LED0_ON should call OUTCLR register, not OUTSET.
I wrote a line of code for turning LED On, I have connected an LED on the pin PA11 of the board.
I have tried different configurations too. Let me check again by changing some Macros, but my thought us that it should work with GPIO_PIN set inside a code.
I’m wondering if you flash the board properly. Are you using JLINK as flasher ? Please update your Makefile.include for your board, this board doesn’t feature a SAMW25 but a SAMD21.
Could you also compile and flash tests/periph_gpio on your board, connect to RIOT shell and play with your GPIOs ? You can type “help” in the RIOT shell to get the list of available commands. Then, you could try to switch on/off all GPIOs you want for testing purpose.
Could you also share the command you are using for compile and flash your board with their outputs ?
There are several things to be aware of before flashing this kind of board with JLink:
you need an on-board jtag connector. If it’s not available you have to solder it (AFAICT, only the mkr1000 has the jtag connector available by default)
more important: flashing with JLink doesn’t take into account the ROM space used by the Arduino bootloader. As a result, it will be overwritten and bossa cannot be used afterwards unless an Arduino bootloader is reflashed, using JLink.