Skip to content

Conversation

tianrking
Copy link

Dear TinyGo maintainers,

This PR introduces the following improvements:

  1. Detailed overview of the Seeed XIAO ESP32C3 board and its capabilities.
  2. Comprehensive pin mapping information, including GPIO, UART, I2C, and SPI pins.
  3. Clear instructions for building and flashing TinyGo programs to the XIAO ESP32C3.
  4. A practical example demonstrating UART communication on the board.

Key additions include:

  • Accurate interface support information
  • Detailed pin configuration table
  • Step-by-step flashing instructions
  • Advanced building options with explanations of various flags
  • A working UART example to help users get started quickly

These additions aim to make it easier for TinyGo users to work with the XIAO ESP32C3 board, potentially broadening TinyGo's reach in the ESP32 ecosystem.

I have tested the provided information and example on the actual hardware to ensure accuracy. However, I welcome any feedback or suggestions for improvement.

Thank you for considering this contribution. I look forward to your review and am happy to make any necessary adjustments.

@tianrking
Copy link
Author

@deadprogram @aykevl

To build your TinyGo program without flashing it to the board, you can use the following command:

```shell
tinygo build -o blinky.elf -size=short -gc=leaking --panic=trap -target=xiao-esp32c3 [PATH TO YOUR PROGRAM]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
tinygo build -o blinky.elf -size=short -gc=leaking --panic=trap -target=xiao-esp32c3 [PATH TO YOUR PROGRAM]
tinygo build -o blinky.elf -target=xiao-esp32c3 [PATH TO YOUR PROGRAM]

I don't think these extra flags should be given, unless you specifically want those?

To compile and flash your program to the board in one step, use:

```shell
tinygo flash -port /dev/ttyUSB0 -target=xiao-esp32c3 [PATH TO YOUR PROGRAM]
Copy link
Member

Choose a reason for hiding this comment

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

Why is this command repeated? A similar command is already listed above.


- The XIAO ESP32C3 supports both WiFi and Bluetooth functionality. However, TinyGo's support for Bluetooth on this board may be limited or in development.
- The USB port on the XIAO ESP32C3 can be used as a serial port for debugging and communication.
- When using WiFi functionality, be mindful of power consumption as it can significantly affect battery life in portable projects.
Copy link
Member

Choose a reason for hiding this comment

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

A line like this seems to imply we support WiFi on this device, which we do not. I would suggest removing it, to avoid confusion.

Comment on lines +100 to +105
uart := machine.UART0
uart.Configure(machine.UARTConfig{
BaudRate: 115200,
TX: machine.D6, // UART_TX_PIN for XIAO ESP32C3
RX: machine.D7, // UART_RX_PIN for XIAO ESP32C3
})
Copy link
Member

Choose a reason for hiding this comment

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

Normally it's not needed to configure the UART at startup, you can just use fmt.Println. Is this different for this board?

To compile and flash this program:

```shell
tinygo flash -port /dev/ttyUSB0 -target=xiao-esp32c3 uart.go
Copy link
Member

Choose a reason for hiding this comment

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

Why is the extra -port parameter needed? TinyGo should detect it automatically.

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.

2 participants