diff --git a/boards/SUMMARY.md b/boards/SUMMARY.md index 59893da..c708a75 100644 --- a/boards/SUMMARY.md +++ b/boards/SUMMARY.md @@ -21,4 +21,5 @@ - [WR2LE](../boards/wr2le/README.md) - [WR3L](../boards/wr3l/README.md) - [WR3LE](../boards/wr3le/README.md) +- [LSC LMA35](../boards/lsc-lma35/README.md) - [Generic - Host-native](../boards/generic-native/README.md) diff --git a/boards/_base/pcb/lsc-lma35.json b/boards/_base/pcb/lsc-lma35.json new file mode 100644 index 0000000..044e107 --- /dev/null +++ b/boards/_base/pcb/lsc-lma35.json @@ -0,0 +1,102 @@ +{ + "pcb": { + "templates": [ + "custom-20x24-22", + "rf-20mm-type1" + ], + "vars": { + "MASK_PRESET": "mask_blue_light", + "TRACE_COLOR": "#58839B", + "SILK_COLOR": "white", + "PINTYPE_VERT": "pin_vert_2mm_cast_nohole", + "PINTYPE_HORZ": "pin_horz_2mm_cast_nohole" + }, + "pinout_hidden": "I2S,JTAG,FLASH,SD,SPI,SDA1", + "pinout": { + "1": { + "PWR": 3.3 + }, + "2": { + "IC": 15, + "ARD": "D0" + }, + "3": { + "IC": 11, + "ARD": "D1" + }, + "4": { + "IC": 12, + "ARD": "D2" + }, + "5": { + "IC": 16, + "ARD": "D3" + }, + "6": { + "GND": null + }, + "7": { + "IC": 18, + "ARD": "D4" + }, + "8": { + "IC": 29, + "ARD": "D5" + }, + "9": { + "IC": 17, + "ARD": [ + "D6", + "A0" + ] + }, + "10": { + "CTRL": "?" + }, + "11": { + "GND": null + }, + "12": { + "IC": 24, + "ARD": "D7" + }, + "13": { + "IC": 25, + "ARD": "D8" + }, + "14": { + "GND": null + }, + "15": { + "IC": 19, + "ARD": "D9" + }, + "16": { + "IC": 22, + "ARD": "D10" + }, + "17": { + "IC": 23, + "ARD": "D11" + }, + "18": { + "IC": 26, + "ARD": "D12" + }, + "19": { + "GND": null + }, + "20": { + "IC": 27, + "ARD": "D13" + }, + "21": { + "CTRL": "?" + }, + "22": { + "IC": 28, + "ARD": "D14" + } + } + } +} diff --git a/boards/lsc-lma35.json b/boards/lsc-lma35.json new file mode 100644 index 0000000..0b3e8fb --- /dev/null +++ b/boards/lsc-lma35.json @@ -0,0 +1,29 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231n", + "beken-7231n-tuya", + "pcb/ic-bk7231-qfn32", + "pcb/lsc-lma35" + ], + "build": { + "mcu": "bk7231n", + "variant": "lsc-lma35" + }, + "name": "LSC LMA35", + "symbol": "LSC LMA35", + "url": "https://www.action.com/de-at/p/lsc-smart-connect-outdoor-led-streifen/", + "vendor": "Unknown", + "pcb": { + "symbol": "LMA35" + }, + "doc": { + "extra": [ + "## Information", + "This board has no marking on the front side, only something that looks like PCB manufacturing info on the back; thus it was named based on these symbols.", + "It can be found in 'LSC Smart Connect Outdoor LED Strip', and is likely custom-made for this product.", + "The pinout was established by writing to and probing consecutive GPIOs, using the generic board definition.", + "Pins marked with '?' are currently unknown, with a possibility of being CEN. Pin 22 (P1/D14) is also not confirmed." + ] + } +} diff --git a/boards/lsc-lma35/README.md b/boards/lsc-lma35/README.md new file mode 100644 index 0000000..6055c4e --- /dev/null +++ b/boards/lsc-lma35/README.md @@ -0,0 +1,75 @@ +# LSC LMA35 + +*by Unknown* + +[Product page](https://www.action.com/de-at/p/lsc-smart-connect-outdoor-led-streifen/) + +- [General info](../../docs/platform/beken-72xx/README.md) +- [Flashing guide](../../docs/platform/beken-72xx/flashing.md) +- [BkWriter v1.6.0](https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe) + +Parameter | Value +-------------|---------------------------------- +MCU | BK7231N +Manufacturer | Beken +Series | BK72XX +Frequency | 120 MHz +Flash size | 2 MiB +RAM size | 256 KiB +Voltage | 3.0V - 3.6V +I/O | 15x GPIO, 6x PWM, 2x UART, 1x ADC +Wi-Fi | 802.11 b/g/n +Bluetooth | BLE v5.1 + +## Pinout + +![Pinout](pinout_lsc-lma35.svg) + +## Arduino Core pin mapping + +No. | Pin | UART | I²C | SPI | PWM | Other +----|-----------|----------|----------|------|------|------ +D0 | P26 | | | | PWM5 | +D1 | P14 | | | SCK | | +D2 | P16 | | | MOSI | | +D3 | P24 | | | | PWM4 | +D4 | P22 | | | | | TDI +D5 | P0 | UART2_TX | I2C2_SCL | | | +D6 | P23 | | | | | TDO +D7 | P8 | | | | PWM2 | +D8 | P9 | | | | PWM3 | +D9 | P21 | | I2C1_SDA | | | TMS +D10 | P6 | | | | PWM0 | +D11 | P7 | | | | PWM1 | +D12 | P10 | UART1_RX | | | | +D13 | P11 | UART1_TX | | | | +D14 | P1 | UART2_RX | I2C2_SDA | | | +A0 | P23, ADC3 | | | | | + +## Flash memory map + +Flash size: 2 MiB / 2,097,152 B / 0x200000 + +Hex values are in bytes. + +Name | Start | Length | End +----------------|----------|--------------------|--------- +Bootloader | 0x000000 | 68 KiB / 0x11000 | 0x011000 +App Image | 0x011000 | 1.1 MiB / 0x119000 | 0x12A000 +OTA Image | 0x12A000 | 664 KiB / 0xA6000 | 0x1D0000 +TLV Store | 0x1D0000 | 4 KiB / 0x1000 | 0x1D1000 +Network Data | 0x1D1000 | 8 KiB / 0x2000 | 0x1D3000 +Key-Value Store | 0x1D3000 | 32 KiB / 0x8000 | 0x1DB000 +User Data | 0x1DB000 | 148 KiB / 0x25000 | 0x200000 + +Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes. + +## Information + +This board has no marking on the front side, only something that looks like PCB manufacturing info on the back; thus it was named based on these symbols. + +It can be found in 'LSC Smart Connect Outdoor LED Strip', and is likely custom-made for this product. + +The pinout was established by writing to and probing consecutive GPIOs, using the generic board definition. + +Pins marked with '?' are currently unknown, with a possibility of being CEN. Pin 22 (P1/D14) is also not confirmed. diff --git a/boards/lsc-lma35/pinout_lsc-lma35.svg b/boards/lsc-lma35/pinout_lsc-lma35.svg new file mode 100644 index 0000000..3d02d8c --- /dev/null +++ b/boards/lsc-lma35/pinout_lsc-lma35.svg @@ -0,0 +1,325 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3V3 + + + + + P26 + + + + D0 + + + + IRDA + + + + PWM5 + + + + + P14 + + + + D1 + + + + + P16 + + + + D2 + + + + + P24 + + + + D3 + + + + PWM4 + + + + + GND + + + + + P22 + + + + D4 + + + + + P0 + + + + D5 + + + + TX2 + + + + SCL2 + + + + + P23 + + + + ADC3 + + + + D6 + + + + A0 + + + + + ? + + + + + GND + + + + + P8 + + + + D7 + + + + PWM2 + + + + + P9 + + + + D8 + + + + PWM3 + + + + + GND + + + + + P21 + + + + D9 + + + + + P6 + + + + D10 + + + + PWM0 + + + + + P7 + + + + D11 + + + + PWM1 + + + + + P10 + + + + D12 + + + + RX1 + + + + + GND + + + + + P11 + + + + D13 + + + + TX1 + + + + + ? + + + + + P1 + + + + D14 + + + + RX2 + + + + SDA2 + diff --git a/boards/lsc-lma35/pins_arduino.h b/boards/lsc-lma35/pins_arduino.h new file mode 100644 index 0000000..1de3ade --- /dev/null +++ b/boards/lsc-lma35/pins_arduino.h @@ -0,0 +1 @@ +#include "variant.h" diff --git a/boards/lsc-lma35/variant.cpp b/boards/lsc-lma35/variant.cpp new file mode 100644 index 0000000..e07b81f --- /dev/null +++ b/boards/lsc-lma35/variant.cpp @@ -0,0 +1,42 @@ +/* This file was auto-generated from lsc-lma35.json using boardgen */ + +#include + +extern "C" { + +// clang-format off +PinInfo pinTable[PINS_COUNT] = { + // D0: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: P14, SD_CLK, SCK + {GPIO14, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D2: P16, SD_D0, MOSI + {GPIO16, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D3: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, + // D5: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D6: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D7: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D10: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D11: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D12: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D13: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D14: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, +}; +// clang-format on + +} // extern "C" diff --git a/boards/lsc-lma35/variant.h b/boards/lsc-lma35/variant.h new file mode 100644 index 0000000..a07c694 --- /dev/null +++ b/boards/lsc-lma35/variant.h @@ -0,0 +1,37 @@ +/* This file was auto-generated from lsc-lma35.json using boardgen */ + +#pragma once + +#include + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 15 +#define NUM_DIGITAL_PINS 15 +#define NUM_ANALOG_INPUTS 1 +#define NUM_ANALOG_OUTPUTS 0 + +// Analog pins +// ----------- +#define PIN_A0 6u // GPIO23 +#define A0 PIN_A0 + +// SPI Interfaces +// -------------- +#define SPI_INTERFACES_COUNT 0 + +// Wire Interfaces +// --------------- +#define WIRE_INTERFACES_COUNT 1 +#define PIN_WIRE2_SCL 5u // GPIO0 +#define PIN_WIRE2_SDA 14u // GPIO1 + +// Serial ports +// ------------ +#define SERIAL_INTERFACES_COUNT 2 +#define PIN_SERIAL1_RX 12u // GPIO10 +#define PIN_SERIAL1_TX 13u // GPIO11 +#define PIN_SERIAL2_RX 14u // GPIO1 +#define PIN_SERIAL2_TX 5u // GPIO0 diff --git a/docs/supported_boards.md b/docs/supported_boards.md index a0811e8..7574fad 100644 --- a/docs/supported_boards.md +++ b/docs/supported_boards.md @@ -26,5 +26,7 @@ Name | MCU [WR2LE](../boards/wr2le/README.md) | RTL8710BX | 2 MiB | 256 KiB | 7 (5 I/O) | ✔️ | ❌ | ❌ | `realtek-ambz` [WR3L](../boards/wr3l/README.md) | RTL8710BX | 2 MiB | 256 KiB | 16 (12 I/O) | ✔️ | ❌ | ❌ | `realtek-ambz` [WR3LE](../boards/wr3le/README.md) | RTL8710BX | 2 MiB | 256 KiB | 16 (12 I/O) | ✔️ | ❌ | ❌ | `realtek-ambz` +**Unknown** | | | | | | | | +[LSC LMA35](../boards/lsc-lma35/README.md) | BK7231N | 2 MiB | 256 KiB | 22 (15 I/O) | ✔️ | ✔️ | ❌ | `beken-7231n` **N/A** | | | | | | | | [Native](../boards/generic-native/README.md) | NATIVE | 4 MiB | 4 MiB | - | ✔️ | ❌ | ❌ | `host-native` diff --git a/tools/boardgen b/tools/boardgen index f2bc340..32b69ac 160000 --- a/tools/boardgen +++ b/tools/boardgen @@ -1 +1 @@ -Subproject commit f2bc3407634dbe67f64ae218bb9f9d36bac3339f +Subproject commit 32b69ac69562c94528e3b14417622ae393b11c2b