samd XIAO USB Mass Storeage

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

samd XIAO USB Mass Storeage

Post by devnull » Sat Dec 25, 2021 2:31 am

Firstly HaPpY Christmas to everyone :-)

I am struggling with a SEEED XIAO, I have built and uploaded the firmware to the board, but I am unable to upload any files to it.

I understand that it should mount as a USB storage device and from there I should be able to manage files on the flash, but it does not.

also rshell is unable to upload files:

Code: Select all

> cp bqconfig.py /pyboard
Copying '/Users/pac/docker/upydev/work/projects/aibo/flash/bqconfig.py' to '/pyboard/bqconfig.py' ...
timed out or error in transfer to remote: b'F'
.. and I am now stuck with a device that I can access the REPL but nothing else, yes frozen modules would be ok for a production device, but I am in the development stage and need to manage the file system.

Any suggestions ?

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: samd XIAO USB Mass Storeage

Post by devnull » Sat Dec 25, 2021 3:23 am

Hmmm...

If I use the firmware from here: https://circuitpython.org/board/seeeduino_xiao/ then the device mounts as a USB mass stureage device but cannot be accessed via rshell.

I can however access the circuitpython version using the 'screen' command.

So how do I enable USB Mass Storeage mode in micropython, I dont see anything in the samd module ?

on the pyboard you can setup:

Code: Select all

pyb.usb_mode('VCP+MSC') # act as a serial and a storage device
pyb.usb_mode('VCP+HID')
But I dont see anything similar in the samd module ?

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: samd XIAO USB Mass Storeage

Post by devnull » Sat Dec 25, 2021 8:18 am

Oh, discovereed another problem with this device:

Code: Select all

>>> 4.1
Traceback (most recent call last):
  File "<stdin>", line 1
SyntaxError: decimal numbers not supported
Floating point not supported ???

User avatar
SunWukong
Posts: 11
Joined: Thu Jan 16, 2020 2:22 pm
Contact:

Re: samd XIAO USB Mass Storeage

Post by SunWukong » Sat Dec 25, 2021 10:56 am

devnull wrote:
Sat Dec 25, 2021 8:18 am
Floating point not supported ???
Unfortunately yes, the ATSAMD21 does not have a floating point coprocessor and MicroPython does not emulate floating point calculations in assembler. Floating point instructions

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: samd XIAO USB Mass Storeage

Post by devnull » Mon Dec 27, 2021 2:33 am

Thanks for helping.

I was able to add floating point support with:

Code: Select all

#define MICROPY_FLOAT_IMPL              (MICROPY_FLOAT_IMPL_FLOAT)
#define MICROPY_PY_BUILTINS_COMPLEX     (0)
#define MICROPY_PY_MATH                 (0)
#define MICROPY_PY_CMATH                (0)
However I still cannot get it to mount as USB mass storeage.

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: samd XIAO USB Mass Storeage

Post by devnull » Mon Dec 27, 2021 6:13 am

Does anyone know how to add I2C functionality to the machine module ?

Post Reply