From 61e18e1457147228d93f346efe4be6ceaedaa67f Mon Sep 17 00:00:00 2001 From: Wojtek Siudzinski Date: Fri, 14 Feb 2020 17:17:05 +0100 Subject: [PATCH 01/11] Add Particle Xenon --- src/machine/board_particle_xenon.go | 43 +++++++++++++++++++++++++++++ targets/particle-xenon.json | 6 ++++ 2 files changed, 49 insertions(+) create mode 100644 src/machine/board_particle_xenon.go create mode 100644 targets/particle-xenon.json diff --git a/src/machine/board_particle_xenon.go b/src/machine/board_particle_xenon.go new file mode 100644 index 0000000000..0fb7eab70e --- /dev/null +++ b/src/machine/board_particle_xenon.go @@ -0,0 +1,43 @@ +// +build particle_xenon + +package machine + +const HasLowFrequencyCrystal = true + +// LEDs on the XENON +const ( + LED Pin = 44 + LED_GREEN Pin = 14 + LED_RED Pin = 13 + LED_BLUE Pin = 15 +) + +// UART pins +const ( + UART_TX_PIN Pin = 6 + UART_RX_PIN Pin = 8 +) + +// I2C pins +const ( + SDA_PIN = 26 + SCL_PIN = 27 +) + +// SPI pins +const ( + SPI0_SCK_PIN = 47 + SPI0_MOSI_PIN = 45 + SPI0_MISO_PIN = 46 +) + +// Other periferals +const ( + MODE_BUTTON = 11 + CHARGE_STATUS = 41 + LIPO_VOLTAGE = 5 + PCB_ANTENNA = 24 + EXTERNAL_UFL = 25 + NFC1 = 9 + NFC2 = 10 +) \ No newline at end of file diff --git a/targets/particle-xenon.json b/targets/particle-xenon.json new file mode 100644 index 0000000000..e6566ae7fd --- /dev/null +++ b/targets/particle-xenon.json @@ -0,0 +1,6 @@ +{ + "inherits": ["nrf52840_mdk"], + "build-tags": ["particle_xenon"], + "flash-method": "openocd", + "openocd-interface": "cmsis-dap" +} From 5cdf11568cdee5b752761e0c9e664fb71af4f824 Mon Sep 17 00:00:00 2001 From: Wojtek Siudzinski Date: Sun, 16 Feb 2020 15:54:07 +0100 Subject: [PATCH 02/11] Allow changing the UART pins --- src/machine/machine_nrf.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/machine/machine_nrf.go b/src/machine/machine_nrf.go index a5ecb0e98a..6c927d8f8f 100644 --- a/src/machine/machine_nrf.go +++ b/src/machine/machine_nrf.go @@ -79,8 +79,14 @@ func (uart UART) Configure(config UARTConfig) { uart.SetBaudRate(config.BaudRate) - // Set TX and RX pins from board. - uart.setPins(UART_TX_PIN, UART_RX_PIN) + // Set TX and RX pins + if config.TX == 0 && config.RX == 0 { + // Use default pins + uart.setPins(UART_TX_PIN, UART_RX_PIN) + } else { + uart.setPins(config.TX, config.RX) + } + nrf.UART0.ENABLE.Set(nrf.UART_ENABLE_ENABLE_Enabled) nrf.UART0.TASKS_STARTTX.Set(1) From 55eaa57ec3486cfe08c32f441411f3bb30531de9 Mon Sep 17 00:00:00 2001 From: Wojtek Siudzinski Date: Sun, 16 Feb 2020 16:10:12 +0100 Subject: [PATCH 03/11] Add Argon and Boron --- src/machine/board_particle_argon.go | 67 ++++++++++++++++++++++++++ src/machine/board_particle_boron.go | 73 +++++++++++++++++++++++++++++ src/machine/board_particle_xenon.go | 29 ++++++++---- targets/particle-3rd-gen.json | 6 +++ targets/particle-argon.json | 6 +++ targets/particle-boron.json | 6 +++ targets/particle-xenon.json | 2 +- 7 files changed, 180 insertions(+), 9 deletions(-) create mode 100644 src/machine/board_particle_argon.go create mode 100644 src/machine/board_particle_boron.go create mode 100644 targets/particle-3rd-gen.json create mode 100644 targets/particle-argon.json create mode 100644 targets/particle-boron.json diff --git a/src/machine/board_particle_argon.go b/src/machine/board_particle_argon.go new file mode 100644 index 0000000000..bdefee68e7 --- /dev/null +++ b/src/machine/board_particle_argon.go @@ -0,0 +1,67 @@ +// +build particle_argon + +package machine + +const HasLowFrequencyCrystal = true + +// More info: https://docs.particle.io/datasheets/wi-fi/argon-datasheet/ +// Board diagram: https://docs.particle.io/assets/images/xenon/xenon-block-diagram.png + +// LEDs +const ( + LED Pin = 44 + LED_GREEN Pin = 14 + LED_RED Pin = 13 + LED_BLUE Pin = 15 +) + +// UART pins +const ( + UART_TX_PIN Pin = 6 + UART_RX_PIN Pin = 8 +) + +// I2C pins +const ( + SDA_PIN Pin = 26 + SCL_PIN Pin = 27 +) + +// SPI pins +const ( + SPI0_SCK_PIN Pin = 47 + SPI0_MOSI_PIN Pin = 45 + SPI0_MISO_PIN Pin = 46 +) + +// Internal 4MB SPI Flash +const ( + SPI1_SCK_PIN Pin = 19 + SPI1_MOSI_PIN Pin = 20 + SPI1_MISO_PIN Pin = 21 + SPI1_CS_PIN Pin = 17 + SPI1_WP_PIN Pin = 22 + SPI1_HOLD_PIN Pin = 23 +) + +// ESP32 coprocessor +const ( + ESP32_TXD_PIN Pin = 36 + ESP32_RXD_PIN Pin = 37 + ESP32_CTS_PIN Pin = 39 + ESP32_RTS_PIN Pin = 38 + ESP32_BOOT_MODE_PIN Pin = 16 + ESP32_WIFI_EN_PIN Pin = 24 + ESP32_HOST_WK_PIN Pin = 7 +) + +// Other periferals +const ( + MODE_BUTTON_PIN Pin = 11 + CHARGE_STATUS_PIN Pin = 41 + LIPO_VOLTAGE_PIN Pin = 5 + PCB_ANTENNA_PIN Pin = 2 + EXTERNAL_UFL_PIN Pin = 25 + NFC1_PIN Pin = 9 + NFC2_PIN Pin = 10 +) \ No newline at end of file diff --git a/src/machine/board_particle_boron.go b/src/machine/board_particle_boron.go new file mode 100644 index 0000000000..099f6a42bf --- /dev/null +++ b/src/machine/board_particle_boron.go @@ -0,0 +1,73 @@ +// +build particle_boron + +package machine + +const HasLowFrequencyCrystal = true + +// More info: https://docs.particle.io/datasheets/cellular/boron-datasheet/ +// Board diagram: https://docs.particle.io/assets/images/xenon/xenon-block-diagram.png + +// LEDs +const ( + LED Pin = 44 + LED_GREEN Pin = 14 + LED_RED Pin = 13 + LED_BLUE Pin = 15 +) + +// UART pins +const ( + UART_TX_PIN Pin = 6 + UART_RX_PIN Pin = 8 +) + +// I2C pins +const ( + SDA_PIN = 26 + SCL_PIN = 27 + + // Internal I2C with MAX17043 and BQ24195 chips on it + SDA1_PIN = 24 + SCL1_PIN = 41 + INT1_PIN = 5 +) + +// SPI pins +const ( + SPI0_SCK_PIN = 47 + SPI0_MOSI_PIN = 45 + SPI0_MISO_PIN = 46 +) + +// Internal 4MB SPI Flash +const ( + SPI1_SCK_PIN = 19 + SPI1_MOSI_PIN = 20 + SPI1_MISO_PIN = 21 + SPI1_CS_PIN = 17 + SPI1_WP_PIN = 22 + SPI1_HOLD_PIN = 23 +) + +// u-blox coprocessor +const ( + UBLOX_TXD_PIN = 37 + UBLOX_RXD_PIN = 36 + UBLOX_CTS_PIN = 38 + UBLOX_RTS_PIN = 39 + UBLOX_RESET_PIN = 16 + UBLOX_POWER_ON_PIN = 24 + UBLOX_BUFF_EN_PIN = 25 + UBLOX_VINT_PIN = 2 +) + +// Other periferals +const ( + MODE_BUTTON_PIN = 11 + CHARGE_STATUS_PIN = 41 + LIPO_VOLTAGE_PIN = 5 + PCB_ANTENNA_PIN = 2 + EXTERNAL_UFL_PIN = 25 + NFC1_PIN = 9 + NFC2_PIN = 10 +) \ No newline at end of file diff --git a/src/machine/board_particle_xenon.go b/src/machine/board_particle_xenon.go index 0fb7eab70e..89c34a3754 100644 --- a/src/machine/board_particle_xenon.go +++ b/src/machine/board_particle_xenon.go @@ -4,7 +4,10 @@ package machine const HasLowFrequencyCrystal = true -// LEDs on the XENON +// More info: https://docs.particle.io/datasheets/discontinued/xenon-datasheet/ +// Board diagram: https://docs.particle.io/assets/images/xenon/xenon-block-diagram.png + +// LEDs const ( LED Pin = 44 LED_GREEN Pin = 14 @@ -31,13 +34,23 @@ const ( SPI0_MISO_PIN = 46 ) +// Internal 4MB SPI Flash +const ( + SPI1_SCK_PIN = 19 + SPI1_MOSI_PIN = 20 + SPI1_MISO_PIN = 21 + SPI1_CS_PIN = 17 + SPI1_WP_PIN = 22 + SPI1_HOLD_PIN = 23 +) + // Other periferals const ( - MODE_BUTTON = 11 - CHARGE_STATUS = 41 - LIPO_VOLTAGE = 5 - PCB_ANTENNA = 24 - EXTERNAL_UFL = 25 - NFC1 = 9 - NFC2 = 10 + MODE_BUTTON_PIN = 11 + CHARGE_STATUS_PIN = 41 + LIPO_VOLTAGE_PIN = 5 + PCB_ANTENNA_PIN = 24 + EXTERNAL_UFL_PIN = 25 + NFC1_PIN = 9 + NFC2_PIN = 10 ) \ No newline at end of file diff --git a/targets/particle-3rd-gen.json b/targets/particle-3rd-gen.json new file mode 100644 index 0000000000..2229319e79 --- /dev/null +++ b/targets/particle-3rd-gen.json @@ -0,0 +1,6 @@ +{ + "inherits": ["nrf52840"], + "build-tags": ["particle_3rd_gen"], + "flash-method": "openocd", + "openocd-interface": "cmsis-dap" +} diff --git a/targets/particle-argon.json b/targets/particle-argon.json new file mode 100644 index 0000000000..4fafeb06cf --- /dev/null +++ b/targets/particle-argon.json @@ -0,0 +1,6 @@ +{ + "inherits": ["particle-3rd-gen"], + "build-tags": ["particle_argon"], + "flash-method": "openocd", + "openocd-interface": "cmsis-dap" +} diff --git a/targets/particle-boron.json b/targets/particle-boron.json new file mode 100644 index 0000000000..3d06d32de1 --- /dev/null +++ b/targets/particle-boron.json @@ -0,0 +1,6 @@ +{ + "inherits": ["particle-3rd-gen"], + "build-tags": ["particle_boron"], + "flash-method": "openocd", + "openocd-interface": "cmsis-dap" +} diff --git a/targets/particle-xenon.json b/targets/particle-xenon.json index e6566ae7fd..d787cebba8 100644 --- a/targets/particle-xenon.json +++ b/targets/particle-xenon.json @@ -1,5 +1,5 @@ { - "inherits": ["nrf52840_mdk"], + "inherits": ["particle-3rd-gen"], "build-tags": ["particle_xenon"], "flash-method": "openocd", "openocd-interface": "cmsis-dap" From a4dc68bf97710792e6c7bd524b016c5ab820b2ef Mon Sep 17 00:00:00 2001 From: Wojtek Siudzinski Date: Sun, 16 Feb 2020 19:04:22 +0100 Subject: [PATCH 04/11] Fix the formatting --- src/machine/board_particle_argon.go | 2 +- src/machine/board_particle_boron.go | 18 +++++++++--------- src/machine/board_particle_xenon.go | 2 +- src/machine/machine_nrf.go | 1 - 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/machine/board_particle_argon.go b/src/machine/board_particle_argon.go index bdefee68e7..ac36015a7b 100644 --- a/src/machine/board_particle_argon.go +++ b/src/machine/board_particle_argon.go @@ -64,4 +64,4 @@ const ( EXTERNAL_UFL_PIN Pin = 25 NFC1_PIN Pin = 9 NFC2_PIN Pin = 10 -) \ No newline at end of file +) diff --git a/src/machine/board_particle_boron.go b/src/machine/board_particle_boron.go index 099f6a42bf..85dfdc1bc4 100644 --- a/src/machine/board_particle_boron.go +++ b/src/machine/board_particle_boron.go @@ -51,14 +51,14 @@ const ( // u-blox coprocessor const ( - UBLOX_TXD_PIN = 37 - UBLOX_RXD_PIN = 36 - UBLOX_CTS_PIN = 38 - UBLOX_RTS_PIN = 39 - UBLOX_RESET_PIN = 16 - UBLOX_POWER_ON_PIN = 24 - UBLOX_BUFF_EN_PIN = 25 - UBLOX_VINT_PIN = 2 + UBLOX_TXD_PIN = 37 + UBLOX_RXD_PIN = 36 + UBLOX_CTS_PIN = 38 + UBLOX_RTS_PIN = 39 + UBLOX_RESET_PIN = 16 + UBLOX_POWER_ON_PIN = 24 + UBLOX_BUFF_EN_PIN = 25 + UBLOX_VINT_PIN = 2 ) // Other periferals @@ -70,4 +70,4 @@ const ( EXTERNAL_UFL_PIN = 25 NFC1_PIN = 9 NFC2_PIN = 10 -) \ No newline at end of file +) diff --git a/src/machine/board_particle_xenon.go b/src/machine/board_particle_xenon.go index 89c34a3754..637c446971 100644 --- a/src/machine/board_particle_xenon.go +++ b/src/machine/board_particle_xenon.go @@ -53,4 +53,4 @@ const ( EXTERNAL_UFL_PIN = 25 NFC1_PIN = 9 NFC2_PIN = 10 -) \ No newline at end of file +) diff --git a/src/machine/machine_nrf.go b/src/machine/machine_nrf.go index 6c927d8f8f..663bf02405 100644 --- a/src/machine/machine_nrf.go +++ b/src/machine/machine_nrf.go @@ -86,7 +86,6 @@ func (uart UART) Configure(config UARTConfig) { } else { uart.setPins(config.TX, config.RX) } - nrf.UART0.ENABLE.Set(nrf.UART_ENABLE_ENABLE_Enabled) nrf.UART0.TASKS_STARTTX.Set(1) From 612081ae36fb81749b2f3d96e0424dacad269fef Mon Sep 17 00:00:00 2001 From: Wojtek Siudzinski Date: Mon, 17 Feb 2020 13:32:54 +0100 Subject: [PATCH 05/11] Fix copypasta --- src/machine/board_particle_argon.go | 2 +- src/machine/board_particle_boron.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/machine/board_particle_argon.go b/src/machine/board_particle_argon.go index ac36015a7b..fa5735b225 100644 --- a/src/machine/board_particle_argon.go +++ b/src/machine/board_particle_argon.go @@ -5,7 +5,7 @@ package machine const HasLowFrequencyCrystal = true // More info: https://docs.particle.io/datasheets/wi-fi/argon-datasheet/ -// Board diagram: https://docs.particle.io/assets/images/xenon/xenon-block-diagram.png +// Board diagram: https://docs.particle.io/assets/images/argon/argon-block-diagram.png // LEDs const ( diff --git a/src/machine/board_particle_boron.go b/src/machine/board_particle_boron.go index 85dfdc1bc4..e465dfb92f 100644 --- a/src/machine/board_particle_boron.go +++ b/src/machine/board_particle_boron.go @@ -5,7 +5,7 @@ package machine const HasLowFrequencyCrystal = true // More info: https://docs.particle.io/datasheets/cellular/boron-datasheet/ -// Board diagram: https://docs.particle.io/assets/images/xenon/xenon-block-diagram.png +// Board diagram: https://docs.particle.io/assets/images/boron/boron-block-diagram.png // LEDs const ( From 31f3e8155badb0fdd9d1e555a252be8b6a245312 Mon Sep 17 00:00:00 2001 From: Wojtek Siudzinski Date: Tue, 18 Feb 2020 10:54:42 +0100 Subject: [PATCH 06/11] Add the missing Pin type --- src/machine/board_particle_boron.go | 58 ++++++++++++++--------------- src/machine/board_particle_xenon.go | 36 +++++++++--------- 2 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/machine/board_particle_boron.go b/src/machine/board_particle_boron.go index e465dfb92f..41f283c63f 100644 --- a/src/machine/board_particle_boron.go +++ b/src/machine/board_particle_boron.go @@ -23,51 +23,51 @@ const ( // I2C pins const ( - SDA_PIN = 26 - SCL_PIN = 27 + SDA_PIN Pin = 26 + SCL_PIN Pin = 27 // Internal I2C with MAX17043 and BQ24195 chips on it - SDA1_PIN = 24 - SCL1_PIN = 41 - INT1_PIN = 5 + SDA1_PIN Pin = 24 + SCL1_PIN Pin = 41 + INT1_PIN Pin = 5 ) // SPI pins const ( - SPI0_SCK_PIN = 47 - SPI0_MOSI_PIN = 45 - SPI0_MISO_PIN = 46 + SPI0_SCK_PIN Pin = 47 + SPI0_MOSI_PIN Pin = 45 + SPI0_MISO_PIN Pin = 46 ) // Internal 4MB SPI Flash const ( - SPI1_SCK_PIN = 19 - SPI1_MOSI_PIN = 20 - SPI1_MISO_PIN = 21 - SPI1_CS_PIN = 17 - SPI1_WP_PIN = 22 - SPI1_HOLD_PIN = 23 + SPI1_SCK_PIN Pin = 19 + SPI1_MOSI_PIN Pin = 20 + SPI1_MISO_PIN Pin = 21 + SPI1_CS_PIN Pin = 17 + SPI1_WP_PIN Pin = 22 + SPI1_HOLD_PIN Pin = 23 ) // u-blox coprocessor const ( - UBLOX_TXD_PIN = 37 - UBLOX_RXD_PIN = 36 - UBLOX_CTS_PIN = 38 - UBLOX_RTS_PIN = 39 - UBLOX_RESET_PIN = 16 - UBLOX_POWER_ON_PIN = 24 - UBLOX_BUFF_EN_PIN = 25 - UBLOX_VINT_PIN = 2 + UBLOX_TXD_PIN Pin = 37 + UBLOX_RXD_PIN Pin = 36 + UBLOX_CTS_PIN Pin = 38 + UBLOX_RTS_PIN Pin = 39 + UBLOX_RESET_PIN Pin = 16 + UBLOX_POWER_ON_PIN Pin = 24 + UBLOX_BUFF_EN_PIN Pin = 25 + UBLOX_VINT_PIN Pin = 2 ) // Other periferals const ( - MODE_BUTTON_PIN = 11 - CHARGE_STATUS_PIN = 41 - LIPO_VOLTAGE_PIN = 5 - PCB_ANTENNA_PIN = 2 - EXTERNAL_UFL_PIN = 25 - NFC1_PIN = 9 - NFC2_PIN = 10 + MODE_BUTTON_PIN Pin = 11 + CHARGE_STATUS_PIN Pin = 41 + LIPO_VOLTAGE_PIN Pin = 5 + PCB_ANTENNA_PIN Pin = 2 + EXTERNAL_UFL_PIN Pin = 25 + NFC1_PIN Pin = 9 + NFC2_PIN Pin = 10 ) diff --git a/src/machine/board_particle_xenon.go b/src/machine/board_particle_xenon.go index 637c446971..10c1842a82 100644 --- a/src/machine/board_particle_xenon.go +++ b/src/machine/board_particle_xenon.go @@ -23,34 +23,34 @@ const ( // I2C pins const ( - SDA_PIN = 26 - SCL_PIN = 27 + SDA_PIN Pin = 26 + SCL_PIN Pin = 27 ) // SPI pins const ( - SPI0_SCK_PIN = 47 - SPI0_MOSI_PIN = 45 - SPI0_MISO_PIN = 46 + SPI0_SCK_PIN Pin = 47 + SPI0_MOSI_PIN Pin = 45 + SPI0_MISO_PIN Pin = 46 ) // Internal 4MB SPI Flash const ( - SPI1_SCK_PIN = 19 - SPI1_MOSI_PIN = 20 - SPI1_MISO_PIN = 21 - SPI1_CS_PIN = 17 - SPI1_WP_PIN = 22 - SPI1_HOLD_PIN = 23 + SPI1_SCK_PIN Pin = 19 + SPI1_MOSI_PIN Pin = 20 + SPI1_MISO_PIN Pin = 21 + SPI1_CS_PIN Pin = 17 + SPI1_WP_PIN Pin = 22 + SPI1_HOLD_PIN Pin = 23 ) // Other periferals const ( - MODE_BUTTON_PIN = 11 - CHARGE_STATUS_PIN = 41 - LIPO_VOLTAGE_PIN = 5 - PCB_ANTENNA_PIN = 24 - EXTERNAL_UFL_PIN = 25 - NFC1_PIN = 9 - NFC2_PIN = 10 + MODE_BUTTON_PIN Pin = 11 + CHARGE_STATUS_PIN Pin = 41 + LIPO_VOLTAGE_PIN Pin = 5 + PCB_ANTENNA_PIN Pin = 24 + EXTERNAL_UFL_PIN Pin = 25 + NFC1_PIN Pin = 9 + NFC2_PIN Pin = 10 ) From 1a2619dd1012d835cf9dade0e96ee1aa0c531be3 Mon Sep 17 00:00:00 2001 From: Wojtek Siudzinski Date: Tue, 18 Feb 2020 11:35:00 +0100 Subject: [PATCH 07/11] Add GPIOs and fix errors --- src/machine/board_particle_argon.go | 28 +++++++++++++++++- src/machine/board_particle_boron.go | 45 ++++++++++++++++++++++------- src/machine/board_particle_xenon.go | 28 +++++++++++++++++- 3 files changed, 88 insertions(+), 13 deletions(-) diff --git a/src/machine/board_particle_argon.go b/src/machine/board_particle_argon.go index fa5735b225..5113a680d7 100644 --- a/src/machine/board_particle_argon.go +++ b/src/machine/board_particle_argon.go @@ -15,8 +15,34 @@ const ( LED_BLUE Pin = 15 ) -// UART pins +// GPIOs const ( + A0 Pin = 3 + A1 Pin = 4 + A2 Pin = 28 + A3 Pin = 29 + A4 Pin = 30 + A5 Pin = 31 + D0 Pin = 26 // Also SDA + D1 Pin = 27 // Also SCL + D2 Pin = 33 + D3 Pin = 34 + D4 Pin = 40 + D5 Pin = 42 + D6 Pin = 43 + D7 Pin = 44 // Also LED + D8 Pin = 35 + D9 Pin = 6 // Also TX + D10 Pin = 8 // Also RX + D11 Pin = 46 // Also MISO + D12 Pin = 45 // Also MOSI + D13 Pin = 47 // Also SCK +) + +// UART +const ( + Serial = USB + UART0 = NRF_UART0 UART_TX_PIN Pin = 6 UART_RX_PIN Pin = 8 ) diff --git a/src/machine/board_particle_boron.go b/src/machine/board_particle_boron.go index 41f283c63f..24698520fb 100644 --- a/src/machine/board_particle_boron.go +++ b/src/machine/board_particle_boron.go @@ -15,8 +15,34 @@ const ( LED_BLUE Pin = 15 ) -// UART pins +// GPIOs const ( + A0 Pin = 3 + A1 Pin = 4 + A2 Pin = 28 + A3 Pin = 29 + A4 Pin = 30 + A5 Pin = 31 + D0 Pin = 26 // Also SDA + D1 Pin = 27 // Also SCL + D2 Pin = 33 + D3 Pin = 34 + D4 Pin = 40 + D5 Pin = 42 + D6 Pin = 43 + D7 Pin = 44 // Also LED + D8 Pin = 35 + D9 Pin = 6 // Also TX + D10 Pin = 8 // Also RX + D11 Pin = 46 // Also MISO + D12 Pin = 45 // Also MOSI + D13 Pin = 47 // Also SCK +) + +// UART +const ( + Serial = USB + UART0 = NRF_UART0 UART_TX_PIN Pin = 6 UART_RX_PIN Pin = 8 ) @@ -26,7 +52,7 @@ const ( SDA_PIN Pin = 26 SCL_PIN Pin = 27 - // Internal I2C with MAX17043 and BQ24195 chips on it + // Internal I2C with MAX17043 (Fuel gauge) and BQ24195 (Power management) chips on it SDA1_PIN Pin = 24 SCL1_PIN Pin = 41 INT1_PIN Pin = 5 @@ -55,19 +81,16 @@ const ( UBLOX_RXD_PIN Pin = 36 UBLOX_CTS_PIN Pin = 38 UBLOX_RTS_PIN Pin = 39 - UBLOX_RESET_PIN Pin = 16 - UBLOX_POWER_ON_PIN Pin = 24 + UBLOX_RESET_PIN Pin = 12 + UBLOX_POWER_ON_PIN Pin = 16 UBLOX_BUFF_EN_PIN Pin = 25 UBLOX_VINT_PIN Pin = 2 ) // Other periferals const ( - MODE_BUTTON_PIN Pin = 11 - CHARGE_STATUS_PIN Pin = 41 - LIPO_VOLTAGE_PIN Pin = 5 - PCB_ANTENNA_PIN Pin = 2 - EXTERNAL_UFL_PIN Pin = 25 - NFC1_PIN Pin = 9 - NFC2_PIN Pin = 10 + MODE_BUTTON_PIN Pin = 11 + ANTENNA_SEL_PIN Pin = 7 // Low: chip antenna, High: External uFL + NFC1_PIN Pin = 9 + NFC2_PIN Pin = 10 ) diff --git a/src/machine/board_particle_xenon.go b/src/machine/board_particle_xenon.go index 10c1842a82..601bb42ff9 100644 --- a/src/machine/board_particle_xenon.go +++ b/src/machine/board_particle_xenon.go @@ -15,8 +15,34 @@ const ( LED_BLUE Pin = 15 ) -// UART pins +// GPIOs const ( + A0 Pin = 3 + A1 Pin = 4 + A2 Pin = 28 + A3 Pin = 29 + A4 Pin = 30 + A5 Pin = 31 + D0 Pin = 26 // Also SDA + D1 Pin = 27 // Also SCL + D2 Pin = 33 + D3 Pin = 34 + D4 Pin = 40 + D5 Pin = 42 + D6 Pin = 43 + D7 Pin = 44 // Also LED + D8 Pin = 35 + D9 Pin = 6 // Also TX + D10 Pin = 8 // Also RX + D11 Pin = 46 // Also MISO + D12 Pin = 45 // Also MOSI + D13 Pin = 47 // Also SCK +) + +// UART +const ( + Serial = USB + UART0 = NRF_UART0 UART_TX_PIN Pin = 6 UART_RX_PIN Pin = 8 ) From 2bee4b1998d32aa6027286d65bc86830cb7ba943 Mon Sep 17 00:00:00 2001 From: Wojtek Siudzinski Date: Tue, 18 Feb 2020 11:45:55 +0100 Subject: [PATCH 08/11] Fix UART variables --- src/machine/board_particle_argon.go | 7 +++++-- src/machine/board_particle_boron.go | 7 +++++-- src/machine/board_particle_xenon.go | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/machine/board_particle_argon.go b/src/machine/board_particle_argon.go index 5113a680d7..dc5df0f769 100644 --- a/src/machine/board_particle_argon.go +++ b/src/machine/board_particle_argon.go @@ -40,9 +40,12 @@ const ( ) // UART +var ( + Serial = USB + UART0 = NRF_UART0 +) + const ( - Serial = USB - UART0 = NRF_UART0 UART_TX_PIN Pin = 6 UART_RX_PIN Pin = 8 ) diff --git a/src/machine/board_particle_boron.go b/src/machine/board_particle_boron.go index 24698520fb..1a2d1331bf 100644 --- a/src/machine/board_particle_boron.go +++ b/src/machine/board_particle_boron.go @@ -40,9 +40,12 @@ const ( ) // UART +var ( + Serial = USB + UART0 = NRF_UART0 +) + const ( - Serial = USB - UART0 = NRF_UART0 UART_TX_PIN Pin = 6 UART_RX_PIN Pin = 8 ) diff --git a/src/machine/board_particle_xenon.go b/src/machine/board_particle_xenon.go index 601bb42ff9..fe6fe49865 100644 --- a/src/machine/board_particle_xenon.go +++ b/src/machine/board_particle_xenon.go @@ -40,9 +40,12 @@ const ( ) // UART +var ( + Serial = USB + UART0 = NRF_UART0 +) + const ( - Serial = USB - UART0 = NRF_UART0 UART_TX_PIN Pin = 6 UART_RX_PIN Pin = 8 ) From 1fa5e2e23f3934b56e5d18e4fa9088a1c3760cb9 Mon Sep 17 00:00:00 2001 From: Wojtek Siudzinski Date: Tue, 18 Feb 2020 15:47:06 +0100 Subject: [PATCH 09/11] Add the boards to README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index c5f998dccf..b1c55822d0 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,9 @@ The following 28 microcontroller boards are currently supported: * [Nordic Semiconductor PCA10031](https://www.nordicsemi.com/eng/Products/nRF51-Dongle) * [Nordic Semiconductor PCA10040](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF52-DK) * [Nordic Semiconductor PCA10056](https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-DK) +* [Particle Argon](https://docs.particle.io/datasheets/wi-fi/argon-datasheet/) +* [Particle Boron](https://docs.particle.io/datasheets/cellular/boron-datasheet/) +* [Particle Xenon](https://docs.particle.io/datasheets/discontinued/xenon-datasheet/) * [Phytec reel board](https://www.phytec.eu/product-eu/internet-of-things/reelboard/) * [PineTime DevKit](https://www.pine64.org/pinetime/) * [SiFIve HiFive1](https://www.sifive.com/boards/hifive1) From d7640995c82c74763d95a211d9fec49281bf9ab6 Mon Sep 17 00:00:00 2001 From: Wojtek Siudzinski Date: Tue, 18 Feb 2020 15:54:52 +0100 Subject: [PATCH 10/11] Add smoke tests --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index c91b499eda..0d2e3c9797 100644 --- a/Makefile +++ b/Makefile @@ -256,6 +256,12 @@ smoketest: @$(MD5SUM) test.hex $(TINYGO) build -size short -o test.hex -target=pyportal examples/blinky1 @$(MD5SUM) test.hex + $(TINYGO) build -size short -o test.hex -target=particle-argon examples/blinky1 + @$(MD5SUM) test.hex + $(TINYGO) build -size short -o test.hex -target=particle-boron examples/blinky1 + @$(MD5SUM) test.hex + $(TINYGO) build -size short -o test.hex -target=particle-xenon examples/blinky1 + @$(MD5SUM) test.hex $(TINYGO) build -size short -o test.hex -target=nucleo-f103rb examples/blinky1 @$(MD5SUM) test.hex $(TINYGO) build -size short -o test.hex -target=pinetime-devkit0 examples/blinky1 From 086adf562920c49f71ff16d840a7c7c3cac31551 Mon Sep 17 00:00:00 2001 From: Wojtek Siudzinski Date: Tue, 18 Feb 2020 16:01:51 +0100 Subject: [PATCH 11/11] Apply review suggestions --- src/machine/board_particle_argon.go | 2 +- src/machine/board_particle_boron.go | 20 ++++++++++---------- src/machine/board_particle_xenon.go | 2 +- targets/particle-argon.json | 4 +--- targets/particle-boron.json | 4 +--- targets/particle-xenon.json | 4 +--- 6 files changed, 15 insertions(+), 21 deletions(-) diff --git a/src/machine/board_particle_argon.go b/src/machine/board_particle_argon.go index dc5df0f769..e0bee8c7b2 100644 --- a/src/machine/board_particle_argon.go +++ b/src/machine/board_particle_argon.go @@ -84,7 +84,7 @@ const ( ESP32_HOST_WK_PIN Pin = 7 ) -// Other periferals +// Other peripherals const ( MODE_BUTTON_PIN Pin = 11 CHARGE_STATUS_PIN Pin = 41 diff --git a/src/machine/board_particle_boron.go b/src/machine/board_particle_boron.go index 1a2d1331bf..9705829407 100644 --- a/src/machine/board_particle_boron.go +++ b/src/machine/board_particle_boron.go @@ -78,19 +78,19 @@ const ( SPI1_HOLD_PIN Pin = 23 ) -// u-blox coprocessor +// u-blox SARA coprocessor const ( - UBLOX_TXD_PIN Pin = 37 - UBLOX_RXD_PIN Pin = 36 - UBLOX_CTS_PIN Pin = 38 - UBLOX_RTS_PIN Pin = 39 - UBLOX_RESET_PIN Pin = 12 - UBLOX_POWER_ON_PIN Pin = 16 - UBLOX_BUFF_EN_PIN Pin = 25 - UBLOX_VINT_PIN Pin = 2 + SARA_TXD_PIN Pin = 37 + SARA_RXD_PIN Pin = 36 + SARA_CTS_PIN Pin = 38 + SARA_RTS_PIN Pin = 39 + SARA_RESET_PIN Pin = 12 + SARA_POWER_ON_PIN Pin = 16 + SARA_BUFF_EN_PIN Pin = 25 + SARA_VINT_PIN Pin = 2 ) -// Other periferals +// Other peripherals const ( MODE_BUTTON_PIN Pin = 11 ANTENNA_SEL_PIN Pin = 7 // Low: chip antenna, High: External uFL diff --git a/src/machine/board_particle_xenon.go b/src/machine/board_particle_xenon.go index fe6fe49865..ffdc663244 100644 --- a/src/machine/board_particle_xenon.go +++ b/src/machine/board_particle_xenon.go @@ -73,7 +73,7 @@ const ( SPI1_HOLD_PIN Pin = 23 ) -// Other periferals +// Other peripherals const ( MODE_BUTTON_PIN Pin = 11 CHARGE_STATUS_PIN Pin = 41 diff --git a/targets/particle-argon.json b/targets/particle-argon.json index 4fafeb06cf..a23233bb23 100644 --- a/targets/particle-argon.json +++ b/targets/particle-argon.json @@ -1,6 +1,4 @@ { "inherits": ["particle-3rd-gen"], - "build-tags": ["particle_argon"], - "flash-method": "openocd", - "openocd-interface": "cmsis-dap" + "build-tags": ["particle_argon"] } diff --git a/targets/particle-boron.json b/targets/particle-boron.json index 3d06d32de1..2b737393e0 100644 --- a/targets/particle-boron.json +++ b/targets/particle-boron.json @@ -1,6 +1,4 @@ { "inherits": ["particle-3rd-gen"], - "build-tags": ["particle_boron"], - "flash-method": "openocd", - "openocd-interface": "cmsis-dap" + "build-tags": ["particle_boron"] } diff --git a/targets/particle-xenon.json b/targets/particle-xenon.json index d787cebba8..d93425d778 100644 --- a/targets/particle-xenon.json +++ b/targets/particle-xenon.json @@ -1,6 +1,4 @@ { "inherits": ["particle-3rd-gen"], - "build-tags": ["particle_xenon"], - "flash-method": "openocd", - "openocd-interface": "cmsis-dap" + "build-tags": ["particle_xenon"] }