A clear and simple flow

philippe_at_sysemb:
Redefining #define is a very very bad practice. :slightly_frowning_face:
I'm surprised the compiler is not insulting me.
All the jtag functions in jtag.c file haven't visibility with the #define in the .ino file, so they will used those presents in the "jtag.h"
The correct #define for the JTAG are from 12 to 15. Even if they are the same, thanks to comment my mistake in the .ino file.

The redefine was there from beginning as duplicate of that in jtag.h,
I've only changed the numbers, and the compilator gives a detailed warning about them.

So I will delete them and will use the samd21g18a.h file to know the I/O pins #define.

Just yesterdays I've completed the first version of my project on MKRVidor4000 using your tutorial
as starting point.
It receives short pulses from small cosmic ray detectors performing counting, coincidence and time stamping
all on FPGA, and configuration/readout commands with a simple user interface on the processor.

Thanks again Philippe.