Sure, I do give up as everyone else. :-)
Well, I have it up and running on my Metro M4 now.
I did not have to change anything, only wire it up correctly to the ICSP pins for SPI.
Yesterday I hooked up a Logic Analyzer to the Metro M4 and found that the default SPI speed is 4MHz.
And with "SPI.setClockDivider(SPI_CLOCK_DIV2);" it is 8MHz.
So this probably is setup the same way as the Arduino core for ESP, with dedicated values for the SPI clock
and redefining what "SPI_CLOCK_DIV2" and so on means in order to get the same speed as it would run on an Arduino Uno.
What was really frustrating me yesterday was that the upload from PlatformIO to the board only worked once.
When I uploaded something from the Arduino IDE, like the blink example I could upload with PlatformIO again - once.
That really was a showstopper.
I dug in and manually replaced the version 1.9.0 of bossac.exe in \.platformio\packages\tool-bossac with
version 1.9.1 from here:
https://github.com/shumatech/BOSSA
And now it just works.
I would like to report this somewhere so it gets updated for everyone else but I do not have the slightest idea who is
responsible for the integration of this package into PlatformIO.
Anyways, when I compile with PlatformIO it uses same GCC V7 and in the Arduino IDE I saw 4.8.something.
Adding support for Arduino Zero/M0 was not enough, I am updating "Adafruit SAMD Boards to 1.6.4" now.
...
Oh, it uses GCC9 now: 9-2019q4
And it just works even when compiled with the Arduino IDE.

- 20201106_200836.jpg (54.43 KiB) Viewed 6898 times
I do have the SAMD21 board as well now but it really should not make any difference.
For Arduino this is all using the same code on my side anyways calling SPI.transfer() and digitalWrite().
So as long as the Arduino cores work it should make no difference whatsoever if this is used with an Uno, a Zero, a Metro M4, an ESP, STM32 or whatnot.
But to actually use this D21 board is something different, looks like the "M0" is not really an Arduino, the M0-mini never was one and if the schematic for the board is correct it is anything but not compatible with an M0.
I can only hope that the schematic is wrong but this does not help much. :-)
If there is something to make it crash and burn I have not triggered it yet.
This is the "inner part" of my display function now:
Code: Select all
EVE_color_rgb_burst(WHITE);
EVE_cmd_fgcolor_burst(0x00c0c0c0); /* some grey */
EVE_cmd_dl_burst(TAG(10)); /* assign tag-value '10' to the button that follows */
EVE_cmd_button_burst(20,20,80,30, 28, toggle_state,"Touch!");
EVE_cmd_dl_burst(TAG(0)); /* no touch */
EVE_cmd_dl_burst(DL_COLOR_RGB | BLACK);
EVE_cmd_setfont2_burst(12, MEM_FONT, 32);
EVE_cmd_text_burst(10,190,12,0, "Hello UTF-8: €µäöü");
EVE_cmd_button_burst(20, 120, 80, 30, 28, 0, "Touch!");
EVE_cmd_text_burst(10, 160, 12, 0, "LOOP - The quick brown fox");
EVE_cmd_text_burst(10,80,12,0, "Hello UTF-8: €µäöü"); //€µ°");
EVE_cmd_button_burst(140, 120, 60, 30, 12, 0, "€");
EVE_cmd_button_burst(210, 120, 60, 30, 12, 0, "ü");
EVE_cmd_button_burst(280, 120, 60, 30, 12, 0, "µ");