Skip to content

Don't depend board definition #2607

@cpunion

Description

@cpunion

I'm deploping a program on stm32f429, I don't want use any predefined board, because it's a custom board, and I want define it in my project. So I create a project with structure likes below:

PROJ/
  main.go
  go.mod
  stm32f429.json
  ...

Content of stm32f429.json:

{
  "inherits": ["cortex-m4"],
  "build-tags": ["stm32f429", "stm32f4", "stm32"],
  "serial": "none",
  "linkerscript": "targets/stm32f429.ld",
  "extra-files": [
    "src/device/stm32/stm32f429.s"
  ],
  "flash-method": "openocd",
  "openocd-interface": "stm32f429-myboard",
  "openocd-target": "stm32f4x"
}

And then I run with command:

tinygo flash -target=./stm32f429.json main.go

It outputs:

# machine
/opt/homebrew/Cellar/tinygo/0.22.0/src/machine/machine_stm32_i2c_reva.go:132:16: undeclared name: I2C0_SCL_PIN
/opt/homebrew/Cellar/tinygo/0.22.0/src/machine/machine_stm32_i2c_reva.go:133:16: undeclared name: I2C0_SDA_PIN
/opt/homebrew/Cellar/tinygo/0.22.0/src/machine/machine_stm32_spi.go:55:16: undeclared name: SPI0_SCK_PIN
/opt/homebrew/Cellar/tinygo/0.22.0/src/machine/machine_stm32_spi.go:56:16: undeclared name: SPI0_SDO_PIN
/opt/homebrew/Cellar/tinygo/0.22.0/src/machine/machine_stm32_spi.go:57:16: undeclared name: SPI0_SDI_PIN
/opt/homebrew/Cellar/tinygo/0.22.0/src/machine/machine_stm32_uart.go:38:15: undeclared name: UART_TX_PIN
/opt/homebrew/Cellar/tinygo/0.22.0/src/machine/machine_stm32_uart.go:39:15: undeclared name: UART_RX_PIN

I think we can remove those lines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions