Skip to content

samples: Readd SX9328 sample #212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: tmo-main
Choose a base branch
from
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
16 changes: 8 additions & 8 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
# will never be auto-merged into from main. If the file doesn't exist here, then
# any upstream changes will override ours.
.gitattributes merge=ours
.github/ISSUE_TEMPLATE/001_bug_report.md
.github/ISSUE_TEMPLATE/002_enhancement.md
.github/ISSUE_TEMPLATE/003_rfc-proposal.md
.github/ISSUE_TEMPLATE/004_feature_request.md
.github/ISSUE_TEMPLATE/005_hardware_support.md
.github/ISSUE_TEMPLATE/006_nomination.md
.github/ISSUE_TEMPLATE/007_ext-source.md
.github/ISSUE_TEMPLATE/008_bin-blobs.md
.github/ISSUE_TEMPLATE/001_bug_report.md merge=ours
.github/ISSUE_TEMPLATE/002_enhancement.md merge=ours
.github/ISSUE_TEMPLATE/003_rfc-proposal.md merge=ours
.github/ISSUE_TEMPLATE/004_feature_request.md merge=ours
.github/ISSUE_TEMPLATE/005_hardware_support.md merge=ours
.github/ISSUE_TEMPLATE/006_nomination.md merge=ours
.github/ISSUE_TEMPLATE/007_ext-source.md merge=ours
.github/ISSUE_TEMPLATE/008_bin-blobs.md merge=ours
.github/workflows/assigner.yml merge=ours
.github/workflows/backport.yml merge=ours
.github/workflows/backport_issue_check.yml merge=ours
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/twister.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Run tests with twister

on:
workflow_call:
push:
branches:
- main
Expand Down
7 changes: 0 additions & 7 deletions boards/arm/efm32pg_stk3402a/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

# Copyright (c) 2018, Christian Taedcke
# Copyright (c) 2019 Lemonbeat GmbH
# Copyright (c) 2022 T-Mobile USA, Inc.

# SPDX-License-Identifier: Apache-2.0

if BOARD_EFM32PG_STK3402A || BOARD_EFM32PG_STK3402A_JG
Expand All @@ -18,9 +16,4 @@ config CMU_HFXO_FREQ
config CMU_LFXO_FREQ
default 32768

config COUNTER_GECKO_RTCC
bool
default y
depends on COUNTER

endif # BOARD_EFM32PG_STK3402A || BOARD_EFM32PG_STK3402A_JG
213 changes: 66 additions & 147 deletions boards/arm/efm32pg_stk3402a/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ EFM32 Pearl Gecko Starter Kit
Overview
********

The EFM32 Pearl Gecko Starter Kit EFM32PG-STK3402A contains an MCU from
the EFM32PG family built on an ARM® Cortex®-M4F processor with excellent
low power capabilities.
The EFM32 Pearl Gecko Starter Kit EFM32PG-STK3402A contains an MCU from the
EFM32PG family built on an ARM® Cortex®-M4F processor with excellent low
power capabilities.

.. figure:: efm32pg_stk3402a.jpg
:align: center
Expand All @@ -19,8 +19,8 @@ low power capabilities.
Hardware
********

- Advanced Energy Monitoring provides real-time information about the
energy consumption of an application or prototype design.
- Advanced Energy Monitoring provides real-time information about the energy
consumption of an application or prototype design.
- Ultra low power 128x128 pixel Memory-LCD
- 2 user buttons, 2 LEDs and a touch slider
- Humidity, temperature, and inductive-capacitive metal sensor
Expand All @@ -38,8 +38,7 @@ For more information about the EFM32PG SoC and EFM32PG-STK3402A board:
Supported Features
==================

The efm32pg_stk3402a board configuration supports the following
hardware features:
The efm32pg_stk3402a board configuration supports the following hardware features:

+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component |
Expand Down Expand Up @@ -70,8 +69,8 @@ The default configuration can be found in the defconfig file:

``boards/arm/efm32pg_stk3402a/efm32pg_stk3402a_defconfig``

The default configuration when building for this EFM32JG12B SoC can be
found in another defconfig file:
The default configuration when building for this EFM32JG12B SoC can be found in
another defconfig file:

``boards/arm/efm32pg_stk3402a/efm32pg_stk3402a_defconfig_jg``

Expand All @@ -80,64 +79,60 @@ Other hardware features are currently not supported by the port.
EFM32 Jade Gecko SoC
--------------------

The EFM32 Pearl Gecko Starter Kit EFM32PG-STK3402A can also be used to
evaluate the EFM32 Jade Gecko SoC (EFM32JG12B). The only difference
between the Pearl Gecko and the Jade Gecko is their core. The Pearl
Gecko contains an ARM® Cortex®-M4F core, and the Jade Gecko an ARM®
Cortex®-M3 core. Other features such as memory and peripherals are the
same.
The EFM32 Pearl Gecko Starter Kit EFM32PG-STK3402A can also be used to evaluate
the EFM32 Jade Gecko SoC (EFM32JG12B). The only difference between the Pearl
Gecko and the Jade Gecko is their core. The Pearl Gecko contains an ARM®
Cortex®-M4F core, and the Jade Gecko an ARM® Cortex®-M3 core. Other features
such as memory and peripherals are the same.

Code that is built for the Jade Gecko also runs on an equivalent Pearl
Gecko.
Code that is built for the Jade Gecko also runs on an equivalent Pearl Gecko.

To build firmware for the Jade Gecko and run it on the EFM32 Pearl Gecko
Starter Kit, use the board ``efm32pg_stk3402a_jg`` instead of
``efm32pg_stk3402a``.
To build firmware for the Jade Gecko and run it on the EFM32 Pearl Gecko Starter
Kit, use the board ``efm32pg_stk3402a_jg`` instead of ``efm32pg_stk3402a``.

Connections and IOs
===================

The EFM32PG12 SoC has twelve GPIO controllers (PORTA to PORTL), but only
four are currently enabled (PORTA, PORTB, PORTD and PORTF) for the
EFM32PG-STK3402A board.

In the following table, the column **Name** contains pin names. For
example, PE2 means pin number 2 on PORTE, as used in the board's
datasheets and manuals.

+-------+-----+-------------+-------------------------------------+
| Name | LOC | Function | Usage |
+=======+=====+=============+=====================================+
| PF4 | | GPIO | LED0 |
+-------+-----+-------------+-------------------------------------+
| PF5 | | GPIO | LED1 |
+-------+-----+-------------+-------------------------------------+
| PF6 | | GPIO | Push Button PB0 |
+-------+-----+-------------+-------------------------------------+
| PF7 | | GPIO | Push Button PB1 |
+-------+-----+-------------+-------------------------------------+
| PA5 | | GPIO | Board Controller Enable |
| | | | EFM_BC_EN / VCOM_ENABLE |
+-------+-----+-------------+-------------------------------------+
| PA0 | 0 | UART_TX | UART TX Console VCOM_TX US0_TX |
+-------+-----+-------------+-------------------------------------+
| PA1 | 0 | UART_RX | UART RX Console VCOM_RX US0_RX |
+-------+-----+-------------+-------------------------------------+
| PD10 | 18 | UART_TX | EXP12_UART_TX LEU0_TX |
+-------+-----+-------------+-------------------------------------+
| PD11 | 18 | UART_RX | EXP14_UART_RX LEU0_RX |
+-------+-----+-------------+-------------------------------------+
| PC10 | 15 | I2C_SDA | ENV_I2C_SDA I2C0_SDA |
+-------+-----+-------------+-------------------------------------+
| PC11 | 15 | I2C_SCL | ENV_I2C_SCL I2C0_SCL |
+-------+-----+-------------+-------------------------------------+
The EFM32PG12 SoC has twelve GPIO controllers (PORTA to PORTL), but only four
are currently enabled (PORTA, PORTB, PORTD and PORTF) for the EFM32PG-STK3402A
board.

In the following table, the column **Name** contains pin names. For example, PE2
means pin number 2 on PORTE, as used in the board's datasheets and manuals.

+-------+-------------+-------------------------------------+
| Name | Function | Usage |
+=======+=============+=====================================+
| PF4 | GPIO | LED0 |
+-------+-------------+-------------------------------------+
| PF5 | GPIO | LED1 |
+-------+-------------+-------------------------------------+
| PF6 | GPIO | Push Button PB0 |
+-------+-------------+-------------------------------------+
| PF7 | GPIO | Push Button PB1 |
+-------+-------------+-------------------------------------+
| PA5 | GPIO | Board Controller Enable |
| | | EFM_BC_EN |
+-------+-------------+-------------------------------------+
| PA0 | UART_TX | UART TX Console VCOM_TX US0_TX #0 |
+-------+-------------+-------------------------------------+
| PA1 | UART_RX | UART RX Console VCOM_RX US0_RX #0 |
+-------+-------------+-------------------------------------+
| PD10 | UART_TX | EXP12_UART_TX LEU0_TX #18 |
+-------+-------------+-------------------------------------+
| PD11 | UART_RX | EXP14_UART_RX LEU0_RX #18 |
+-------+-------------+-------------------------------------+
| PC10 | I2C_SDA | ENV_I2C_SDA I2C0_SDA #15 |
+-------+-------------+-------------------------------------+
| PC11 | I2C_SCL | ENV_I2C_SCL I2C0_SCL #15 |
+-------+-------------+-------------------------------------+


System Clock
============

The EFM32PG SoC is configured to use the 40 MHz external oscillator on
the board.
The EFM32PG SoC is configured to use the 40 MHz external oscillator on the
board.

Serial Port
===========
Expand All @@ -148,27 +143,25 @@ Programming and Debugging
*************************

.. note::
Before using the kit the first time, you should update the J-Link
firmware from `J-Link-Downloads`_
Before using the kit the first time, you should update the J-Link firmware
from `J-Link-Downloads`_

Flashing
========

The EFM32PG-STK3402A includes an `J-Link`_ serial and
debug adaptor built into the board. The adaptor provides:
The EFM32PG-STK3402A includes an `J-Link`_ serial and debug adaptor built into the
board. The adaptor provides:

- A USB connection to the host computer, which exposes a mass storage
device and a USB serial port.
- A serial flash device, which implements the USB flash disk file
storage.
- A physical UART connection which is relayed over interface USB serial
port.
- A USB connection to the host computer, which exposes a mass storage device and a
USB serial port.
- A serial flash device, which implements the USB flash disk file storage.
- A physical UART connection which is relayed over interface USB serial port.

Flashing an application to EFM32PG-STK3402A
-------------------------------------------

The sample application :ref:`hello_world` is used for this example. Build the
Zephyr kernel and application:
The sample application :ref:`hello_world` is used for this example.
Build the Zephyr kernel and application:

.. zephyr-app-commands::
:zephyr-app: samples/hello_world
Expand All @@ -179,97 +172,23 @@ Connect the EFM32PG-STK3402A to your host computer using the USB port and you
should see a USB connection which exposes a mass storage device(STK3402A).
Copy the generated zephyr.bin to the STK3402A drive.

Use a USB-to-UART converter such as an FT232/CP2102 to connect to the
UART on the expansion header.
Use a USB-to-UART converter such as an FT232/CP2102 to connect to the UART on the
expansion header.

Open a serial terminal (minicom, putty, etc.) with the following
settings:
Open a serial terminal (minicom, putty, etc.) with the following settings:

- Speed: 115200
- Data: 8 bits
- Parity: None
- Stop bits: 1

Reset the board and you'll see the following message on the
corresponding serial port terminal session:
Reset the board and you'll see the following message on the corresponding serial port
terminal session:

.. code-block:: console

Hello World! arm

Twister Testing on EFM32PG-STK3402A
===================================

A very simple test on the GPIO functionality can be found at:

``tests/drivers/gpio/gpio_basic_api``

The Twister tests can be run from the boards folder as follows:

.. code-block:: console

../../../../zephyr/scripts/twister --device-testing \
--hardware-map efm32pg_stk3402a-map.yml \
--load-tests efm32pg_stk3402a-testplan.json

Documenting the EFM32PG-STK3402A
********************************

The Zephyr documentation is based upon
`reStructuredText <http://sphinx-doc.org/rest.html>`__,
and `Sphinx <http://sphinx-doc.org/>`__, which are text based tools
that have limited facilities for `WYSIWYG (pronounced wiz-ee-wig) what you see is what you get:
<https://www.techtarget.com/whatis/definition/WYSIWYG-what-you-see-is-what-you-get>`__.

However, there are work arounds that can help you convert from
various other tools to **rst** files. While this is not Pearl Gecko
specific, it is included here, along with the changes above, as a
convenience, until we push upstream. Then a more appropriate location
can be found.

I have a preference for
`rich text editors <https://froala.com/blog/editor/a-beginners-guide-to-rich-text-editors/>`__\ ”
and a promoter of
`Literate Programming <https://en.wikipedia.org/wiki/Literate_programming>`__,
but I’m using Microsoft’s Word to edit this text. I started from the
original **rst** file and used `Pandoc <https://pandoc.org/>`__
to convert to **docx**.

.. code-block:: console

pandoc -f rst -t docx \
"//wsl.localhost/Ubuntu-20.04/<path>/zephyrproject/zephyr/boards/arm/efm32pg_stk3402a/doc/index.rst" \
-o gp_stk.docx**

Note that your paths may vary but mine show the variability of the
systems that can be used. The **wsl** indicates that I’m using
`WSL2 <https://docs.microsoft.com/en-us/windows/wsl/about>`__ on
`WIN11 <https://en.wikipedia.org/wiki/Windows_11>`__ to build the
`**html** <https://docs.zephyrproject.org/latest/contribute/documentation/generation.html>`__
documentation. That is the version where board documentation is
generated, rather than the
`**pdf** <https://docs.zephyrproject.org/latest/contribute/documentation/generation.html>`__
version.

There may be a need to post the generated documentation internally, or
integrate some pages into something like
`Confluence <https://www.atlassian.com/software/confluence>`__, which we
do and why I chose this path. Word provides that path but you don't need
to save a **doc** version, rather than a **docx**. Simply create a page
and **Publish** it. Then hit the **…** to the right of the Edit button and
choose **Import Word Document**. There will likely be some minor edits you
need to make, but the content should be close.

If you already have a **Confluence** page, then in that same **…** menu you
can use the **Export to Word** menu item. That will create a **doc** file
that Word can convert to a **docx** file before using **Pandoc** to convert
it to **rst** format by reversing the names used above. Again, you will need
to make edits to comply with the Zephyr specific macros, but the content
(other than images) should mostly be there. If the **rst** file was constructed
by hand, then **Pandoc** may make other choices for line and column widths.
For small edits, doing it directly in the **rst** file is most efficient, but
if you have a lot of content, this method may be useful.


.. _EFM32PG-STK3402A Website:
https://www.silabs.com/products/development-tools/mcu/32-bit/efm32-pearl-gecko-pg12-starter-kit
Expand Down
30 changes: 0 additions & 30 deletions boards/arm/efm32pg_stk3402a/efm32pg_stk3402a-pinctrl.dtsi

This file was deleted.

5 changes: 0 additions & 5 deletions boards/arm/efm32pg_stk3402a/efm32pg_stk3402a.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Copyright (c) 2022 T-Mobile USA, Inc.
#
# SPDX-License-Identifier: Apache-2.0

identifier: efm32pg_stk3402a
name: EFM32PG-STK3402A
type: mcu
Expand All @@ -17,7 +13,6 @@ supported:
- gpio
- nvs
- watchdog
- counter
testing:
ignore_tags:
- net
Expand Down
Loading