Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions boards/ti/lp_mspm0g5187/Kconfig.lp_mspm0g5187
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2025 Texas Instruments
# SPDX-License-Identifier: Apache-2.0

config BOARD_LP_MSPM0G5187
select SOC_MSPM0G5187
5 changes: 5 additions & 0 deletions boards/ti/lp_mspm0g5187/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-License-Identifier: Apache-2.0

board_runner_args(jlink "--device=MSPM0G5187" "--speed=4000")
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
6 changes: 6 additions & 0 deletions boards/ti/lp_mspm0g5187/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
board:
name: lp_mspm0g5187
full_name: MSPM0G5187 Launchpad
vendor: ti
socs:
- name: mspm0g5187
140 changes: 140 additions & 0 deletions boards/ti/lp_mspm0g5187/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
.. zephyr:board:: lp_mspm0g5187

Overview
********

MSPM0G511x microcontrollers (MCUs) are part of the MSP highly integrated, ultra-low-power 32-bit MCU
family based on the enhanced Arm® Cortex®-M0+ 32-bit core platform, operating at up to 80-MHz frequency.
These MCUs offer a blend of cost optimization and design flexibility for applications requiring 32KB to 128KB
of flash memory in small packages (down to 4 mm x 4 mm) or high pin count packages (up to 64 pins).
These devices include USB 2.0-FS interface, digital audio interface, cybersecurity enablers, high performance
integrated analog, and provide excellent low power performance across the operating temperature range.

Hardware
********

The MSPM0G51xx devices provide up to 128KB embedded flash program memory with built-in error correction
code (ECC) and up to 32KB SRAM with a hardware parity option. These MCUs also incorporate a
memory protection unit, 12-channel DMA, and a variety of peripherals including

* Analog.

* One 12-bit 4-Msps ADCs.

* Configurable internal shared voltage reference.

* One high speed comparator with built-in reference DAC.

* Digital.

* Two 16-bit advanced control timers.

* Four general-purpose timers.

* Two 16-bit general-purpose timers.

* One 16-bit general-purpose timer with low-power operation in STANDBY mode.

* One 16-bit timer with deadband support and up to 8 PWM Channels.

* One basic software timer including 4 indenpendent configurable 16-bit counters.

* Two windowed-watchdog timers.

* One RTC with alarm and calendar modes.

* Data Integrity and Encryption.

* One AES HW accelerator capable of CTR and CBC modes.

* One Cyclic Redundancy Check (CRC) accelerator.

* Communication.

* Two configurable serial interfaces (UNICOMM) supporting UART or I2C.

* One configurable serial interface supporting UART or SPI.

* One dedicated SPI interface up to 32 Mbits/s.

* One digital audio interface (I2S) supporting controller and target mode.

* One USB2.0 interface with full-speed (12-Mbps) compliant device and host mode.

Zephyr uses the ``lp_mspm0g5187`` board for building LP_MSPM0G5187

Features
********

- Onboard XDS110 debug probe
- EnergyTrace technology available for ultra-low-power debugging
- 3 buttons, 1 LED and 1 RGB LED for user interaction
- One microSD slot
- One microphone
- One I2S based audio ADC

Details on the MSPM0G5187 LaunchPad can be found on the `TI LP_MSPM0G5187 Product Page`_.

Supported Features
==================

.. zephyr:board-supported-hw::

Building and Flashing
*********************

Building
========

Follow the :ref:`getting_started` instructions for Zephyr application development.

For example, to build the blinky application for the MSPM0G5187 LaunchPad:

.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: lp_mspm0g5187
:goals: build

The resulting ``zephyr.bin`` binary in the build directory can be flashed onto
MSPM0G5187 LaunchPad using the steps mentioned below.

Flashing
========

OpenOCD can be used to program the flash memory on the devices.

.. code-block:: console

$ west flash --openocd <path to cloned dir>/src/openocd --openocd-search <path to cloned dir>/tcl

Flashing can also be done using JLINK.

.. code-block:: console

$ west flash --runner jlink

Debugging
=========

You can debug an application in the usual way. Here is an example for the
:zephyr:code-sample:`hello_world` application.

.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: lp_mspm0g5187
:goals: debug

References
**********

- `TI MSPM0 MCU Page`_
- `MSPM0G5187 TRM`_

.. _TI MSPM0 MCU Page:
https://www.ti.com/microcontrollers-mcus-processors/arm-based-microcontrollers/arm-cortex-m0-mcus/overview.html

.. _MSPM0G5187 TRM:
https://www.ti.com/lit/slau846

.. _TI LP_MSPM0G5187 Product Page:
https://www.ti.com/tool/LP-MSPM0G5187
Binary file added boards/ti/lp_mspm0g5187/doc/lp_mspm0g5187.webp
Copy link
Member

Choose a reason for hiding this comment

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

I'm not a person responsible for this, but maybe this image is of too high resolution. @kartben should the board image be under ca 500 KiB?

Copy link
Contributor

Choose a reason for hiding this comment

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

this needs to be about 50KiB or so

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
133 changes: 133 additions & 0 deletions boards/ti/lp_mspm0g5187/lp_mspm0g5187.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/* SPDX-License-Identifier: Apache-2.0 */

Check warning on line 1 in boards/ti/lp_mspm0g5187/lp_mspm0g5187.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

Copyright missing

boards/ti/lp_mspm0g5187/lp_mspm0g5187.dts:1 File has no SPDX-FileCopyrightText header, consider adding one.

/dts-v1/;

#include <ti/mspm0/g/mspm0g5187.dtsi>
#include <ti/mspm0/g/mspm0g51xx-pinctrl.dtsi>
#include <zephyr/dt-bindings/clock/mspm0_clock.h>
#include <zephyr/dt-bindings/gpio/gpio.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>

/ {
model = "TI LP_MSPM0G5117";
compatible = "ti,mspm0g5117";

aliases {
led0 = &led0;
led1 = &led1;
sw0 = &btn0;
sw1 = &btn1;
uart0 = &unicomm0_uart;
};

chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &unicomm0_uart;
zephyr,shell-uart = &unicomm0_uart;
zephyr,code-partition = &slot0_partition;
};

leds {
compatible = "gpio-leds";

Check failure on line 32 in boards/ti/lp_mspm0g5187/lp_mspm0g5187.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

boards/ti/lp_mspm0g5187/lp_mspm0g5187.dts:32 Insert new lines. Expecting 2.
led0: led_0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

this file is non compliant with the dts requirements

gpios = <&gpiob 13 GPIO_ACTIVE_HIGH>;
label = "Blue LED";
};

Check failure on line 36 in boards/ti/lp_mspm0g5187/lp_mspm0g5187.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

boards/ti/lp_mspm0g5187/lp_mspm0g5187.dts:36 Insert new lines. Expecting 2.
led1: led_1 {
gpios = <&gpioa 17 GPIO_ACTIVE_HIGH>;
label = "Red LED";
};

Check failure on line 40 in boards/ti/lp_mspm0g5187/lp_mspm0g5187.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

boards/ti/lp_mspm0g5187/lp_mspm0g5187.dts:40 Insert new lines. Expecting 2.
led2: led_2 {
gpios = <&gpioa 24 GPIO_ACTIVE_HIGH>;
label = "Green LED";
};
};

keys {
compatible = "gpio-keys";

Check failure on line 48 in boards/ti/lp_mspm0g5187/lp_mspm0g5187.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

boards/ti/lp_mspm0g5187/lp_mspm0g5187.dts:48 Insert new lines. Expecting 2.
btn0: btn_0 {
gpios = <&gpiob 21 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
label = "Switch 3";
zephyr,code = <INPUT_KEY_0>;
};

Check failure on line 53 in boards/ti/lp_mspm0g5187/lp_mspm0g5187.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

boards/ti/lp_mspm0g5187/lp_mspm0g5187.dts:53 Insert new lines. Expecting 2.
btn1: btn_1 {
gpios = <&gpioa 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
label = "Switch 2";
zephyr,code = <INPUT_KEY_1>;
};
};
};

&cpu0 {
clock-frequency = <DT_FREQ_M(80)>;
};

&ulpclk {
clock-frequency = <DT_FREQ_M(40)>;
clk-div = <2>;
};

&mclk {
clock-frequency = <DT_FREQ_M(80)>;
clocks = <&hsclk 0>;
};

&hsclk {
clocks = <&syspll2x 0>;
status = "okay";
};

&syspll2x {
status = "okay";
};

&flash0 {
status = "okay";

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x8000>;
};

slot0_partition: partition@8000 {
label = "image-0";
reg = <0x00008000 0x8000>;
};

slot1_partition: partition@10000 {
label = "image-1";
reg = <0x00010000 0x8000>;
};

storage_partition: partition@18000 {
label = "storage";
reg = <0x00018000 0x8000>;
};
};
};

&pinctrl {
status = "okay";
};

&gpioa {
status = "okay";
};

&gpiob {
status = "okay";
};

&unicomm0_uart {
compatible = "ti,mspm0-uart";
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uc0_tx_pa10 &uc0_rx_pa11>;
pinctrl-names = "default";
};
14 changes: 14 additions & 0 deletions boards/ti/lp_mspm0g5187/lp_mspm0g5187.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
identifier: lp_mspm0g5187
name: TI MSPM0G5187 Launchpad
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 32
flash: 128
supported:
- uart
- gpio
vendor: ti

Check warning on line 14 in boards/ti/lp_mspm0g5187/lp_mspm0g5187.yaml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

YAMLLint (new-line-at-end-of-file)

boards/ti/lp_mspm0g5187/lp_mspm0g5187.yaml:14 no new line character at the end of file
10 changes: 10 additions & 0 deletions boards/ti/lp_mspm0g5187/lp_mspm0g5187_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-License-Identifier: Apache-2.0

# Enable UART driver
CONFIG_SERIAL=y

# Enable Console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

CONFIG_CLOCK_CONTROL=y
4 changes: 4 additions & 0 deletions boards/ti/lp_mspm0g5187/support/openocd.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source [find interface/xds110.cfg]
adapter speed 10000

source [find target/ti_mspm0.cfg]
23 changes: 23 additions & 0 deletions drivers/gpio/gpio_mspm0.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ struct gpio_mspm0_data {
#if CONFIG_SOC_SERIES_MSPM0G
#define NUM_GPIOA_PIN 32
#define gpioa_pins NUM_GPIOA_PIN
#if CONFIG_SOC_MSPM0G5187
static uint8_t gpioa_pincm_lut[NUM_GPIOA_PIN] = {
IOMUX_PINCM1, IOMUX_PINCM2, IOMUX_PINCM3, IOMUX_PINCM4,
IOMUX_PINCM5, IOMUX_PINCM6, IOMUX_PINCM7, IOMUX_PINCM8, IOMUX_PINCM9,
IOMUX_PINCM10, IOMUX_PINCM11, IOMUX_PINCM14, IOMUX_PINCM19, IOMUX_PINCM20,
IOMUX_PINCM21, IOMUX_PINCM22, IOMUX_PINCM34, IOMUX_PINCM35, IOMUX_PINCM36,
IOMUX_PINCM37, IOMUX_PINCM38, IOMUX_PINCM39, IOMUX_PINCM40, IOMUX_PINCM41,
IOMUX_PINCM42, IOMUX_PINCM46, IOMUX_PINCM47, IOMUX_PINCM53, IOMUX_PINCM54,
IOMUX_PINCM55, IOMUX_PINCM58, IOMUX_PINCM59
};
#else
static uint8_t gpioa_pincm_lut[NUM_GPIOA_PIN] = {
IOMUX_PINCM1, IOMUX_PINCM2, IOMUX_PINCM7, IOMUX_PINCM8, IOMUX_PINCM9, IOMUX_PINCM10,
IOMUX_PINCM11, IOMUX_PINCM14, IOMUX_PINCM19, IOMUX_PINCM20, IOMUX_PINCM21, IOMUX_PINCM22,
Expand All @@ -47,6 +58,7 @@ static uint8_t gpioa_pincm_lut[NUM_GPIOA_PIN] = {
IOMUX_PINCM54, IOMUX_PINCM55, IOMUX_PINCM59, IOMUX_PINCM60, IOMUX_PINCM3, IOMUX_PINCM4,
IOMUX_PINCM5, IOMUX_PINCM6,
};
#endif
#elif CONFIG_SOC_SERIES_MSPM0L /* if CONFIG_SOC_SERIES_MSPM0L */
#define GPIOA_NODE DT_NODELABEL(gpioa)
#define NUM_GPIOA_PIN 31
Expand All @@ -69,13 +81,24 @@ static uint8_t gpioa_pincm_lut[NUM_GPIOA_PIN] = {
#ifdef CONFIG_SOC_SERIES_MSPM0G
#define NUM_GPIOB_PIN 28
#define gpiob_pins NUM_GPIOB_PIN
#if CONFIG_SOC_MSPM0G5187
static uint8_t gpiob_pincm_lut[NUM_GPIOB_PIN] = {
IOMUX_PINCM12, IOMUX_PINCM13, IOMUX_PINCM15, IOMUX_PINCM16, IOMUX_PINCM17,
IOMUX_PINCM18, IOMUX_PINCM23, IOMUX_PINCM24, IOMUX_PINCM25, IOMUX_PINCM26,
IOMUX_PINCM27, IOMUX_PINCM28, IOMUX_PINCM29, IOMUX_PINCM30, IOMUX_PINCM31,
IOMUX_PINCM32, IOMUX_PINCM33, IOMUX_PINCM43, IOMUX_PINCM44, IOMUX_PINCM45,
IOMUX_PINCM48, IOMUX_PINCM49, IOMUX_PINCM50, IOMUX_PINCM51, IOMUX_PINCM52,
IOMUX_PINCM56
};
Comment on lines +84 to +92

Choose a reason for hiding this comment

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

Not necessarily requesting any action at the moment, but I had to make similar updates for port B and port C pins for MSPM0G3519 SOC with 100-pin package. It could get ugly if people just start adding SOC-specific definitions here...

Copy link
Member

Choose a reason for hiding this comment

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

Agree. This keeps expanding for each series. Not nice for longer run, we need better approach.

#else
static uint8_t gpiob_pincm_lut[NUM_GPIOB_PIN] = {
IOMUX_PINCM12, IOMUX_PINCM13, IOMUX_PINCM15, IOMUX_PINCM16, IOMUX_PINCM17, IOMUX_PINCM18,
IOMUX_PINCM23, IOMUX_PINCM24, IOMUX_PINCM25, IOMUX_PINCM26, IOMUX_PINCM27, IOMUX_PINCM28,
IOMUX_PINCM29, IOMUX_PINCM30, IOMUX_PINCM31, IOMUX_PINCM32, IOMUX_PINCM33, IOMUX_PINCM43,
IOMUX_PINCM44, IOMUX_PINCM45, IOMUX_PINCM48, IOMUX_PINCM49, IOMUX_PINCM50, IOMUX_PINCM51,
IOMUX_PINCM52, IOMUX_PINCM56, IOMUX_PINCM57, IOMUX_PINCM58,
};
#endif
#elif CONFIG_SOC_SERIES_MSPM0L /* if CONFIG_SOC_SERIES_MSPM0L */
#define GPIOB_NODE DT_NODELABEL(gpiob)
#define NUM_GPIOB_PIN 32
Expand Down
3 changes: 2 additions & 1 deletion drivers/serial/Kconfig.mspm0
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ config UART_MSPM0
depends on DT_HAS_TI_MSPM0_UART_ENABLED
select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
select USE_MSPM0_DL_UART
select USE_MSPM0_DL_UNICOMM_UART if (HAS_MSP_UNICOMM)
select USE_MSPM0_DL_UART if !(HAS_MSP_UNICOMM)
select PINCTRL
help
This option enables the TI MSPM0 UART driver.
Loading
Loading