Skip to content

Conversation

@sago35
Copy link
Member

@sago35 sago35 commented Jun 14, 2020

I added Seeed XIAO (Seeeduino XIAO) support to TinyGo.

The SEEED Seeeduino XIAO is a minimal, low-cost board that uses the Atmel ATSAMD21G18,
a 32-bit ARM Cortex-M0+ processor with 256KB flash and 32KB SRAM running at 48MHz.
The board is 20 x 17.5mm, and uses a USB-C connector.

The price is only $4.9.
It's more expensive than bluepill but considerably cheaper than trinket-m0 ($8.95).
It doesn't have external flash, but it's SAMD21, so it's a good first step for TinyGo.
https://wiki.seeedstudio.com/Seeeduino-XIAO/

ATSAMD2x datasheet: https://files.seeedstudio.com/wiki/Seeeduino-XIAO/res/ATSAMD21G18A-MU-Datasheet.pdf
PinOut: https://files.seeedstudio.com/wiki/Seeeduino-XIAO/img/Seeeduino-XIAO-pinout.jpg
Schematics: https://files.seeedstudio.com/wiki/Seeeduino-XIAO/res/Seeeduino-XIAO-v1.0-SCH-191112.pdf

  • Feature

    • ATSAMD21G18 (48MHz / 48 Pins / 256KB / 32KB)
    • SWDIO / SWCLK
    • 2 blue LED + 1 yello LED
    • Type-C interface
  • TODO

    • RESET_MAGIC_VALUE
    • USB CDC identifiers / VID / PID
    • Check: ./src/examples
    • Check: tinygo.org/x/drivers/examples
    • Update README.md
    • Update Makefile

@sago35
Copy link
Member Author

sago35 commented Jun 16, 2020

board info from Arduino IDE
image

@sago35
Copy link
Member Author

sago35 commented Jun 16, 2020

image

LED = PA17
PIN_LED_13 = PA17
PIN_LED = PA17
LED_BUILTIN = PA17
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LED_BUILTIN is used in the Arduino environment. I think we should only define LED here (not the other three definitions), as that is the convention for other boards within TinyGo.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed at 14d9484

Comment on lines 49 to 52
PIN_LED_RXL = PA18
PIN_LED_TXL = PA19
PIN_LED2 = PIN_LED_RXL
PIN_LED3 = PIN_LED_TXL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you match the TinyGo convention here?

Suggested change
PIN_LED_RXL = PA18
PIN_LED_TXL = PA19
PIN_LED2 = PIN_LED_RXL
PIN_LED3 = PIN_LED_TXL
LED_RXL = PA18
LED_TXL = PA19
LED1 = LED
LED2 = LED_RXL
LED3 = LED_TXL

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed at 14d9484

Comment on lines 55 to 49
const (
SWDIO = PA31
SWCLK = PA30
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These cannot normally be used from the firmware so there isn't a good reason to define these.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed at af11b38

"build-tags": ["sam", "atsamd21g18a", "xiao"],
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"msd-volume-name": "ITSYBOOT",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like they just copied the ItsyBitsy-M0 bootloader, which is unfortunate. But we'll have to match that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed at 201dfc2
The volume name was Arduino as well as Wio Terminal (#1124).

@sago35
Copy link
Member Author

sago35 commented Jun 17, 2020

Created #1174 to add some ADC pin settings.

@sago35
Copy link
Member Author

sago35 commented Jun 17, 2020

Basic testing was done.
The results were fine.

  • test ok
    • ./src/examples/blinky1
    • ./src/examples/adc
    • ./src/examples/button
    • ./src/examples/echo
    • ./src/examples/serial
    • ./src/examples/pininterrupt
    • ./src/examples/systick
    • ./src/examples/pwm
      • Some of the pins are OK : D10 D8 D5 D4
    • I2C
      • tinygo.org/x/drivers/examples/adt7410
    • SPI
      • tinygo.org/x/drivers/examples/ili9341
    • UART
      • ./src/examples/echo
  • not tested
    • I2S
      • I don't have an I2S device.

@sago35
Copy link
Member Author

sago35 commented Jun 17, 2020

Completed.
Please review.

@sago35 sago35 marked this pull request as ready for review June 17, 2020 15:03
@deadprogram
Copy link
Member

Hello @sago35 can you please resolve the merge conflict? Thank you.

@sago35
Copy link
Member Author

sago35 commented Jun 21, 2020

@deadprogram
rebased and force-pushed.

I want to merge this PR and then merge #1180.

@deadprogram
Copy link
Member

Thank you very much for another great contribution @sago35 now squash/merging.

@deadprogram deadprogram merged commit 2721ab1 into tinygo-org:dev Jun 22, 2020
@sago35 sago35 deleted the xiao branch June 23, 2020 09:10
@sago35 sago35 restored the xiao branch June 23, 2020 09:13
@niaow niaow added this to the v0.14 milestone Jun 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants