CUSTOM BOARD WITH SAMD21G QUESTION

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ndevia
 
Posts: 9
Joined: Sun Feb 07, 2021 3:15 pm

CUSTOM BOARD WITH SAMD21G QUESTION

Post by ndevia »

Hi,

I've built a custom board with a USB A socket for keyboard HID development, based VERY closely on the Itsybitsy M0 Express layout - in fact, pretty much identical schematic to it, just without the analogue port connections. The LED on D13 is present, an APA102 is present on pins 1 & 2, etc. I made it as close to the Itsybitsy M0 Express as possible so that I wouldn't have to worry about writing custom board files or learning how to compile (or even if I could compile) a custom CircuitPython for it.

The board is built and I'm now testing it - have programmed the v3.13 bootloader onto it and it's appearing as a flash drive in Windows when I plug it in, the LED on D13 is 'breathing' and the APA102 RGB LED is changing colour appropriately according to status (well, it's green). I'm able to copy text files onto it, open/delete them, so the USB is working and the bootloader is working.

The issue I'm having is if I try to copy the CircuitPython 7.0.0 UF2 onto it. The copy hangs - or at least never updates past 0% - but the UF2 must be copied as the RGB LED turns purple. The device drops off the list of connected devices under USB and the board is bricked until I re-program the bootloader again.

I've also tried programming the board using the Arduino IDE (in fact this is my preferred IDE for this project), but it hangs when I try to program the board (set to Adafruit Itsybitsy M0 which is what comes up in the Port menu option) using a sketch that only uses 18KB of program space and even less data space, it says 'no device found on COM4', when there is definitely my custom PCB on that port.

The only MAJOR difference between my custom board and the Itsybitsy M0 Express is this: this particular test board is using a SAMD21G17, not a SAMD21G18. The difference is the '17 has half the program and data memory. I used a '17 as it was hard to get hold of '18s due to the chip shortage and figure that I wouldn't need the extra 128KB program memory or 16KB data memory.

I do now have some '18s, but before I remove the '17 from the board and replace it with a SAMD21G18, I just wanted to ask if the problem I'm experiencing would be caused by using a microcontroller with half the memory of the Itsybitsy M0 Express? If not, I'm wasting my time swapping the microcontroller in any case.

If that IS the problem, that's great - I can solve it easily by replacing the chip with an '18; but also, is there any way I can get the existing CircuitPython UF2 or Arduino IDE to work with the SAMD21G17?

User avatar
danhalbert
 
Posts: 4688
Joined: Tue Aug 08, 2017 12:37 pm

Re: CUSTOM BOARD WITH SAMD21G QUESTION

Post by danhalbert »

Two problems:

1. the bootloader may not work withe the '17, see for instance: https://github.com/adafruit/uf2-samdx1/issues/141
2. The '17 doesn't have enough RAM to run CircuitPython, and the CircuitPython build assumes that it has 32kB RAM.

So, yes, swapping for an '18 makes sense.

User avatar
ndevia
 
Posts: 9
Joined: Sun Feb 07, 2021 3:15 pm

Re: CUSTOM BOARD WITH SAMD21G QUESTION

Post by ndevia »

Thanks @danhalbert. I've made some progress working out how to compile my own bootloader and custom board definition, still had the same issue with CircuitPython but now you've confirmed that it won't run in 16KB, then that's fine, I won't push that any further.

I still need to look at the Arduino IDE to get it working with the SAMD21G17, though. It's still saying that it isn't detecting anything on the Com port, but I have a few threads to pull at with that one still before I swap out the microcontroller.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”