Using XOD on the Odyssey Blue ATSAMD21?

Hi - has anyone had luck using XOD to program the SAMD21 board in the Seeedstudio Odyssey Blue single-board Windows machine? (https://wiki.seeedstudio.com/ODYSSEY-X86J4105/#using-the-arduino-core-atsamd21g18-in-windows) The Arduino compatible module is connected via an internal serial port (COM8).

I’ve added the required board definition at: https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json, and XOD can see the board, sketches can ge downloaded, D13 LED flashes - but then no response.

All works OK using the Arduino IDE, so I’m a little puzzled. Any advice would be much appreciated. (The Odyssey Blue package provides seamless support for graphical Windows10-based development environments like XOD and 4D Workshop, and would provide a compact and accessible way of combining these with the Arduino platform - with integrated support for 4K monitor, etc.)

J.

A bit of extra information about the problem uploading patches to the SAMD21 board embedded in the Odyssey Blue SBC… (i) the Arduino IDE works for uploading sketches to the SAMD21, or an Arduino UNO board attached to a USB port. (ii) XOD will happily upload a patch to the externally attached UNO. (iii) The same XOD patch appears to be uploaded successfully to the internal SAMD21, but the code (simple LED flashing) doesn’t run.
Here’s the report from the XOD uploader:

Uploading compiled code to the board…
Performing 1200-bps touch reset on serial port COM8

Waiting for upload port…

“C:\Users\ODYSSEY\xod_packages_\packages\Seeeduino\tools\bossac\1.7.0-arduino3/bossac.exe” -i -d --port=COM7 -U true -i -e -w -v “C:\Users\ODYSSEY\AppData\Local\Temp\xod_temp_sketchbookPCpO5O\xod_1608409132050_sketch\build\Seeeduino.samd.zero/xod_1608409132050_sketch.ino.bin” -R

Set binary mode
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
version()=v2.0 [Arduino:XYZ] Oct 12 2018 18:20:29
chipId=0x10010005
Connected at 921600 baud
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Atmel SMART device 0x10010005 found
write(addr=0x20004000,size=0x34)
writeWord(addr=0x20004030,value=0x10)
writeWord(addr=0x20004020,value=0x20008000)
Device : ATSAMD21G18A
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Chip ID : 10010005
version()=v2.0 [Arduino:XYZ] Oct 12 2018 18:20:29
Version : v2.0 [Arduino:XYZ] Oct 12 2018 18:20:29
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
Planes : 1
Lock Regions : 16
Locked : readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
none
readWord(addr=0x41004018)=0
Security : false
Boot Flash : true
readWord(addr=0x40000834)=0x7000a
BOD : true
readWord(addr=0x40000834)=0x7000a
BOR : true
Arduino : FAST_CHIP_ERASE
Arduino : FAST_MULTI_PAGE_WRITE
Arduino : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
chipErase(addr=0x2000)
done in 0.854 seconds

Write 38068 bytes to flash (595 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x2000, size=0x1000)

[=== ] 10% (64/595 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x3000, size=0x1000)

[====== ] 21% (128/595 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x4000, size=0x1000)

[========= ] 32% (192/595 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x5000, size=0x1000)

[============ ] 43% (256/595 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x6000, size=0x1000)

[================ ] 53% (320/595 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x7000, size=0x1000)

[=================== ] 64% (384/595 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x8000, size=0x1000)

[====================== ] 75% (448/595 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x9000, size=0x1000)

[========================= ] 86% (512/595 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0xa000, size=0x1000)

[============================= ] 96% (576/595 pages)
write(addr=0x20005000,size=0x4c0)
writeBuffer(scr_addr=0x20005000, dst_addr=0xb000, size=0x4c0)

[==============================] 100% (595/595 pages)

done in 0.327 seconds

Verify 38068 bytes of flash with checksum.
checksumBuffer(start_addr=0x2000, size=0x1000) = 9f00
checksumBuffer(start_addr=0x3000, size=0x1000) = 9f6a
checksumBuffer(start_addr=0x4000, size=0x1000) = fe7c
checksumBuffer(start_addr=0x5000, size=0x1000) = 1f34
checksumBuffer(start_addr=0x6000, size=0x1000) = e2ba
checksumBuffer(start_addr=0x7000, size=0x1000) = 9655
checksumBuffer(start_addr=0x8000, size=0x1000) = ae1a
checksumBuffer(start_addr=0x9000, size=0x1000) = ced7
checksumBuffer(start_addr=0xa000, size=0x1000) = 3a7c
checksumBuffer(start_addr=0xb000, size=0x4b4) = b97a
Verify successful
done in 0.029 seconds
CPU reset.
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
writeWord(addr=0xe000ed0c,value=0x5fa0004)

=== Done ===

At least one of the problems have been identified, I think. In order to test things out, I connected several boards to the Odyssey Blue device, and tried building and uploading patches from the XOD environment installed on the device. For example, Seeedstudio have an Arduino UNO compatible (Seeeduino 4.2), which shares the same form factor as a ATSAMD21 version (Seeeduino Cortex-M0+). The UNO compatible board behaves as expected, while the ATSAMD21 board kicks out an error as XOD cannot find the board on the expected COM port. An attempt to upload again - shows that the COM port has changed in the upload dialog (from COM10 to COM12 in this case).

A look at the ports in the Windows10 device manager shows dual entries for COM10 and COM12. The simple, if tedious, workaround is to upload twice in succession. Any programmes work as expected, second time around, when the COM port is correctly identified. There appears to be a similar situation for the ATSAMD21 chip on the Odyssey Blue motherboard.

So, (i) the Seeeduino Zero board description does seem to work for a connected ATSAMD21-based Seeduino Cortex M0+ board - I’ll do more experiments with the internal chip. (ii) There seems to be an issue with correct identification or assignment of COM ports. There is a reference to problems with port detection for the Arduino Zero (another ATSAMD21) at https://www.avdweb.nl/arduino/samd21/virus.

On the plus side, the Seeduino Cortex M0+ board has two extra hardware serial ports, which each work perfectly with the relevant UART nodes - I’ve been using them for 600,000 baud rate communication with 4D Systems touchscreens.

Just to confirm, I see the same requirement for double-uploading and problematic double-COM port addresses when sending a patch to the internal ATSAMD21 chip in the Odyssey Blue (with no external board connected). Using the Seeduino Zero board description, the internal ATSAMD21 shows up as connected to COM8 - but the upload fails. On 2nd attempt - the board appears in the dialog as connected to Com7 - and then the upload succeeds. The whole process needs to be reiterated for each upload.