Skip to content

boards/am67/t3-gem-o1: Add support for T3 Gemstone O1 board#17229

Open
ghost wants to merge 5 commits intoapache:masterfrom
t3gemstone:pr-t3-gem-o1-board
Open

boards/am67/t3-gem-o1: Add support for T3 Gemstone O1 board#17229
ghost wants to merge 5 commits intoapache:masterfrom
t3gemstone:pr-t3-gem-o1-board

Conversation

@ghost
Copy link

@ghost ghost commented Oct 22, 2025

Summary

This PR introduces basic support for the T3 Gemstone O1 (t3-gem-o1)
development board, including board configuration, linker scripts, and
drivers for NSH. Currently only UART console is supported.
All necessary files and configurations are added to enable building and
running NuttX on this TI AM67-based board.

For more information about the board:

Impact

Add support for TI AM67 chip.

Add new TI AM67-based board named t3-gem-o1.

Provide defconfigs:

  • nsh

Testing

Tested on host: Ubuntu 24.04 noble, with arm-none-eabi-gcc (15:13.2.rel1-2) 13.2.1 20231009 toolchain.

Board: t3-gem-o1

nsh

Configure and build:

./tools/configure.sh -E -l t3-gem-o1:nshmake -s -j$(nproc)

Open NuttShell on UART-MAIN1:

picocom -b 115200 /dev/ttyACM0

NuttShell (NSH) NuttX-12.11.0
nsh> cat proc/version
NuttX version 12.11.0 8bdbb8c7d5-dirty Oct 22 2025 14:15:42 t3-gem-o1:nsh
nsh> help
help usage:  help [-v] [<cmd>]

  .           cmp         fdinfo      mount       rptun       unset
  [           dirname     free        mv          set         uptime
  ?           df          help        pidof       sleep       usleep
  alias       dmesg       hexdump     printf      source      watch
  unalias     echo        kill        ps          test        xd
  basename    env         pkill       pwd         time
  break       exec        ln          readlink    true
  cat         exit        ls          rm          truncate
  cd          expr        mkdir       rmdir       uname
  cp          false       mkrd        rpmsg       umount

Builtin Apps:
  dd        nsh       ostest    sh
nsh>

@github-actions github-actions bot added Area: Documentation Improvements or additions to documentation Arch: arm Issues related to ARM (32-bit) architecture Board: arm Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. labels Oct 22, 2025
Copy link
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

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

Thanks for this awesome port!

  1. I see this has ARM64 cores and R5F cores, and this is just support for the R5F cores. I suppose that's why it lives under arch/arm instead of arch/arm64. Have you considered getting NuttX to run on the A53 cores (that's already supported on other boards)? I wonder what the approach would be for that scenario, two different NuttX images on a per-core-type basis? Just curious, nothing to do with this PR.

  2. For your documentation, could you tweak it a little bit to follow the format from the standard board documentation template? It can be found in Documentation/contributing/doc_templates/board.rst. Your docs look pretty close to it right now, but could have information about how to flash it, some information about what the naming is for configuring your board (i.e. what is the board name for tools/configure.sh to find), an image, etc. Also, I would mark this board as experimental in the tags section, since it has very minimal support right now. Also, a warning about which peripherals are supported only would be good:

.. tags:: chip:am67, experimental

.. warning::
   
   This board currently only supports a basic implementation of NuttX with
   only UART console as a supported peripheral. Please see the contributing
   documentation if you would like to help contribute to the support.

Copy link
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

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

Please add support for the CMake build system as well.

*
****************************************************************************/

static void utils_data_and_instruction_barrier(void)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there might be an architecture implementation for this for all ARM chips, you should re-use that instead. I think UP_DMB is for data memory, there is probably something similar for other barriers.

static inline void am67_mpu_disable_br(void)
{
unsigned int sctlr = cp15_rdsctlr();
sctlr &= ~(1 << 17); /* Clear bit 17 (disable background region) */
Copy link
Contributor

Choose a reason for hiding this comment

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

I would recommend that you give these special bits a name in your register mapping definition file, it makes the code much easier to read.

Ex:

#define AM67_SCTLR_BG_REGION_EN (1 << 17)

/* later in your function */
sctlr &= ~AM67_SCTLR_BG_REGION_EN;

Also, this would be a good place to use modreg32 instead of the cp15_wrsctlr/cp16_rdsctlr functions.

*
****************************************************************************/

int up_timer_gettime(struct timespec *ts)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not incredibly familiar with the up_timer_* functions, but I don't think your implementation matches the requirements at all?

This function should return 0 on success, negated errno on failure. Your implementation returns the contents of some timer register. The timespec argument is unused, but it must contain the up-time you pull from the timer.

I would also suggest adding a DEBUGASSERT(ts != NULL).

Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto for the remaining timer functions, make sure you adhere to the function specification.

@ghost
Copy link
Author

ghost commented Oct 23, 2025

@linguini1

I see this has ARM64 cores and R5F cores, and this is just support for the R5F cores. I suppose that's why it lives under arch/arm instead of arch/arm64. Have you considered getting NuttX to run on the A53 cores (that's already supported on other boards)? I wonder what the approach would be for that scenario, two different NuttX images on a per-core-type basis? Just curious, nothing to do with this PR.

Real‑Time Linux is deployed on the four Cortex‑A53 cores. Those cores provide the high‑performance compute power needed for demanding workloads such as image‑processing pipelines, vision algorithms, and other application‑level tasks.

For safety‑critical functions—e.g., the autopilot control loop—we are planning on running NuttX on the dedicated Cortex‑R5F cores. The R5F cores are purpose‑built for deterministic, low‑latency execution, which makes them ideal for hard real‑time control code.

Communication between the two domains will be performed through the RPMsg framework. RPMsg provides a lightweight, message‑based inter‑processor communication (IPC) channel that lets the Linux side exchange data with the NuttX side while preserving isolation and real‑time guarantees.

@ghost ghost changed the title Add support for T3 Gemstone O1 board boards/arm/am67: Add support for T3 Gemstone O1 board Oct 24, 2025
@ghost ghost changed the title boards/arm/am67: Add support for T3 Gemstone O1 board boards/am67/t3-gem-o1: Add support for T3 Gemstone O1 board Oct 24, 2025
@xiaoxiang781216
Copy link
Contributor

@erkan-vatan please squash patch 4 to patch 3 and patch 5 to patch 2.

@ghost ghost force-pushed the pr-t3-gem-o1-board branch from 3eb2972 to 0ecaf44 Compare October 24, 2025 12:09
@simbit18
Copy link
Contributor

simbit18 commented Oct 24, 2025

@erkan-vatan
signature (git commit -s)

ff7c556d60 Merge 0ecaf44ac8a5086d025b9007aa07f31fbf96a772 into b2e823d0b981b10540acc8d1902b5adba4750357
0ecaf44ac8 docs/boards: Add documentation for t3-gem-o1 board.
c29a526de3 boards/arm/am67: Add support for t3-gem-o1 board.
0164001944 arch/arm/am67: Add support for TI AM67 chips.
../nuttx/tools/checkpatch.sh -c -u -m -g b2e823d0b981b10540acc8d1902b5adba4750357..HEAD
Missing Signed-off-by
Missing Signed-off-by
Missing Signed-off-by

https://github.com/apache/nuttx/actions/runs/18779303663/job/53582075265?pr=17229#logs

@ghost ghost force-pushed the pr-t3-gem-o1-board branch from 0ecaf44 to 299d4e0 Compare October 24, 2025 12:28
acassis
acassis previously approved these changes Oct 24, 2025
@ghost
Copy link
Author

ghost commented Oct 24, 2025

@linguini1
I ran into an issue while adding CMake build‑system support. In my .vectors section, _vector_start resides at address 0x0, whereas __start is placed at 0x40. My hardware requires execution to begin at _vector_start, but the linker keeps using __start as the default entry point regardless of my attempts to change it. With a Makefile‑based build I was able to fix the problem by defining:

LDFLAGS += --entry=_vector_start

inside arch/arm/src/am67/Make.defs file. I’m not sure if this is the proper solution, but I couldn’t locate any alternative method. Declaring ENTRY(_vector_start) in the linker script has no effect. How can I replicate this behavior inside the CMakeLists.txt?

@linguini1
Copy link
Contributor

@simbit18 any ideas?

@ghost ghost force-pushed the pr-t3-gem-o1-board branch from 299d4e0 to 9a28c92 Compare October 25, 2025 09:25
@ghost ghost requested review from GUIDINGLI and davids5 as code owners October 25, 2025 09:25
@ghost ghost force-pushed the pr-t3-gem-o1-board branch from 9a28c92 to 34af2ae Compare October 25, 2025 09:56
@ghost ghost requested a review from simbit18 as a code owner October 25, 2025 09:56
@ghost ghost force-pushed the pr-t3-gem-o1-board branch from 34af2ae to ec9aca1 Compare October 25, 2025 10:00
@ghost
Copy link
Author

ghost commented Oct 25, 2025

@linguini1
I added CMake build‑system support. To resolve the problem, I defined the link option directly in arch/arm/src/am67/CMakeLists.txt:

target_link_options(nuttx PRIVATE -Wl,--entry=_vector_start)

@ghost ghost force-pushed the pr-t3-gem-o1-board branch from ec9aca1 to c0eedfe Compare October 25, 2025 11:55
acassis
acassis previously approved these changes Oct 25, 2025
@simbit18
Copy link
Contributor

simbit18 commented Oct 26, 2025

@erkan-vatan The chip supports MPU, so why isn't it enabled in the configuration (defconfig) ?

In this case, it might be better to proceed as follows:

if(CONFIG_ARM_MPU OR CONFIG_BUILD_PROTECTED)
      list(APPEND SRCS arm_mpu.c)
  endif()

https://github.com/t3gemstone/nuttx/blob/c0eedfef556bc709229b6624d3612f62c6ccee65/arch/arm/src/armv7-r/CMakeLists.txt#L58

  • add in the arch/arm/src/armv7-r/Make.defs

    ifneq ($(filter y,$(CONFIG_ARM_MPU) $(CONFIG_BUILD_PROTECTED)),)
       CMN_CSRCS += arm_mpu.c
    endif
    

https://github.com/t3gemstone/nuttx/blob/c0eedfef556bc709229b6624d3612f62c6ccee65/arch/arm/src/armv7-r/Make.defs#L49C1-L51C6

  • remove this in the arch/arm/src/am67/CMakeLists.tx

    ../${ARCH_SUBDIR}/arm_mpu.c
    

https://github.com/t3gemstone/nuttx/blob/c0eedfef556bc709229b6624d3612f62c6ccee65/arch/arm/src/am67/CMakeLists.txt#L30

  • remove this in the arch/arm/src/am67/Make.defs

    CHIP_CSRCS += arm_mpu.c
    

https://github.com/t3gemstone/nuttx/blob/c0eedfef556bc709229b6624d3612f62c6ccee65/arch/arm/src/am67/Make.defs#L33C1-L33C24

@AbduNaber
Copy link

AbduNaber commented Oct 27, 2025

@simbit18 When the MPU was enabled in the configuration, the build inserted the MPU enable routine at the very beginning of the program, preventing execution from reaching that line (https://github.com/t3gemstone/nuttx/blob/c0eedfef556bc709229b6624d3612f62c6ccee65/arch/arm/src/am67/am67_mpuinit.c#L67 ) . Since we couldn't disable the MPU once it was already enabled, we had to disable it in the configuration first to adjust the settings. After configuring it properly, we re enable the MPU later in the flow. I know this is a bit of a shortcut. Is it okay or do you have any suggestion ?

@simbit18
Copy link
Contributor

@AbduNaber Ok, but the change I described above only affects the Make and CMake build. Have you tried it?
I ran a test locally and the build is fine.
Of course, I can't test it on a board.

Erkan Vatan and others added 5 commits January 10, 2026 12:40
The previous use of `%u` and `%X` for `uint32_t` values triggered
compiler warnings. These have been replaced with the appropriate
format‑specifier macros to ensure type‑correctness and eliminate the
warnings.

Signed-off-by: Erkan Vatan <evatan@t3gemstone.org>
Previously, arm_mpu.c was only compiled when CONFIG_BUILD_PROTECTED
was enabled. This caused build failures when CONFIG_ARM_MPU was set
without CONFIG_BUILD_PROTECTED. The build logic has been updated to
include arm_mpu.c whenever either CONFIG_ARM_MPU or
CONFIG_BUILD_PROTECTED is enabled.

Signed-off-by: Erkan Vatan <evatan@t3gemstone.org>
This commit introduces basic support for running NuttX on
main domain R5F core of TI AM67 chips, including irq, mpu, pinmux,
timer, and serial configurations. Currently only UART console is
supported. NuttX can be loaded into R5F core from U-Boot or Linux
via RemoteProc.

Co-authored-by: Emre Cecanpunar <emreleno@gmail.com>
Co-authored-by: Abdullah Türkmen <abdullahturkmen@protonmail.com>
Co-authored-by: Muhammet Onur Bayraktar <mobayraktar@t3gemstone.org>
Co-authored-by: Bayram Akay <bakay@t3gemstone.org>
Signed-off-by: Erkan Vatan <evatan@t3gemstone.org>
This commit introduces basic support for the T3 Gemstone O1 (t3-gem-o1)
development board, including board configuration, linker scripts, and
drivers for NSH. Currently only UART console is supported.
All necessary files and configurations are added to enable building and
running NuttX on this TI AM67-based board.

Co-authored-by: Emre Cecanpunar <emreleno@gmail.com>
Co-authored-by: Abdullah Türkmen <abdullahturkmen@protonmail.com>
Co-authored-by: Muhammet Onur Bayraktar <mobayraktar@t3gemstone.org>
Co-authored-by: Bayram Akay <bakay@t3gemstone.org>
Signed-off-by: Erkan Vatan <evatan@t3gemstone.org>
Add documentation for the T3 Gemstone O1 (t3-gem-o1) development board,
including board specifications, serial console, available
configurations (nsh), and installation instructions via RemoteProc.

Signed-off-by: Erkan Vatan <evatan@t3gemstone.org>
@ghost ghost force-pushed the pr-t3-gem-o1-board branch from c0eedfe to 9599ad1 Compare January 10, 2026 12:26
@acassis
Copy link
Contributor

acassis commented Jan 15, 2026

@erkan-vatan could you please refresh your config to fix the CI error?

Basically:
$ ./tools/refresh.sh --silent t3-gem-o1:nsh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Area: Documentation Improvements or additions to documentation Board: arm Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants