Skip to content

arch/rh850: add Renesas RH850 architecture and qemu-rh850-u2c board - #21456

Merged
xiaoxiang781216 merged 6 commits into
apache:masterfrom
linumiz:dev/rh850/upstream
Nov 19, 2026
Merged

xiaoxiang781216 merged 6 commits into
apache:masterfrom
linumiz:dev/rh850/upstream

Conversation

@ssekar15

@ssekar15 ssekar15 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

RH850 is Renesas' 32-bit automotive MCU family. This PR adds the RH850 architecture with the G4KH core, the RH850/U2C chip and a board for the QEMU rh850-u2c machine, so the port can be built and tested in CI before real boards follow. The chip covers what is needed to run NuttX: the interrupt controllers, the OSTM system timer (ticked or tickless), the RLIN3 UART console and software reset. The board has an nsh configuration.

The compiler.h change for the v850 user label prefix was merged in #21498. The toolchain and QEMU for the CI image are in #21497. The testlist entries for CI come in a later PR, once that image is published.

Toolchain: https://github.com/linumiz/rh850-gcc-toolchain/releases/tag/v1.2.0
QEMU: https://github.com/linumiz/qemu-rh850/releases/tag/rh850-v1.2.0

Impact

  • New architecture, chip and board; no change to existing boards.
  • Tested on QEMU only as first level; RH850 hardware support will come as a follow up PR.

Testing

Host: apache-nuttx-ci-linux image, x86_64
Toolchain: v850-elf GCC 14.3.0 (release above)
QEMU: qemu-system-rh850 11.1.90 (release above)
nuttx-apps: f04aee6015

  • qemu-rh850-u2c:nsh, hard and soft float, Make and CMake: build OK, 0 warnings.
  • ostest from a local ostest configuration, hard and soft float, under QEMU: ostest_main: Exiting with status 0.
  • tools/checkpatch.sh -c -u -m -g: all checks pass.

Run Test and Boot log

Boot log from the earlier v1.0.0 build; the nsh behaviour is the same with v1.2.0.

$ export PATH=/bin:/bin:$PATH
$ cd nuttx
$ ./tools/configure.sh -l qemu-rh850-u2c:nsh
$ make -j$(nproc)
$ qemu-system-rh850 -M rh850-u2c,test-exit=on -icount shift=4,sleep=on -nographic -kernel nuttx

NuttShell (NSH) NuttX-13.1.0
nsh> uname -a
NuttX 13.1.0 c1a6b803db Nov  4 2026 21:33:12 rh850 qemu-rh850-u2c
nsh> ps
  TID   PID  PPID PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK            STACK    USED FILLED COMMAND
    0     0     0   0 FIFO     Kthread   - Ready              0000000000000000 0002024 0000304  15.0%  Idle_Task
    2     2     0 100 FIFO     Task      - Running            0000000000000000 0003028 0001496  49.4%  nsh_main
nsh> free
      total       used       free    maxused    maxfree  nused  nfree name
     116496       8048     108448       8416     108216     22      2 Umem
nsh> help
help usage:  help [-v] [<cmd>]

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

Builtin Apps:
    dd     nsh    sh     
nsh> QEMU: Terminated

@github-actions github-actions Bot added Area: Build system Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. labels Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

@casaroli casaroli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Each arch has an Arch: and a Board: entry in .github/labeler.yml (Arch: renesas, Arch: tricore), but rh850 has none. A later PR on arch/rh850/** gets no arch label, so arch.yml takes "Allow the build" and starts every job.

Fix: add Arch: rh850 for arch/rh850/** and Board: rh850 for boards/rh850/**.

install= in tools/ci/platforms/ubuntu.sh:434 has rx_gcc_toolchain but no RH850 entry, so a local cibuild.sh run on Ubuntu has no v850-elf-gcc for /rh850.

Fix: add rh850_gcc_toolchain and rh850_qemu to ubuntu.sh as in linux.sh.

Impact says "checked on sim and ARM, see Testing", but Testing has no such check.

Fix: add the check and what it compared to Testing.

Comment thread tools/ci/testlist/other.dat Resolved

@raiden00pl raiden00pl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please use NTFC for tests in CI

Comment thread tools/ci/docker/linux/Dockerfile Resolved
Comment thread include/nuttx/compiler.h Resolved
Comment thread tools/ci/docker/linux/Dockerfile Resolved
@parthitce

Copy link
Copy Markdown
Contributor

Each arch has an Arch: and a Board: entry in .github/labeler.yml (Arch: renesas, Arch: tricore), but rh850 has none. A later PR on arch/rh850/** gets no arch label, so arch.yml takes "Allow the build" and starts every job.

Fix: add Arch: rh850 for arch/rh850/** and Board: rh850 for boards/rh850/**.

install= in tools/ci/platforms/ubuntu.sh:434 has rx_gcc_toolchain but no RH850 entry, so a local cibuild.sh run on Ubuntu has no v850-elf-gcc for /rh850.

Fix: add rh850_gcc_toolchain and rh850_qemu to ubuntu.sh as in linux.sh.

Impact says "checked on sim and ARM, see Testing", but Testing has no such check.

Fix: add the check and what it compared to Testing.

Thanks for the quick review. Added the rh850 labels to labeler.yml. ubuntu.sh now installs the toolchain and QEMU, together with linux.sh and the Dockerfile in #21497. The compiler.h change moved to #21498, which has the sim and ARM before/after results in Testing.

@parthitce

Copy link
Copy Markdown
Contributor

please use NTFC for tests in CI

Thanks for the quick review. I tried NTFC locally. It looks up test symbols by exact name, and v850 GCC prefixes C symbols with "_", so all tests get skipped and the run reports a pass. With a local fix for the prefix, test_os passes, but some nsh tests still time out, which I'm looking into. I'll send the prefix fix to nuttx-ntfc and switch this board to NTFC once that's sorted. Until then citest runs ostest under QEMU and checks the exit code.

Comment thread arch/rh850/include/irq.h Resolved
Comment thread arch/rh850/include/u2c/irq.h Resolved

@casaroli casaroli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The body says "RH850 does not link without this change, so it is part of this PR.", but the compiler.h change is not in this PR now; it is in #21498. Without it, builtin_original() in include/nuttx/compiler.h names memcpy without the "_" prefix, and both defconfigs build with -Os, so qemu-rh850-u2c:nsh and :citest do not link if this PR merges first.
Fix: add depends-on: apache/nuttx/pull/21498 to the body.

The body still describes the old content: "v850 GCC prefixes C symbols with "_", so compiler.h now uses the compiler's user label prefix in the asm names of the builtin and fortify wrappers.", "compiler.h: same symbols and code on targets without a user label prefix (checked on sim and ARM, see Testing).", "CI builds both and runs ostest under QEMU through citest." and "CI: the Linux image gets the RH850 toolchain and QEMU." This PR has no compiler.h, Dockerfile or testlist change now.
Fix: remove these lines, and say that compiler.h is in #21498, the CI image in #21497, and that the testlist entries come in a later PR.

@parthitce

Copy link
Copy Markdown
Contributor

Thanks @casaroli @xiaoxiang781216 for the reviews. am currently making some core changes to the toolchain around RH850, which should be available soon and I will update this changes for this PR. Mostly tracked under https://github.com/open-rh850

@parthitce
parthitce force-pushed the dev/rh850/upstream branch 2 times, most recently from 403a448 to 47279ff Compare November 17, 2026 17:48
@parthitce

Copy link
Copy Markdown
Contributor

The body says "RH850 does not link without this change, so it is part of this PR.", but the compiler.h change is not in this PR now; it is in #21498. Without it, builtin_original() in include/nuttx/compiler.h names memcpy without the "_" prefix, and both defconfigs build with -Os, so qemu-rh850-u2c:nsh and :citest do not link if this PR merges first. Fix: add depends-on: apache/nuttx/pull/21498 to the body.

The body still describes the old content: "v850 GCC prefixes C symbols with "_", so compiler.h now uses the compiler's user label prefix in the asm names of the builtin and fortify wrappers.", "compiler.h: same symbols and code on targets without a user label prefix (checked on sim and ARM, see Testing).", "CI builds both and runs ostest under QEMU through citest." and "CI: the Linux image gets the RH850 toolchain and QEMU." This PR has no compiler.h, Dockerfile or testlist change now. Fix: remove these lines, and say that compiler.h is in #21498, the CI image in #21497, and that the testlist entries come in a later PR.

Thanks. #21498 is merged now, so the link issue is gone. I updated the description: compiler.h was in #21498, the CI image is in #21497, and the testlist entries come in a later PR. citest is dropped too

@parthitce

Copy link
Copy Markdown
Contributor

@casaroli @xiaoxiang781216 @raiden00pl kindly revisit.

@parthitce

Copy link
Copy Markdown
Contributor

please use NTFC for tests in CI

Thanks for the quick review. I tried NTFC locally. It looks up test symbols by exact name, and v850 GCC prefixes C symbols with "_", so all tests get skipped and the run reports a pass. With a local fix for the prefix, test_os passes, but some nsh tests still time out, which I'm looking into. I'll send the prefix fix to nuttx-ntfc and switch this board to NTFC once that's sorted. Until then citest runs ostest under QEMU and checks the exit code.

@raiden00pl citest is dropped as @xiaoxiang781216 suggested. NTFC will come in a follow up PR with the nuttx-ntfc prefix fix.

@xiaoxiang781216

Copy link
Copy Markdown
Contributor

please use NTFC for tests in CI

Thanks for the quick review. I tried NTFC locally. It looks up test symbols by exact name, and v850 GCC prefixes C symbols with "_", so all tests get skipped and the run reports a pass. With a local fix for the prefix, test_os passes, but some nsh tests still time out, which I'm looking into. I'll send the prefix fix to nuttx-ntfc and switch this board to NTFC once that's sorted. Until then citest runs ostest under QEMU and checks the exit code.

@raiden00pl citest is dropped as @xiaoxiang781216 suggested. NTFC will come in a follow up PR with the nuttx-ntfc prefix fix.

@ssekar15 please rebase to the last master and enable ci in this pr since #21497 is merged.

raiden00pl
raiden00pl previously approved these changes Nov 18, 2026
parthitce and others added 6 commits November 18, 2026 22:37
Add the architecture code for the Renesas RH850 family with the G4KH
core, built with v850-elf GCC through Make or CMake.  Interrupts nest
by priority, and a context switch happens only at the outermost exit.

Co-authored-by: Saravanan Sekar <saravanan@linumiz.com>
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
Add the RH850/U2C chip (R7F702600) on CPU0, with the interrupt
controllers, OSTM0 as the system timer (ticked or tickless), the RLIN311
UART as console and the software system reset.

Co-authored-by: Parthiban Nallathambi <parthiban@linumiz.com>
Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
Add a board for the rh850-u2c machine of qemu-rh850
(github.com/linumiz/qemu-rh850), with an nsh configuration.  With
QEMU_RH850_U2C_TEST_EXIT, a test run stops QEMU with its exit status, so
a failed test or a panic shows up as a non-zero exit code.

Co-authored-by: Saravanan Sekar <saravanan@linumiz.com>
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
Label changes under arch/rh850 and boards/rh850 like those of the other
architectures, so that RH850 pull requests get their Arch and Board
labels.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
Add the pages for the RH850 architecture, the RH850/U2C chip and the
qemu-rh850-u2c board.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
The Linux CI image now has the v850-elf toolchain and qemu-system-rh850.
Build qemu-rh850-u2c:nsh with CMake.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
@parthitce

Copy link
Copy Markdown
Contributor

please use NTFC for tests in CI

Thanks for the quick review. I tried NTFC locally. It looks up test symbols by exact name, and v850 GCC prefixes C symbols with "_", so all tests get skipped and the run reports a pass. With a local fix for the prefix, test_os passes, but some nsh tests still time out, which I'm looking into. I'll send the prefix fix to nuttx-ntfc and switch this board to NTFC once that's sorted. Until then citest runs ostest under QEMU and checks the exit code.

@raiden00pl citest is dropped as @xiaoxiang781216 suggested. NTFC will come in a follow up PR with the nuttx-ntfc prefix fix.

@ssekar15 please rebase to the last master and enable ci in this pr since #21497 is merged.

Rebased on master and added the testlist commit, so CI now builds qemu-rh850-u2c:nsh.
Hope the CI changes picks it, tested in my local environment.

@xiaoxiang781216
xiaoxiang781216 merged commit 1194bc8 into apache:master Nov 19, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Build system 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.

6 participants