Skip to content

Commit 9a0375a

Browse files
boards: ti: lp_am243x: initial support
Add support for the TI AM243x LaunchPad board. This board is based on the work done for the am243x_evm board, with modifications to the device tree and board configuration files to suit the LaunchPad's hardware. Signed-off-by: Spencer J. Coward <[email protected]>
1 parent bd8597c commit 9a0375a

14 files changed

+680
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Texas Instruments Sitara AM243x LaunchPad
2+
#
3+
# Copyright (c) 2025 Texas Instruments Incorporated
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
config BOARD_LP_AM243X
8+
select SOC_AM2434_M4 if BOARD_LP_AM243X_AM2434_M4
9+
select SOC_AM2434_R5F0_0 if BOARD_LP_AM243X_AM2434_R5F0_0

boards/ti/lp_am243x/board.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2025 Texas Instruments Incorporated
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
if(CONFIG_SOC_AM2434_M4)
6+
board_runner_args(openocd "--no-init" "--no-halt" "--no-targets" "--gdb-client-port=3338")
7+
elseif(CONFIG_SOC_AM2434_R5F0_0)
8+
board_runner_args(openocd "--no-init" "--no-halt" "--no-targets" "--gdb-client-port=3334")
9+
endif()
10+
11+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

boards/ti/lp_am243x/board.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: lp_am243x
3+
full_name: AM243x LaunchPad
4+
vendor: ti
5+
socs:
6+
- name: am2434
105 KB
Loading

boards/ti/lp_am243x/doc/index.rst

Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
.. zephyr:board:: lp_am243x
2+
3+
Overview
4+
********
5+
6+
The AM243x LaunchPad is a development board that is based of a AM2434 SoC. The
7+
Cortex R5F cores in the SoC run at 800 MHz. The board also includes a flash
8+
region, DIP-Switches for the boot mode selection and 2 RJ45 Ethernet ports.
9+
10+
See the `TI LP-AM243 Product Page`_ for details.
11+
12+
Hardware
13+
********
14+
15+
The AM2434 SoC has 2 domains. A MAIN domain and a MCU domain. The MAIN domain
16+
consists of 4 R5F cores and the MCU domain of one M4F core.
17+
18+
Zephyr currently supports the following cores:
19+
20+
- R5F Subsystem 0 Core 0 (R5F0_0)
21+
- M4F Core (M4)
22+
23+
The board physically contains:
24+
25+
- Memory.
26+
27+
- 256KB of SRAM
28+
29+
- Debug
30+
31+
- XDS110 based JTAG
32+
33+
Devices
34+
========
35+
System Clock
36+
------------
37+
38+
This board configuration uses a system clock frequency of
39+
40+
- 800MHz for R5F0_0
41+
- 400MHz for M4
42+
43+
DDR RAM
44+
-------
45+
46+
The board has 2GB of DDR RAM available. This board configuration allocates:
47+
48+
- 4KB Resource Table at 0xa4100000 for M4
49+
- 4KB Resource Table at 0xa0100000 for R5F0_0
50+
- 8MB Shared Memory at 0xa5000000 for inter-processor communication
51+
52+
Serial Port
53+
-----------
54+
55+
This board configuration uses by default:
56+
57+
- MAIN domain UART (UART0) for R5F0_0
58+
- MCU domain UART (MCU_UART0) for M4
59+
60+
Supported Features
61+
==================
62+
63+
.. zephyr:board-supported-hw::
64+
65+
66+
Flashing
67+
********
68+
The boot process of the AM2434 SoC requires the booting image to be in a
69+
specific format and to wait for the internal DMSC-L of the AM2434 to start up
70+
and configure memory firewalls. Since there exists no Zephyr support it's
71+
required to use one of the SBL bootloader examples from the TI MCU+ SDK.
72+
73+
74+
Prerequisites
75+
=============
76+
77+
The following steps are from the time this documentation was written and might
78+
change in the future. They also target Linux with assumption some basic things
79+
(like python3 and openssl) are installed.
80+
81+
You might also want to take a look at the `Bootflow Guide`_ for more details.
82+
83+
To build these you need to install the TI MCU+ SDK. To do this you need to
84+
follow the steps described in the ``mcupsdk-core`` repository, which includes
85+
cloning the repositories with west. It's recommended to use another Python venv
86+
for this since the MCU+ SDK has own Python dependencies that could conflict with
87+
Zephyr dependencies. You can replace ``all/dev.yml`` in the ``west init``
88+
command with ``am243x/dev.yml``, if you want to clone a few less repositories.
89+
90+
You also need to follow the "Downloading And Installing Dependencies" section
91+
but you need to replace all ``am263x`` occurences in commands with ``am243x``.
92+
Please also take note of the ``tools`` and ``mcu_plus_sdk`` install path. The
93+
``tools`` install path will later be referred to as ``$TI_TOOLS`` and the MCU+
94+
SDK path as ``$MCUPSDK``. You can pass ``--skip_doxygen=true`` and
95+
``--skip_ccs=true`` to the install script since they aren't needed. You might
96+
encounter a error that a script can't be executed. To fix it you need to mark it
97+
as executable with ``chmod +x <path>`` and run the ``download_components.sh``
98+
again.
99+
100+
Summarized you will most likely want to run the following commands or similar
101+
versions for setting up the MCU+ SDK:
102+
103+
.. code-block:: console
104+
105+
python3 -m venv .venv
106+
source .venv/bin/activate
107+
pip3 install west
108+
west init -m https://github.com/TexasInstruments/mcupsdk-manifests.git --mr mcupsdk_west --mf am243x/dev.yml
109+
west update
110+
./mcupsdk_setup/am243x/download_components.sh --skip_doxygen=true --skip_ccs=true
111+
112+
After the script finished successfully you want to switch into the
113+
``mcu_plus_sdk`` directory and edit the
114+
``source/drivers/bootloader/bootloader.c`` file to set the ``entryPoint`` to
115+
``0`` inside ``Bootloader_runCpu`` unconditionally. This is needed due to how
116+
Zephyr builds the image currently.
117+
118+
Now you can build the internal libraries with the following commands:
119+
120+
.. code-block:: console
121+
122+
make gen-buildfiles DEVICE=am243x PROFILE=release
123+
make libs DEVICE=am243x PROFILE=release
124+
125+
If you encounter compile errors you have to fix them. For that you might have to
126+
change parameter types, remove missing source files from makefiles or download
127+
missing headers from the TI online reference.
128+
129+
Depending on whether you later want to boot from flash or by loading the image
130+
via UART either the ``sbl_ospi`` or the ``sbl_uart`` example is relevant for the
131+
next section.
132+
133+
134+
Building the bootloader itself
135+
==============================
136+
137+
The example bootloader implementation is found in the
138+
``examples/drivers/boot/<example>/am243x-lp/r5fss0-0_nortos`` directory.
139+
140+
You can either build the example by invoking ``make -C
141+
examples/drivers/boot/<example>/am243x-lp/r5fss0-0_nortos/ti-arm-clang/
142+
DEVICE=am243x PROFILE=release`` or use the prebuilt binaries in
143+
``tools/boot/sbl_prebuilt/am243x-lp``
144+
145+
146+
Converting the Zephyr application
147+
=================================
148+
149+
Additionally for booting you need to convert your built Zephyr binary into a
150+
format that the TI example bootloader can boot. You can do this with the
151+
following commands, where ``$TI_TOOLS`` refers to the root of where your
152+
ti-tools (clang, sysconfig etc.) are installed (``$HOME/ti`` by default) and
153+
``$MCUPSDK`` to the root of the MCU+ SDK (directory called ``mcu_plus_sdk``).
154+
You might have to change version numbers in the commands. It's expected that the
155+
``zephyr.elf`` from the build output is in the current directory.
156+
157+
.. code-block:: bash
158+
159+
export BOOTIMAGE_CORE_ID_r5fss0-0=4
160+
export BOOTIMAGE_CORE_ID_m4=14
161+
# set CORE_ID as per your target core
162+
export BOOTIMAGE_CORE_ID=${BOOTIMAGE_CORE_ID_desired-core}
163+
$TI_TOOLS/sysconfig_1.21.2/nodejs/node $MCUPSDK/tools/boot/out2rprc/elf2rprc.js ./zephyr.elf
164+
$MCUPSDK/tools/boot/xipGen/xipGen.out -i ./zephyr.rprc -o ./zephyr.rprc_out -x ./zephyr.rprc_out_xip --flash-start-addr 0x60000000
165+
$TI_TOOLS/sysconfig_1.21.2/nodejs/node $MCUPSDK/tools/boot/multicoreImageGen/multicoreImageGen.js --devID 55 --out ./zephyr.appimage ./zephyr.rprc_out@${BOOTIMAGE_CORE_ID}
166+
$TI_TOOLS/sysconfig_1.21.2/nodejs/node $MCUPSDK/tools/boot/multicoreImageGen/multicoreImageGen.js --devID 55 --out ./zephyr.appimage_xip ./zephyr.rprc_out_xip@${BOOTIMAGE_CORE_ID}
167+
python3 $MCUPSDK/source/security/security_common/tools/boot/signing/appimage_x509_cert_gen.py --bin ./zephyr.appimage --authtype 1 --key $MCUPSDK/source/security/security_common/tools/boot/signing/app_degenerateKey.pem --output ./zephyr.appimage.hs_fs
168+
169+
All these steps are also present in various Makefiles in the ``examples/``
170+
directory of MCU+ SDK source.
171+
172+
173+
Running the Zephyr image
174+
========================
175+
176+
After that you want to switch the bootmode to UART by switching the DIP-Switches
177+
into the following configuration:
178+
179+
.. list-table:: UART Boot Mode
180+
:header-rows: 1
181+
182+
* - SW2 [1:7]
183+
* - 1110000
184+
185+
If you want to just run the image via UART you need to run
186+
187+
.. code-block:: console
188+
189+
python3 uart_bootloader.py -p /dev/ttyUSB0 --bootloader=sbl_uart.release.hs_fs.tiimage --file=zephyr.appimage.hs_fs
190+
191+
The ``uart_bootloader.py`` script is found in ``$MCUPSDK/tools/boot`` and the
192+
``sbl_uart.release.hs_fs.tiimage`` in
193+
``$MCUPSDK/tools/boot/sbl_prebuilt/am243x-lp``. After sending the image your
194+
Zephyr application will run after a 2 second long delay.
195+
196+
If you want to flash the image instead you have to take the OSPI example config
197+
file from the ``$MCUPSDK/tools/boot/sbl_prebuilt/am243x-lp`` directory and
198+
change the filepath according to your names. It should look approximately like:
199+
200+
.. code-block::
201+
202+
--flash-writer=sbl_uart_uniflash.release.hs_fs.tiimage
203+
--operation=flash-phy-tuning-data
204+
--file=sbl_prebuilt/am243x-lp/sbl_ospi.release.hs_fs.tiimage --operation=flash --flash-offset=0x0
205+
--file=zephyr.appimage.hs_fs --operation=flash --flash-offset=0x80000
206+
--file=zephyr.appimage_xip --operation=flash-xip
207+
208+
You then need to run ``python3 uart_uniflash.py -p /dev/ttyUSB0
209+
--cfg=<path/to/your-config-file>``. The scripts and images are in the same path
210+
as described in the UART section above.
211+
212+
After flashing your image you can power off your board, switch the DIP-Switches
213+
into following configuration to boot in OSPI mode and your Zephyr application
214+
will boot immediately after powering on the board.
215+
216+
.. list-table:: OSPI Boot Mode
217+
:header-rows: 1
218+
219+
* - SW2 [1:7]
220+
* - 0100010
221+
222+
Debugging
223+
*********
224+
225+
OpenOCD
226+
=======
227+
228+
The board is equipped with an XDS110 JTAG debugger. To debug a binary, utilize
229+
the ``debug`` build target:
230+
231+
.. zephyr-app-commands::
232+
:app: <my_app>
233+
:board: lp_am243x/<soc>/<core>
234+
:maybe-skip-config:
235+
:goals: debug
236+
237+
.. hint::
238+
To utilize this feature, you'll need OpenOCD version 0.12 or higher. Due to the possibility of
239+
older versions being available in package feeds, it's advisable to `build OpenOCD from source`_.
240+
241+
Code Composer Studio
242+
====================
243+
244+
Instead of using ``sbl_ospi`` from above, one may also flash ``sbl_null`` and load the
245+
application ELFs using Code Composer Studio IDE to individual cores and run/debug
246+
the application. Note that this does not require converting the Zephyr ELF to another
247+
forma, making development much easier.
248+
249+
250+
References
251+
**********
252+
253+
AM64x/AM243x EVM Technical Reference Manual:
254+
https://www.ti.com/lit/ug/spruj63a/spruj63a.pdf
255+
256+
MCU+ SDK Github repository:
257+
https://github.com/TexasInstruments/mcupsdk-core
258+
259+
.. _Bootflow Guide:
260+
https://software-dl.ti.com/mcu-plus-sdk/esd/AM64X/latest/exports/docs/api_guide_am64x/BOOTFLOW_GUIDE.html
261+
262+
.. _TI LP-AM243 Product Page:
263+
https://www.ti.com/tool/LP-AM243
264+
265+
.. _build OpenOCD from source:
266+
https://docs.u-boot.org/en/latest/board/ti/k3.html#building-openocd-from-source
267+
268+
License
269+
*******
270+
271+
This document Copyright (c) Siemens Mobility GmbH
272+
273+
This document Copyright (c) 2025 Texas Instruments
274+
275+
SPDX-License-Identifier: Apache-2.0
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2025 Texas Instruments Incorporated
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pinctrl/ti-k3-pinctrl.h>
8+
9+
&mcu_pinctrl {
10+
status = "okay";
11+
12+
mcu_uart0_rx: mcu_uart0_rx_default {
13+
pinmux = <K3_PINMUX(0x028, PIN_INPUT, MUX_MODE_0)>;
14+
};
15+
16+
mcu_uart0_tx: mcu_uart0_tx_default {
17+
pinmux = <K3_PINMUX(0x02C, PIN_OUTPUT, MUX_MODE_0)>;
18+
};
19+
};
20+
21+
&pinctrl {
22+
status = "okay";
23+
24+
gpio0_led1: test_led1_green {
25+
pinmux = <K3_PINMUX(0x58, PIN_OUTPUT, MUX_MODE_7)>;
26+
};
27+
};

0 commit comments

Comments
 (0)