diff --git a/boards/steelseries/apex_pro_mini/Kconfig.apex_pro_mini b/boards/steelseries/apex_pro_mini/Kconfig.apex_pro_mini new file mode 100644 index 0000000000000..b922ab8a856d7 --- /dev/null +++ b/boards/steelseries/apex_pro_mini/Kconfig.apex_pro_mini @@ -0,0 +1,5 @@ +# Copyright (c) 2025 Eve Redero +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_APEX_PRO_MINI + select SOC_STM32L412XX diff --git a/boards/steelseries/apex_pro_mini/Kconfig.defconfig b/boards/steelseries/apex_pro_mini/Kconfig.defconfig new file mode 100644 index 0000000000000..600406e296312 --- /dev/null +++ b/boards/steelseries/apex_pro_mini/Kconfig.defconfig @@ -0,0 +1,20 @@ +# Steelseries Apex Pro Mini keyboard configuration + +# Copyright (c) 2025 Eve Redero +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_APEX_PRO_MINI + +config SPI_STM32_INTERRUPT + default y + depends on SPI + +config INPUT_KBD_MATRIX_16_BIT_ROW + default y if INPUT_GPIO_KBD_MATRIX + +config SPI_NOR_FLASH_LAYOUT_PAGE_SIZE + default 4096 if FLASH + +source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig" + +endif # BOARD_APEX_PRO_MINI diff --git a/boards/steelseries/apex_pro_mini/apex_pro_mini.dts b/boards/steelseries/apex_pro_mini/apex_pro_mini.dts new file mode 100644 index 0000000000000..4c2c14682d3bf --- /dev/null +++ b/boards/steelseries/apex_pro_mini/apex_pro_mini.dts @@ -0,0 +1,246 @@ +/* + * Copyright (c) 2025 Eve Redero + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include +#include +#include + +/ { + model = "SteelSeries Apex Pro Mini board"; + compatible = "steelseries,apex_pro_mini", "st,stm32l412"; + + chosen { + zephyr,console = &cdc_acm_uart0; + zephyr,shell-uart = &cdc_acm_uart0; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; + + leds: leds { + compatible = "gpio-leds"; + + dbg_led: led_0 { + gpios = <&gpioc 12 GPIO_ACTIVE_HIGH>; + label = "User dbg tp"; + }; + }; + + aliases { + led0 = &dbg_led; + volt-sensor0 = &vref; + volt-sensor1 = &vbat; + }; + + kbd: kbd-matrix { + compatible = "gpio-kbd-matrix"; + status = "okay"; + idle-mode = "poll"; + settle-time-us = <110>; + no-ghostkey-check; + col-drive-inactive; + col-gpios = <&gpiob 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpiob 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpiob 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpiob 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpiob 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + row-gpios = <&gpioa 0 GPIO_ACTIVE_HIGH> + , <&gpioa 1 GPIO_ACTIVE_HIGH> + , <&gpioa 2 GPIO_ACTIVE_HIGH> + , <&gpioa 3 GPIO_ACTIVE_HIGH> + , <&gpioa 4 GPIO_ACTIVE_HIGH> + , <&gpioa 5 GPIO_ACTIVE_HIGH> + , <&gpioa 6 GPIO_ACTIVE_HIGH> + , <&gpioa 7 GPIO_ACTIVE_HIGH> + , <&gpioc 4 GPIO_ACTIVE_HIGH> + , <&gpioc 5 GPIO_ACTIVE_HIGH> + , <&gpioc 0 GPIO_ACTIVE_HIGH> + , <&gpioc 1 GPIO_ACTIVE_HIGH> + , <&gpioc 2 GPIO_ACTIVE_HIGH> + , <&gpioc 3 GPIO_ACTIVE_HIGH> + ; + + keymap { + compatible = "input-keymap"; + row-size = <14>; + col-size = <5>; + keymap = ; + }; + }; +}; + +&clk_lsi { + status = "okay"; +}; + +&clk_hsi { + status = "okay"; +}; + +&clk_hsi48 { + status = "okay"; +}; + +&pll { + div-m = <1>; + mul-n = <10>; + div-q = <2>; + div-r = <2>; + clocks = <&clk_hsi>; + status = "okay"; +}; + +&rcc { + clocks = <&pll>; + clock-frequency = ; + ahb-prescaler = <1>; + apb1-prescaler = <1>; + apb2-prescaler = <1>; +}; + +&usart1 { + pinctrl-0 = <&usart1_tx_pb6 &usart1_rx_pb7>; + pinctrl-names = "default"; + current-speed = <115200>; + status = "okay"; +}; + +&spi1 { + pinctrl-0 = <&spi1_sck_pb3 &spi1_miso_pb4 &spi1_mosi_pb5>; + pinctrl-names = "default"; + cs-gpios = <&gpioa 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + status = "okay"; + + flash1: fm25q128c@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = ; + size = ; + jedec-id = [a1 40 14]; + has-dpd; + }; +}; + +&spi2 { + pinctrl-0 = <&spi2_sck_pb13 &spi2_miso_pb14 &spi2_mosi_pb15>; + pinctrl-names = "default"; + cs-gpios = <&gpiob 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + status = "okay"; +}; + +&timers2 { + status = "okay"; + + pwm2: pwm { + status = "okay"; + pinctrl-0 = <&tim2_ch1_pa0>; + pinctrl-names = "default"; + }; +}; + +&rtc { + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>, + <&rcc STM32_SRC_LSI RTC_SEL(2)>; + status = "okay"; +}; + +&flash1 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + storage_partition: partition@0 { + label = "storage"; + reg = <0x0 DT_SIZE_K(16384)>; + }; + }; +}; + +&usb_fs_phy { + status = "okay"; +}; + +zephyr_udc0: &usb { + status = "okay"; + pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12 &usb_noe_pa13>; + pinctrl-names = "default"; + + cdc_acm_uart0: cdc_acm_uart0 { + compatible = "zephyr,cdc-acm-uart"; + }; +}; + +&vref { + status = "okay"; +}; + +&vbat { + status = "okay"; +}; diff --git a/boards/steelseries/apex_pro_mini/apex_pro_mini.yaml b/boards/steelseries/apex_pro_mini/apex_pro_mini.yaml new file mode 100644 index 0000000000000..07e9c56a5d221 --- /dev/null +++ b/boards/steelseries/apex_pro_mini/apex_pro_mini.yaml @@ -0,0 +1,17 @@ +identifier: apex_pro_mini +name: SteelSeries Apex Pro Mini +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb + - xtools +ram: 40 +flash: 64 +supported: + - gpio + - usb + - spi + - flash + - kbd-matrix +vendor: steelseries diff --git a/boards/steelseries/apex_pro_mini/apex_pro_mini_defconfig b/boards/steelseries/apex_pro_mini/apex_pro_mini_defconfig new file mode 100644 index 0000000000000..75a3154c8fb16 --- /dev/null +++ b/boards/steelseries/apex_pro_mini/apex_pro_mini_defconfig @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable HW stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable GPIO +CONFIG_GPIO=y diff --git a/boards/steelseries/apex_pro_mini/board.cmake b/boards/steelseries/apex_pro_mini/board.cmake new file mode 100644 index 0000000000000..2b9d495a3fd7d --- /dev/null +++ b/boards/steelseries/apex_pro_mini/board.cmake @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(jlink "--device=STM32L412RB" "--speed=4000") + +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/steelseries/apex_pro_mini/board.yml b/boards/steelseries/apex_pro_mini/board.yml new file mode 100644 index 0000000000000..95b937a34f746 --- /dev/null +++ b/boards/steelseries/apex_pro_mini/board.yml @@ -0,0 +1,6 @@ +board: + name: apex_pro_mini + full_name: Apex Pro Mini + vendor: steelseries + socs: + - name: stm32l412xx diff --git a/boards/steelseries/apex_pro_mini/doc/img/apex_pro_mini.webp b/boards/steelseries/apex_pro_mini/doc/img/apex_pro_mini.webp new file mode 100644 index 0000000000000..b20fff1435d2f Binary files /dev/null and b/boards/steelseries/apex_pro_mini/doc/img/apex_pro_mini.webp differ diff --git a/boards/steelseries/apex_pro_mini/doc/index.rst b/boards/steelseries/apex_pro_mini/doc/index.rst new file mode 100644 index 0000000000000..dd1e04627a64c --- /dev/null +++ b/boards/steelseries/apex_pro_mini/doc/index.rst @@ -0,0 +1,183 @@ +.. zephyr:board:: apex_pro_mini + +Overview +******** + +The Steelseries Apex Pro Mini is a mechanical keyboard based on +an ARM Cortex-M4 based STM32L412RB MCU. + +- STM32 microcontroller in LQFP64 package +- 62 keys +- 62 RGB LEDs +- USB-C port + +In includes the following peripherals: + +- Lumissil IS31FL3743B LED driver +- FMSH FM25Q128 128Mbits serial flash memory + +.. note:: + + This driver was developed using the French AZERTY keyboard version, + on which ENTER is 2U high. QWERTY versions have 61 keys and not 62, with: + + - An additional K29 BACKSLASH key above ENTER + - K45 SUP removed to fit a wider left shift + - K42 STAR removed to fit the ENTER key + +Installation +************ + +The keyboard has a 2.54mm through-hole header for SWD under the space bar. +It can be programmed with STLink or any other STM32-compatible probe. +The pinout is indicated by the board silkscreen: + ++-----+-------+-------+------+-----+ +| 3V3 | SWDIO | SWCLK | nRST | GND | ++-----+-------+-------+------+-----+ + +In order to be able to flash the new firmware, the factory firmware has +to be completely erased in order to remove the STM32L4 flash protection. +In order to do this process: + +- Open STM32CubeProgrammer and connect the target +- In OB section, check "PCROP_RDB" +- In PCROP Protection, write PCROP_START value as 0xFFFF and PCROP_END as 0x0 + (end before start disables the protection) +- In Write Protection, write WRP1A_STRT and WRP1B_STRT values as 0x3F + and WRP1A_END and WRP1B_END as 0x0 (same, end before start disables the protection) +- Then, go to Read Out Protection and select "AA" instead of "BB" + +Be mindful that the PCROP protection is only disabled when the ROP value is decreased, +from BB to AA, so if the process fails, you will have to set the ROP bit as "BB" again +and make sure PCROP_RDP is properly checked. + +Hardware +******** + +Supported Features +================== + +.. note:: The LED driver is not currently supported. + +.. zephyr:board-supported-hw:: + +Connections and IOs +=================== + +Peripheral Mapping: +------------------- + +- Flash driver on SPI1: PB3/PB4/PA5/PA15 +- LED controller on SPI2: PB12/PB13/PA14/PA15 +- Key columns C1-C14: PA0/PA1/PA2/PA3/PA4/PA5/PA6/PA7/PC4/PC5/PC0/PC3/PC1/PC2 +- Key rows R1-R5: PA11/PB10/PB2/PB1/PB0 +- SWD debug port: PA13/PA14 +- USB port: PA11/PA12 +- Testpoints: PA8/PB6/PB8/PB9/PC10/PC11/PC12/PC13/PC14/PC15/PC8/PC9/PD2 + +Keyboard Mapping: +----------------- + ++------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ +| Key column | C1 | C2 | C3 | C4 | C5 | C6 | C7 | C8 | C9 | C10 | C11 | C12 | C13 | C14 | ++============+=====+=====+=====+=====+=====+=====+=====+=====+=====+=====+=====+=====+=====+=====+ +| GPIO | PA0 | PA1 | PA2 | PA3 | PA4 | PA5 | PA6 | PA7 | PC4 | PC5 | PC0 | PC1 | PC2 | PC3 | ++------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ + ++---------+------+------+-----+-----+-----+ +| Key row | R1 | R2 | R3 | R4 | R5 | ++=========+======+======+=====+=====+=====+ +| GPIO | PB11 | PB10 | PB2 | PB1 | PB0 | ++---------+------+------+-----+-----+-----+ + + +The following array describes to the electrical connections, not to the geometric positions. +Notice how K15 (BACKSPACE) is addressed by column 12, row 5 but is positioned in the top right +corner, next to K13. + ++----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ +| | C1 | C2 | C3 | C4 | C5 | C6 | C7 | C8 | C9 | C10 | C11 | C12 | C13 | C14 | ++====+=====+=====+=====+=====+=====+=====+=====+=====+=====+=====+=====+=====+=====+=====+ +| R1 | K1 | K2 | K3 | K4 | K5 | K6 | K7 | K8 | K9 | K10 | K11 | K12 | K13 | | ++----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ +| R2 | K16 | K17 | K18 | K19 | K20 | K21 | K22 | K23 | K24 | K25 | K26 | K27 | K28 | | ++----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ +| R3 | K30 | K31 | K32 | K33 | K34 | K35 | K36 | K37 | K38 | K39 | K40 | K41 | K42 | K43 | ++----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ +| R4 | K44 | K45 | K46 | K47 | K48 | K49 | K50 | K51 | K52 | K53 | K54 | K55 | | K57 | ++----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ +| R5 | K58 | K59 | K60 | | K62 | | | K65 | K66 | K67 | K68 | K15 | | | ++----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ + +LED Driver Mapping: +------------------- + +This is the mapping for LEDs on the Lumissil driver. + ++----------+-------+-----------------------------+ +| Function | Color | Area | ++==========+=======+=============================+ +| CS1 | Blue | K1-K11 | ++----------+-------+-----------------------------+ +| CS2 | Green | K1-K11 | ++----------+-------+-----------------------------+ +| CS3 | Red | K1-K11 | ++----------+-------+-----------------------------+ +| CS4 | Blue | K16-K26 | ++----------+-------+-----------------------------+ +| CS5 | Green | K16-K26 | ++----------+-------+-----------------------------+ +| CS6 | Red | K16-K26 | ++----------+-------+-----------------------------+ +| CS7 | Blue | K30-K40 | ++----------+-------+-----------------------------+ +| CS8 | Green | K30-K40 | ++----------+-------+-----------------------------+ +| CS9 | Red | K30-K40 | ++----------+-------+-----------------------------+ +| CS10 | Blue | K44-K54 | ++----------+-------+-----------------------------+ +| CS11 | Green | K44-K54 | ++----------+-------+-----------------------------+ +| CS12 | Red | K44-K54 | ++----------+-------+-----------------------------+ +| CS13 | Blue | K55,K56,K58-K68 | ++----------+-------+-----------------------------+ +| CS14 | Green | K55,K56,K58-K68 | ++----------+-------+-----------------------------+ +| CS15 | Red | K55,K56,K58-K68 | ++----------+-------+-----------------------------+ +| CS16 | Blue | K12-K15,K27-K29,K41-K43,K57 | ++----------+-------+-----------------------------+ +| CS17 | Green | K12-K15,K27-K29,K41-K43,K57 | ++----------+-------+-----------------------------+ +| CS18 | Red | K12-K15,K27-K29,K41-K43,K57 | ++----------+-------+-----------------------------+ + + ++----------+---------------------------------------+ +| Function | Column keys | ++==========+=======================================+ +| SW1 | K1, K12, K16, K30, K43, K44, K58, K68 | ++----------+---------------------------------------+ +| SW2 | K2, K13, K17, K31, K45, K59 | ++----------+---------------------------------------+ +| SW3 | K3, K14, K18, K32, K46, K60 | ++----------+---------------------------------------+ +| SW4 | K4, K15, K19, K33, K47, K62 | ++----------+---------------------------------------+ +| SW5 | K5, K20, K27, K34, K48 | ++----------+---------------------------------------+ +| SW6 | K6, K21, K28, K35, K49 | ++----------+---------------------------------------+ +| SW7 | K7, K22, K29, K36, K50, K56, K65, K66 | ++----------+---------------------------------------+ +| SW8 | K8, K23, K37, K41, K51 | ++----------+---------------------------------------+ +| SW9 | K9, K24, K38, K42, K52, K67 | ++----------+---------------------------------------+ +| SW10 | K10, K25, K29, K39, K53 | ++----------+---------------------------------------+ +| SW11 | K11, K26, K40, K54, K55, K57 | ++----------+---------------------------------------+ diff --git a/boards/steelseries/apex_pro_mini/support/openocd.cfg b/boards/steelseries/apex_pro_mini/support/openocd.cfg new file mode 100644 index 0000000000000..f5cc8c6d2ca8e --- /dev/null +++ b/boards/steelseries/apex_pro_mini/support/openocd.cfg @@ -0,0 +1,7 @@ +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32l4x.cfg] + +reset_config srst_only connect_assert_srst diff --git a/boards/steelseries/index.rst b/boards/steelseries/index.rst new file mode 100644 index 0000000000000..005e0b2615385 --- /dev/null +++ b/boards/steelseries/index.rst @@ -0,0 +1,10 @@ +.. _boards-steelseries: + +SteelSeries +########### + +.. toctree:: + :maxdepth: 1 + :glob: + + **/* diff --git a/dts/bindings/vendor-prefixes.txt b/dts/bindings/vendor-prefixes.txt index bc00b613813e9..a3aea25ca6b9c 100644 --- a/dts/bindings/vendor-prefixes.txt +++ b/dts/bindings/vendor-prefixes.txt @@ -660,6 +660,7 @@ starfive StarFive Technology Co. Ltd. starry Starry Electronic Technology (ShenZhen) Co., LTD startek Startek ste ST-Ericsson +steelseries SteelSeries stericsson ST-Ericsson summit Summit microelectronics sunchip Shenzhen Sunchip Technology Co., Ltd diff --git a/tests/drivers/flash/common/boards/apex_pro_mini.overlay b/tests/drivers/flash/common/boards/apex_pro_mini.overlay new file mode 100644 index 0000000000000..43fbf7a227b73 --- /dev/null +++ b/tests/drivers/flash/common/boards/apex_pro_mini.overlay @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2025 STMicroelectronics + * SPDX-License-Identifier: Apache-2.0 + */ + +/delete-node/ &storage_partition; + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* + * Reserve the final 16 KiB for file system partition + */ + storage_partition: partition@1c276 { + label = "storage"; + reg = <0x0001c276 DT_SIZE_K(16)>; + }; + }; +};