Skip to content

Commit b2b7a46

Browse files
Ayush1325kartben
authored andcommitted
boards: beagle: Add PocketBeagle 2 M4 support
Add initial support for the PocketBeagle 2 MCU domain Cortex-M4F core. This only adds support for A0 revision (i.e. the version with AM6232). PocketBeagle 2: https://www.beagleboard.org/boards/pocketbeagle-2 Signed-off-by: Ayush Singh <[email protected]>
1 parent e443fbd commit b2b7a46

11 files changed

+274
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# BeagleBoard.org PocketBeagle 2
2+
#
3+
# Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
config BOARD_POCKETBEAGLE_2
8+
select SOC_AM6232_M4 if BOARD_POCKETBEAGLE_2_AM6232_M4
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# BeagleBoard.org PocketBeagle 2
2+
#
3+
# Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
if(CONFIG_SOC_AM6232_M4)
8+
board_runner_args(openocd "--no-init" "--no-halt" "--no-targets" "--gdb-client-port=3339")
9+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
10+
endif()
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
board:
2+
name: pocketbeagle_2
3+
full_name: PocketBeagle 2
4+
vendor: beagle
5+
socs:
6+
- name: am6232
7+
revision:
8+
format: custom
9+
exact: true
10+
default: "A0"
11+
revisions:
12+
- name: "A0"
Binary file not shown.
+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
.. zephyr:board:: pocketbeagle_2
2+
3+
Overview
4+
********
5+
6+
PocketBeagle 2 is a computational platform powered by TI AM62x SoC (there are two
7+
revisions, AM6232 and AM6254).
8+
9+
The board configuration provides support for the ARM Cortex-M4F MCU core.
10+
11+
See the `PocketBeagle 2 Product Page`_ for details.
12+
13+
Hardware
14+
********
15+
PocketBeagle 2 features the TI AM62x SoC based around an Arm Cortex-A53 multicore
16+
cluster with an Arm Cortex-M4F microcontroller, Imagination Technologies AXE-1-16
17+
graphics processor (from revision A1) and TI programmable real-time unit subsystem
18+
microcontroller cluster coprocessors.
19+
20+
Zephyr is ported to run on the M4F core and the following listed hardware
21+
specifications are used:
22+
23+
- Low-power ARM Cortex-M4F
24+
- Memory
25+
26+
- 256KB of SRAM
27+
- 512MB of DDR4
28+
29+
Currently supported PocketBeagle 2 revisions:
30+
31+
- A0: Comes wth SOC AM6232
32+
33+
Supported Features
34+
==================
35+
36+
.. zephyr:board-supported-hw::
37+
38+
Devices
39+
========
40+
System Clock
41+
------------
42+
43+
This board configuration uses a system clock frequency of 400 MHz.
44+
45+
DDR RAM
46+
-------
47+
48+
The board has 512MB of DDR RAM available. This board configuration
49+
allocates Zephyr 4kB of RAM (only for resource table: 0x9CC00000 to 0x9CC00400).
50+
51+
Serial Port
52+
-----------
53+
54+
This board configuration uses a single serial communication channel with the
55+
MCU domain UART (MCU_UART0, i.e. P2.05 as RX and P2.07 as TX).
56+
57+
SD Card
58+
*******
59+
60+
Download BeagleBoard.org's official `BeagleBoard Imaging Utility`_ to create bootable
61+
SD-card with the Linux distro image. This will boot Linux on the A53 application
62+
cores. These cores will then load the Zephyr binary on the M4 core using remoteproc.
63+
64+
Flashing
65+
********
66+
67+
The board supports remoteproc using the OpenAMP resource table.
68+
69+
The testing requires the binary to be copied to the SD card to allow the A53 cores to load it while booting using remoteproc.
70+
71+
To test the M4F core, we build the :zephyr:code-sample:`hello_world` sample with the following command.
72+
73+
.. zephyr-app-commands::
74+
:board: pocketbeagle_2/am6232/m4
75+
:zephyr-app: samples/hello_world
76+
:goals: build
77+
78+
This builds the program and the binary is present in the :file:`build/zephyr` directory as
79+
:file:`zephyr.elf`.
80+
81+
We now copy this binary onto the SD card in the :file:`/lib/firmware` directory and name it as
82+
:file:`am62-mcu-m4f0_0-fw`.
83+
84+
.. code-block:: console
85+
86+
# Mount the SD card at sdcard for example
87+
sudo mount /dev/sdX sdcard
88+
# copy the elf to the /lib/firmware directory
89+
sudo cp --remove-destination zephyr.elf sdcard/lib/firmware/am62-mcu-m4f0_0-fw
90+
91+
The SD card can now be used for booting. The binary will now be loaded onto the M4F core on boot.
92+
93+
The binary will run and print Hello world to the MCU_UART0 port.
94+
95+
Debugging
96+
*********
97+
98+
The board supports debugging M4 core from the A53 cores running Linux. Since the target needs
99+
superuser privilege, openocd needs to be launched seperately for now:
100+
101+
.. code-block:: console
102+
103+
sudo openocd -f board/ti_am625_swd_native.cfg
104+
105+
106+
Start debugging
107+
108+
.. zephyr-app-commands::
109+
:goals: debug
110+
111+
References
112+
**********
113+
114+
* `PocketBeagle 2 Product Page`_
115+
* `Documentation <https://docs.beagleboard.org/boards/pocketbeagle-2/index.html>`_
116+
117+
.. _PocketBeagle 2 Product Page:
118+
https://www.beagleboard.org/boards/pocketbeagle-2
119+
120+
.. _BeagleBoard Imaging Utility:
121+
https://github.com/beagleboard/bb-imager-rs/releases
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pinctrl/ti-k3-pinctrl.h>
8+
9+
&pinctrl {
10+
mcu_uart0_rx_default: mcu_uart0_rx_default {
11+
pinmux = <K3_PINMUX(0x0014, PIN_INPUT, MUX_MODE_0)>;
12+
};
13+
14+
mcu_uart0_tx_default: mcu_uart0_tx_default {
15+
pinmux = <K3_PINMUX(0x0018, PIN_OUTPUT, MUX_MODE_0)>;
16+
};
17+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <ti/am62x_m4.dtsi>
10+
#include "pocketbeagle_2_am6232_m4-pinctrl.dtsi"
11+
12+
/ {
13+
model = "BeagleBoard.org PocketBeagle 2";
14+
compatible = "beagle,pocketbeagle_2_m4";
15+
16+
chosen {
17+
zephyr,sram = &sram0;
18+
zephyr,console = &uart0;
19+
zephyr,shell-uart = &uart0;
20+
zephyr,ipc = &ipc0;
21+
zephyr,ipc_shm = &ddr0;
22+
zephyr,sram1 = &ddr1;
23+
};
24+
25+
cpus {
26+
cpu@0 {
27+
status = "okay";
28+
clock-frequency = <400000000>;
29+
};
30+
};
31+
32+
ddr0: memory@9cb00000 {
33+
compatible = "mmio-sram";
34+
reg = <0x9cb00000 DT_SIZE_M(1)>;
35+
};
36+
37+
rsc_table: memory@9cc00000 {
38+
compatible = "zephyr,memory-region", "mmio-sram";
39+
reg = <0x9cc00000 DT_SIZE_K(4)>;
40+
zephyr,memory-region = "RSC_TABLE";
41+
};
42+
43+
ddr1: memory@9cc01000 {
44+
compatible = "zephyr,memory-region", "mmio-sram";
45+
reg = <0x9cc01000 (DT_SIZE_M(15) - DT_SIZE_K(4))>;
46+
zephyr,memory-region = "DDR";
47+
};
48+
49+
ipc0: ipc {
50+
compatible = "zephyr,mbox-ipm";
51+
mboxes = <&mbox0 0>, <&mbox0 1>;
52+
mbox-names = "tx", "rx";
53+
};
54+
};
55+
56+
&uart0 {
57+
current-speed = <115200>;
58+
pinctrl-0 = <&mcu_uart0_rx_default &mcu_uart0_tx_default>;
59+
pinctrl-names = "default";
60+
status = "okay";
61+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
identifier: pocketbeagle_2/am6232/m4
2+
name: BeagleBoard.org PocketBeagle 2
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
ram: 192
8+
vendor: beagle
9+
supported:
10+
- uart
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# BeagleBoard.org PocketBeagle 2
2+
#
3+
# Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
# Platform Configuration
8+
CONFIG_CORTEX_M_SYSTICK=y
9+
10+
# Zephyr Kernel Configuration
11+
CONFIG_XIP=n
12+
13+
# Serial Driver
14+
CONFIG_SERIAL=y
15+
16+
# Enable Console
17+
CONFIG_CONSOLE=y
18+
CONFIG_UART_CONSOLE=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
set(BOARD_REVISIONS "A0")
2+
3+
# If BOARD_REVISION not set, use the default revision
4+
if(NOT DEFINED BOARD_REVISION)
5+
set(BOARD_REVISION ${LIST_BOARD_REVISION_DEFAULT})
6+
endif()
7+
8+
if(NOT BOARD_REVISION IN_LIST BOARD_REVISIONS)
9+
message(FATAL_ERROR "${BOARD_REVISION} is not a valid revision for PocketBeagle 2. Accepted revisions: ${BOARD_REVISIONS}")
10+
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# BeagleBoard.org PocketBeagle 2
2+
#
3+
# Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
source [find board/ti_am625_swd_native.cfg]

0 commit comments

Comments
 (0)