Seeeduino XIAO - another mini board for uLisp


#1

Like the Serpente board, the XIAO board from Seeedstudio is based on the Atmel SAMD21 microcontroller. The 32bit ARM® Cortex®-M0+ MCU runs at 48MHz and has 256KB Flash and 32KB SRAM. The size of only 20x17.5mm is probably the minimum that is currently possible.


The ulisp-arm.ino image (v3.1) occupies (29%) of the program memory space (78436 of maximum 262144Bytes).
Unfortunately the XIAO board does not have additional flash memory like the Serpente board does. But the board costs only one third.
XIAO_03 XIAO_04
uLisp in the ARM version 3.1 was easy to install and runs out-of-the-box. It compiled with Arduino 1.8.10 and the corresponding core for the board without problems. Only the bootloader sometimes needed a reset. To do this, the two pins on the board must be short-circuited twice in a short sequence. Then the orange LED lights up permanently and the firmware can be loaded.

Regarding the performance I can report the following tests:

The Fibonacci sequence (fib 23) takes 9 seconds:

3034> (for-millis () (print (fib 23)))

28657 
9259  

Calculating the CRC-32 takes 97 milliseconds:

2885> (for-millis () (print (crc32 "The quick brown fox jumps over the lazy dog")))

1095738169
97

The Takeuchi function (tak 18 12 6) takes 14 seconds:

2988> (for-millis () (print (tak 18 12 6)))

7    
14213

When using the ARM assembler to implement the Takeuchi function, the calculation time is reduced to 27 milliseconds:

391> (for-millis () (print (tak 18 12 6)))

7
27

The assembler itself has used up a lot of the available lisp cells but it works.

Now all I have to do is come up with some funny and (or) useful applications…


#2

Thanks for posting this - looks like a useful board.

Unfortunately the XIAO board does not have additional flash memory like the Serpente board does. But the board costs only one third.

It should be possible to use some of the flash memory to emulate EEPROM. The flash has a life of about 10000 write cycles which should be plenty for save-image; what do you think?


#3

Yes, that should work. The uLisp program needs only 30% of the flash. So 128KB would be free in any case.
Would this be realized with the Arduino EEPROM library?

Github Arduino/hardware/arduino/avr/libraries/EEPROM/

The area should preferably be assigned to a fixed part of the flash so that it is not overwritten when the program is updated, right?


#4

The AVR version of uLisp uses the EEPROM library, but that’s not supported by the ATSAMD21 so it would have to use a different technique.


#5

The Seeeduino XIAO is available in the UK from Cool Components:

Seeeduino XIAO - Cool Components

Unfortunately currently out of stock.


#6

I was looking at much the same thing, for a different purpose. According to the data sheet, none of the SAMD 21 variants with 256 KB flash offer dedicated EEPROM emulation, which means access to flash memory is frozen while erasing or writing. I suspect that could create some really tricky bugs if the processor tries to jump to an interrupt handler stored in flash while writing. Haven’t actively tried to trigger one, though.