Skip to content

Add Renesas RA support - #579

Open
wdx04 wants to merge 25 commits into
mbed-ce:mainfrom
wdx04:add-renesas-ra
Open

Add Renesas RA support#579
wdx04 wants to merge 25 commits into
mbed-ce:mainfrom
wdx04:add-renesas-ra

Conversation

@wdx04

@wdx04 wdx04 commented Jun 14, 2026

Copy link
Copy Markdown

This PR adds three Renesas RA targets: FPB-RA4E1, FPB-RA6E2 and FPB-RA8E1

Summary of changes

Added basic support for Cortex-M85 MCUs
Added support for Renesas FPB-RA4E1, FPB-RA6E2 and FPB-RA8E1 targets.

Impact of changes

FPB-RA4E1, FPB-RA6E2 and FPB-RA8E1 are supported by Mbed CE.

Migration actions required

Documentation

The following Mbed components/drivers are implemented for the supported Renesas RA targets:

       *  MPU
       *  USTICKER
       *  RTC
       *  CRC
       *  TRNG
       *  ANALOGIN
       *  ANALOGOUT
       *  I2C
       *  INTERRUPTIN
       *  PORTIN
       *  PORTINOUT
       *  PORTOUT
       *  PWMOUT
       *  SERIAL
       *  SPI
       *  FLASH
       *  WATCHDOG
       *  RESET_REASON
       *  CAN
       *  CAN_FD

Some notes on the port:

  1. This port is designed to work with Renesas RA Smart Configurator(RASC) generated code. The generated configuration for each peripheral are copied into RAM and are modified when necessary. There are some rules to follow when configuring in RASC, like needing to enable certain interrupts and requiring to choose independent clocks for certain peripherals, and so on. The project structure isn't very tidy, but it's convenient for adding new targets without Renesas' official support.
  2. The Console: Every official RA board comes with an on-board JLINK debugger. However, most of them do not connect JLINK-VCP to the target chip. They prefer to use JLINK-RTT for debugging. Among the three targets supported in this PR, only FPB-RA8E1 supports JLINK-VCP out of the box. So only it has console-uart enabled by default, while the other two use console-rtt instead.
  3. UART Driver: 9-bit framing is not supported. Even without using DMA, BufferedSerial can still handle high-baud continuous data reception thanks to the 16-stage FIFO. On the FPB-RA8E1, the CPU load is about 4.9% at a baud rate of 921,600bps. The SCI peripherals in the RA series can be configurated as UART, Simple SPI, or Simple I2C, but it's not easy to change the configuration type at runtime. Currently all SCI peripherals are configuraed as UART.
  4. I2C Driver: only works on independent I2Cs and only standard 100KHz, 400KHz and 1MHz bitrates are supported.
  5. SPI Driver: only works on independent SPIs and only 8-bit frames are supported. DMA is enabled on the MOSI line for fast communication with SPI-based LCD modules. FPB-RA4E1's SPI interface on the Arduino connectors is Simple SPI on SCI0, so it currently does not work with Arduino expansion boards that uses SPI. The support for Simple SPI may be added later.

Pull request type

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[X] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Greentea tests are not run yet, to be updated


@multiplemonomials

Copy link
Copy Markdown
Collaborator

@wdx04 not sure if you saw but I pinged you on Discord. Also I created this PR to add fully integrated RTT support: #580. This should remove the need for you to add any RTT stuff here in this PR.

@wdx04

wdx04 commented Jun 22, 2026

Copy link
Copy Markdown
Author

@wdx04 not sure if you saw but I pinged you on Discord. Also I created this PR to add fully integrated RTT support: #580. This should remove the need for you to add any RTT stuff here in this PR.

OK.
Please merge #580 first, then I'll rebase and remove the RTT-stuff in this PR.

@multiplemonomials

Copy link
Copy Markdown
Collaborator

Done! I also ordered a board to start testing with in the next few weeks

wdx04 added 6 commits June 25, 2026 21:27
added Renesas RA targets: FPB-RA4E1, FPB-RA6E2 and FPB-RA8E1
remove r_usb_basic.c from CMakeLists
fix repeated creation of semaphores in spi_api.c
fix compliation erros in serial_api.c when console-uart is not used
remove dave2d files for now
add missing license headers
allow FPB-RA8E1 to retain RTC clock after reset
@multiplemonomials

Copy link
Copy Markdown
Collaborator

Also sent you this on the discord, if you didn't see it:
Nice work on this! But I may ask you to break it up a bit as it is a lot of code to review in one PR
Generally how me and Jan have done this in the past is, step 1 is adding just enough code to get the MCU to boot and output hello world
So like, serial driver plus us ticker plus boot code
And then other drivers like SPI, QSPIF, etc can be added in their own MRs. This keeps the code size manageable per each MR so that we can give it a good review.

@multiplemonomials

Copy link
Copy Markdown
Collaborator

Also I am still working on part 2 of the RTT MR which adds support for CPU caches. Do any of the targets being added have a data cache? (e.g. the __DCACHE_PRESENT define is defined)

@wdx04

wdx04 commented Jun 27, 2026

Copy link
Copy Markdown
Author

Also I am still working on part 2 of the RTT MR which adds support for CPU caches. Do any of the targets being added have a data cache? (e.g. the __DCACHE_PRESENT define is defined)

FPB-RA8E1. All RA8 MCUs are based on the Cortex-M85 core and have a data cache of 16KB.

#ifndef TARGET_MCU_RA
__libc_init_array();
#else
// workaround: __libc_init_array() crashes on Renesas RA MCUs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we know why it's crashing?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The exact reason is unknown yet. But RASC generated code uses __init_array_start/__init_array_end instead of __libc_init_array. The difference between the two is that __libc_init_array also calls __preinit_array_start/__preinit_array_end and _init(), before calling __init_array_start/__init_array_end.


MEMORY
{
RAM (rwx) : ORIGIN = RAM_START, LENGTH = RAM_LENGTH

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

OK, but Mbed does not provide memory bank definition for the DataFlash (no MBED_CONFIGURED_ROM_BANK_DataFlash_START/MBED_CONFIGURED_ROM_BANK_DataFlash_SIZE).

Comment thread targets/TARGET_RENESAS/TARGET_RA/ra/fsp/src/bsp/mcu/ra4e1/RA4E1.ld
Comment thread targets/TARGET_RENESAS/TARGET_RA/ra/fsp/src/bsp/mcu/ra4e1/RA4E1.ld
@multiplemonomials

Copy link
Copy Markdown
Collaborator

You should add your new targets here: https://github.com/mbed-ce/mbed-os/blob/main/.github/workflows/greentea_cmake.yml#L103
so that they will get built in CI

* Start adding RTT support for MCUs with CPU cache. Working on STM32H747 and MIMXRT106x

* Improve MIMRT105x configs, add ncache for MIMXRT1170

* Update ARMv8m MPU code too

* Oops, accidental change

* Fix build error, fix missing linker script entries

* More linker script updates
@multiplemonomials

Copy link
Copy Markdown
Collaborator

Also @wdx04 I sent you an invite to the Mbed CE organization! You should be able to accept it here https://github.com/mbed-ce

zhiyong-ft and others added 10 commits June 28, 2026 17:03
* Updated ESP32 driver documentation

Added tested working ESP32 modules and their firmware versions, also added note to increase buffer size under some scenarios.

* Enhance CHANGELOG with recent updates and fixes

Updated changelog with improvements and fixes for ESP32 Wi-Fi driver
* Updated ESP32 driver documentation

Added tested working ESP32 modules and their firmware versions, also added note to increase buffer size under some scenarios.

* Enhance CHANGELOG with recent updates and fixes

Updated changelog with improvements and fixes for ESP32 Wi-Fi driver

* Updated command to get RSSI

RSSI is now only queried from ESP32 if it is connected to an AP. Old way to get SSID and BSSID first then use AT+CWLAP to get RSSI is superfluous and no longer works anyway per the latest ESP AT firmware.
Updated code to retrieve RSSI from ESP32 module per the latest firmware
added Renesas RA targets: FPB-RA4E1, FPB-RA6E2 and FPB-RA8E1
remove r_usb_basic.c from CMakeLists
fix repeated creation of semaphores in spi_api.c
fix compliation erros in serial_api.c when console-uart is not used
remove dave2d files for now
add missing license headers
allow FPB-RA8E1 to retain RTC clock after reset
added Greentea targets
added 'noncached' section in RA8E1.ld
wdx04 added 3 commits July 27, 2026 02:17
…o add-renesas-ra

# Conflicts:
#	targets/TARGET_RENESAS/TARGET_RA/ra/fsp/src/bsp/mcu/ra4e1/RA4E1.ld
#	targets/TARGET_RENESAS/TARGET_RA/ra/fsp/src/bsp/mcu/ra6e2/RA6E2.ld
#	targets/TARGET_RENESAS/TARGET_RA/ra/fsp/src/bsp/mcu/ra8e1/RA8E1.ld
@multiplemonomials

Copy link
Copy Markdown
Collaborator

Tried to compile the CI shield test project and got some linker errors. Looks like there are some HAL functions that are missing implementations

[1/4] Linking CXX executable test-testshield-dac-to-adc.elf
FAILED: test-testshield-dac-to-adc.elf 
C:\WINDOWS\system32\cmd.exe /C "C:\WINDOWS\system32\cmd.exe /C "cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E touch J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.elf.map && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E rename J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.elf.map J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.elf.map.old && cd J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1" && C:\PROGRA~2\ARMGNU~1\14EFD8~1.2RE\bin\AR10B2~1.EXE -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-psabi -Wno-packed-bitfield-compat -Werror=return-type -fmessage-length=0 -fno-exceptions -ffunction-sections -fdata-sections -funsigned-char -fomit-frame-pointer -g3 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mcpu=cortex-m85 -Wno-register -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group -specs=nosys.specs -Wl,--cref    -T J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/mbed-fpb-ra8e1.link_script.ld -Wl,-Map=J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.elf.map -Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_memalign_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -Wl,-n -Wl,--wrap,printf -Wl,--wrap,sprintf -Wl,--wrap,snprintf -Wl,--wrap,vprintf -Wl,--wrap,vsprintf -Wl,--wrap,vsnprintf -Wl,--wrap,fprintf -Wl,--wrap,vfprintf @CMakeFiles\test-testshield-dac-to-adc.rsp -o test-testshield-dac-to-adc.elf && C:\WINDOWS\system32\cmd.exe /C "cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin\arm-none-eabi-objcopy.exe" -O binary J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.elf J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.bin && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E echo "-- built: J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.bin" && "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin\arm-none-eabi-objcopy.exe" -O ihex J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.elf J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.hex && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E echo "-- built: J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.hex" && cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\mbed-os\venv\Scripts\memap.exe -t GCC_ARM test-testshield-dac-to-adc.elf.map --depth 2 --memory-banks-json J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/memory_banks.json""
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: test-testshield-dac-to-adc.elf has a LOAD segment with RWX permissions
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/drivers/source/AnalogOut.cpp.obj: in function `mbed::AnalogOut::write(float)':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/source/AnalogOut.cpp:27:(.text._ZN4mbed9AnalogOut5writeEf+0x1c): undefined reference to `analogout_write'
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/drivers/source/AnalogOut.cpp.obj: in function `mbed::AnalogOut::read()':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/source/AnalogOut.cpp:41:(.text._ZN4mbed9AnalogOut4readEv+0x14): undefined reference to `analogout_read'
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: CMakeFiles/test-testshield-dac-to-adc.dir/DACToADCTest.cpp.obj: in function `mbed::AnalogOut::~AnalogOut()':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/include/drivers/AnalogOut.h:140:(.text._ZN4mbed9AnalogOutD2Ev[_ZN4mbed9AnalogOutD5Ev]+0xa): undefined reference to `analogout_free'
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: CMakeFiles/test-testshield-dac-to-adc.dir/DACToADCTest.cpp.obj: in function `mbed::AnalogOut::AnalogOut(PinName)':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/include/drivers/AnalogOut.h:65:(.text.startup._GLOBAL__sub_I_gpout1Pin+0x36): undefined reference to `analogout_init'
collect2.exe: error: ld returned 1 exit status
[2/4] Linking CXX executable test-testshield-spi-basic.elf
FAILED: test-testshield-spi-basic.elf 
C:\WINDOWS\system32\cmd.exe /C "C:\WINDOWS\system32\cmd.exe /C "cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E touch J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.elf.map && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E rename J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.elf.map J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.elf.map.old && cd J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1" && C:\PROGRA~2\ARMGNU~1\14EFD8~1.2RE\bin\AR10B2~1.EXE -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-psabi -Wno-packed-bitfield-compat -Werror=return-type -fmessage-length=0 -fno-exceptions -ffunction-sections -fdata-sections -funsigned-char -fomit-frame-pointer -g3 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mcpu=cortex-m85 -Wno-register -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group -specs=nosys.specs -Wl,--cref    -T J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/mbed-fpb-ra8e1.link_script.ld -Wl,-Map=J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.elf.map -Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_memalign_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -Wl,-n -Wl,--wrap,printf -Wl,--wrap,sprintf -Wl,--wrap,snprintf -Wl,--wrap,vprintf -Wl,--wrap,vsprintf -Wl,--wrap,vsnprintf -Wl,--wrap,fprintf -Wl,--wrap,vfprintf @CMakeFiles\test-testshield-spi-basic.rsp -o test-testshield-spi-basic.elf && C:\WINDOWS\system32\cmd.exe /C "cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin\arm-none-eabi-objcopy.exe" -O binary J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.elf J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.bin && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E echo "-- built: J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.bin" && "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin\arm-none-eabi-objcopy.exe" -O ihex J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.elf J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.hex && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E echo "-- built: J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.hex" && cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\mbed-os\venv\Scripts\memap.exe -t GCC_ARM test-testshield-spi-basic.elf.map --depth 2 --memory-banks-json J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/memory_banks.json""
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: test-testshield-spi-basic.elf has a LOAD segment with RWX permissions
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/hal/source/mbed_compat.c.obj: in function `spi_get_capabilities':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/hal/source/mbed_compat.c:82:(.text.spi_get_capabilities+0x28): undefined reference to `spi_master_cs_pinmap'
collect2.exe: error: ld returned 1 exit status
[3/4] Linking CXX executable test-testshield-pwm-and-adc.elf
FAILED: test-testshield-pwm-and-adc.elf 
C:\WINDOWS\system32\cmd.exe /C "C:\WINDOWS\system32\cmd.exe /C "cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E touch J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.elf.map && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E rename J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.elf.map J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.elf.map.old && cd J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1" && C:\PROGRA~2\ARMGNU~1\14EFD8~1.2RE\bin\AR10B2~1.EXE -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-psabi -Wno-packed-bitfield-compat -Werror=return-type -fmessage-length=0 -fno-exceptions -ffunction-sections -fdata-sections -funsigned-char -fomit-frame-pointer -g3 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mcpu=cortex-m85 -Wno-register -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group -specs=nosys.specs -Wl,--cref    -T J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/mbed-fpb-ra8e1.link_script.ld -Wl,-Map=J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.elf.map -Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_memalign_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -Wl,-n -Wl,--wrap,printf -Wl,--wrap,sprintf -Wl,--wrap,snprintf -Wl,--wrap,vprintf -Wl,--wrap,vsprintf -Wl,--wrap,vsnprintf -Wl,--wrap,fprintf -Wl,--wrap,vfprintf @CMakeFiles\test-testshield-pwm-and-adc.rsp -o test-testshield-pwm-and-adc.elf && C:\WINDOWS\system32\cmd.exe /C "cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin\arm-none-eabi-objcopy.exe" -O binary J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.elf J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.bin && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E echo "-- built: J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.bin" && "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin\arm-none-eabi-objcopy.exe" -O ihex J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.elf J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.hex && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E echo "-- built: J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.hex" && cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\mbed-os\venv\Scripts\memap.exe -t GCC_ARM test-testshield-pwm-and-adc.elf.map --depth 2 --memory-banks-json J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/memory_banks.json""
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: test-testshield-pwm-and-adc.elf has a LOAD segment with RWX permissions
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/drivers/source/PwmOut.cpp.obj: in function `mbed::PwmOut::period(float)':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/source/PwmOut.cpp:76:(.text._ZN4mbed6PwmOut6periodEf+0x16): undefined reference to `pwmout_period'
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/drivers/source/PwmOut.cpp.obj: in function `mbed::PwmOut::read_period_us()':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/source/PwmOut.cpp:97:(.text._ZN4mbed6PwmOut14read_period_usEv+0xa): undefined reference to `pwmout_read_period_us'
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/drivers/source/PwmOut.cpp.obj: in function `mbed::PwmOut::read_pulsewidth_us()':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/source/PwmOut.cpp:126:(.text._ZN4mbed6PwmOut18read_pulsewidth_usEv+0xa): undefined reference to `pwmout_read_pulsewidth_us'
collect2.exe: error: ld returned 1 exit status
[4/4] Linking CXX executable test-testshield-spi-microsd.elf
FAILED: test-testshield-spi-microsd.elf 
C:\WINDOWS\system32\cmd.exe /C "C:\WINDOWS\system32\cmd.exe /C "cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E touch J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.elf.map && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E rename J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.elf.map J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.elf.map.old && cd J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1" && C:\PROGRA~2\ARMGNU~1\14EFD8~1.2RE\bin\AR10B2~1.EXE -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-psabi -Wno-packed-bitfield-compat -Werror=return-type -fmessage-length=0 -fno-exceptions -ffunction-sections -fdata-sections -funsigned-char -fomit-frame-pointer -g3 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mcpu=cortex-m85 -Wno-register -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group -specs=nosys.specs -Wl,--cref    -T J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/mbed-fpb-ra8e1.link_script.ld -Wl,-Map=J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.elf.map -Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_memalign_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -Wl,-n -Wl,--wrap,printf -Wl,--wrap,sprintf -Wl,--wrap,snprintf -Wl,--wrap,vprintf -Wl,--wrap,vsprintf -Wl,--wrap,vsnprintf -Wl,--wrap,fprintf -Wl,--wrap,vfprintf @CMakeFiles\test-testshield-spi-microsd.rsp -o test-testshield-spi-microsd.elf && C:\WINDOWS\system32\cmd.exe /C "cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin\arm-none-eabi-objcopy.exe" -O binary J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.elf J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.bin && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E echo "-- built: J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.bin" && "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin\arm-none-eabi-objcopy.exe" -O ihex J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.elf J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.hex && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E echo "-- built: J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.hex" && cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\mbed-os\venv\Scripts\memap.exe -t GCC_ARM test-testshield-spi-microsd.elf.map --depth 2 --memory-banks-json J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/memory_banks.json""
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/storage/blockdevice/COMPONENT_SD/libmbed-storage-sd.a(SDBlockDevice.cpp.obj): in function `mbed::impl::MbedCRC<4129ul, (unsigned char)16, (mbed::CrcMode)0>::compute_partial_start(unsigned long*)':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/include/drivers/MbedCRC.h:406:(.text._ZN4mbed4impl7MbedCRCILm4129ELh16ELNS_7CrcModeE0EE7computeEPKvjPm.isra.0+0x30): undefined reference to `hal_crc_compute_partial_start'
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/storage/blockdevice/COMPONENT_SD/libmbed-storage-sd.a(SDBlockDevice.cpp.obj): in function `std::enable_if<((mbed::CrcMode)0)==((mbed::CrcMode)0), long>::type mbed::impl::MbedCRC<4129ul, (unsigned char)16, (mbed::CrcMode)0>::do_compute_partial<(mbed::CrcMode)0>(unsigned char const*, unsigned int, unsigned long*) const':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/include/drivers/MbedCRC.h:843:(.text._ZN4mbed4impl7MbedCRCILm4129ELh16ELNS_7CrcModeE0EE7computeEPKvjPm.isra.0+0x3c): undefined reference to `hal_crc_compute_partial'
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/storage/blockdevice/COMPONENT_SD/libmbed-storage-sd.a(SDBlockDevice.cpp.obj): in function `mbed::impl::MbedCRC<4129ul, (unsigned char)16, (mbed::CrcMode)0>::compute_partial_stop(unsigned long*)':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/include/drivers/MbedCRC.h:427:(.text._ZN4mbed4impl7MbedCRCILm4129ELh16ELNS_7CrcModeE0EE7computeEPKvjPm.isra.0+0x40): undefined reference to `hal_crc_get_result'

@wdx04

wdx04 commented Aug 4, 2026

Copy link
Copy Markdown
Author

Tried to compile the CI shield test project and got some linker errors. Looks like there are some HAL functions that are missing implementations

[1/4] Linking CXX executable test-testshield-dac-to-adc.elf
FAILED: test-testshield-dac-to-adc.elf 
C:\WINDOWS\system32\cmd.exe /C "C:\WINDOWS\system32\cmd.exe /C "cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E touch J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.elf.map && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E rename J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.elf.map J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.elf.map.old && cd J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1" && C:\PROGRA~2\ARMGNU~1\14EFD8~1.2RE\bin\AR10B2~1.EXE -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-psabi -Wno-packed-bitfield-compat -Werror=return-type -fmessage-length=0 -fno-exceptions -ffunction-sections -fdata-sections -funsigned-char -fomit-frame-pointer -g3 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mcpu=cortex-m85 -Wno-register -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group -specs=nosys.specs -Wl,--cref    -T J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/mbed-fpb-ra8e1.link_script.ld -Wl,-Map=J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.elf.map -Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_memalign_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -Wl,-n -Wl,--wrap,printf -Wl,--wrap,sprintf -Wl,--wrap,snprintf -Wl,--wrap,vprintf -Wl,--wrap,vsprintf -Wl,--wrap,vsnprintf -Wl,--wrap,fprintf -Wl,--wrap,vfprintf @CMakeFiles\test-testshield-dac-to-adc.rsp -o test-testshield-dac-to-adc.elf && C:\WINDOWS\system32\cmd.exe /C "cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin\arm-none-eabi-objcopy.exe" -O binary J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.elf J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.bin && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E echo "-- built: J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.bin" && "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin\arm-none-eabi-objcopy.exe" -O ihex J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.elf J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.hex && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E echo "-- built: J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-dac-to-adc.hex" && cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\mbed-os\venv\Scripts\memap.exe -t GCC_ARM test-testshield-dac-to-adc.elf.map --depth 2 --memory-banks-json J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/memory_banks.json""
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: test-testshield-dac-to-adc.elf has a LOAD segment with RWX permissions
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/drivers/source/AnalogOut.cpp.obj: in function `mbed::AnalogOut::write(float)':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/source/AnalogOut.cpp:27:(.text._ZN4mbed9AnalogOut5writeEf+0x1c): undefined reference to `analogout_write'
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/drivers/source/AnalogOut.cpp.obj: in function `mbed::AnalogOut::read()':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/source/AnalogOut.cpp:41:(.text._ZN4mbed9AnalogOut4readEv+0x14): undefined reference to `analogout_read'
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: CMakeFiles/test-testshield-dac-to-adc.dir/DACToADCTest.cpp.obj: in function `mbed::AnalogOut::~AnalogOut()':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/include/drivers/AnalogOut.h:140:(.text._ZN4mbed9AnalogOutD2Ev[_ZN4mbed9AnalogOutD5Ev]+0xa): undefined reference to `analogout_free'
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: CMakeFiles/test-testshield-dac-to-adc.dir/DACToADCTest.cpp.obj: in function `mbed::AnalogOut::AnalogOut(PinName)':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/include/drivers/AnalogOut.h:65:(.text.startup._GLOBAL__sub_I_gpout1Pin+0x36): undefined reference to `analogout_init'
collect2.exe: error: ld returned 1 exit status
[2/4] Linking CXX executable test-testshield-spi-basic.elf
FAILED: test-testshield-spi-basic.elf 
C:\WINDOWS\system32\cmd.exe /C "C:\WINDOWS\system32\cmd.exe /C "cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E touch J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.elf.map && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E rename J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.elf.map J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.elf.map.old && cd J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1" && C:\PROGRA~2\ARMGNU~1\14EFD8~1.2RE\bin\AR10B2~1.EXE -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-psabi -Wno-packed-bitfield-compat -Werror=return-type -fmessage-length=0 -fno-exceptions -ffunction-sections -fdata-sections -funsigned-char -fomit-frame-pointer -g3 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mcpu=cortex-m85 -Wno-register -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group -specs=nosys.specs -Wl,--cref    -T J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/mbed-fpb-ra8e1.link_script.ld -Wl,-Map=J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.elf.map -Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_memalign_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -Wl,-n -Wl,--wrap,printf -Wl,--wrap,sprintf -Wl,--wrap,snprintf -Wl,--wrap,vprintf -Wl,--wrap,vsprintf -Wl,--wrap,vsnprintf -Wl,--wrap,fprintf -Wl,--wrap,vfprintf @CMakeFiles\test-testshield-spi-basic.rsp -o test-testshield-spi-basic.elf && C:\WINDOWS\system32\cmd.exe /C "cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin\arm-none-eabi-objcopy.exe" -O binary J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.elf J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.bin && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E echo "-- built: J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.bin" && "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin\arm-none-eabi-objcopy.exe" -O ihex J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.elf J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.hex && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E echo "-- built: J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-basic.hex" && cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\mbed-os\venv\Scripts\memap.exe -t GCC_ARM test-testshield-spi-basic.elf.map --depth 2 --memory-banks-json J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/memory_banks.json""
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: test-testshield-spi-basic.elf has a LOAD segment with RWX permissions
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/hal/source/mbed_compat.c.obj: in function `spi_get_capabilities':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/hal/source/mbed_compat.c:82:(.text.spi_get_capabilities+0x28): undefined reference to `spi_master_cs_pinmap'
collect2.exe: error: ld returned 1 exit status
[3/4] Linking CXX executable test-testshield-pwm-and-adc.elf
FAILED: test-testshield-pwm-and-adc.elf 
C:\WINDOWS\system32\cmd.exe /C "C:\WINDOWS\system32\cmd.exe /C "cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E touch J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.elf.map && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E rename J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.elf.map J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.elf.map.old && cd J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1" && C:\PROGRA~2\ARMGNU~1\14EFD8~1.2RE\bin\AR10B2~1.EXE -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-psabi -Wno-packed-bitfield-compat -Werror=return-type -fmessage-length=0 -fno-exceptions -ffunction-sections -fdata-sections -funsigned-char -fomit-frame-pointer -g3 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mcpu=cortex-m85 -Wno-register -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group -specs=nosys.specs -Wl,--cref    -T J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/mbed-fpb-ra8e1.link_script.ld -Wl,-Map=J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.elf.map -Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_memalign_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -Wl,-n -Wl,--wrap,printf -Wl,--wrap,sprintf -Wl,--wrap,snprintf -Wl,--wrap,vprintf -Wl,--wrap,vsprintf -Wl,--wrap,vsnprintf -Wl,--wrap,fprintf -Wl,--wrap,vfprintf @CMakeFiles\test-testshield-pwm-and-adc.rsp -o test-testshield-pwm-and-adc.elf && C:\WINDOWS\system32\cmd.exe /C "cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin\arm-none-eabi-objcopy.exe" -O binary J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.elf J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.bin && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E echo "-- built: J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.bin" && "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin\arm-none-eabi-objcopy.exe" -O ihex J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.elf J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.hex && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E echo "-- built: J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-pwm-and-adc.hex" && cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\mbed-os\venv\Scripts\memap.exe -t GCC_ARM test-testshield-pwm-and-adc.elf.map --depth 2 --memory-banks-json J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/memory_banks.json""
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: test-testshield-pwm-and-adc.elf has a LOAD segment with RWX permissions
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/drivers/source/PwmOut.cpp.obj: in function `mbed::PwmOut::period(float)':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/source/PwmOut.cpp:76:(.text._ZN4mbed6PwmOut6periodEf+0x16): undefined reference to `pwmout_period'
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/drivers/source/PwmOut.cpp.obj: in function `mbed::PwmOut::read_period_us()':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/source/PwmOut.cpp:97:(.text._ZN4mbed6PwmOut14read_period_usEv+0xa): undefined reference to `pwmout_read_period_us'
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/drivers/source/PwmOut.cpp.obj: in function `mbed::PwmOut::read_pulsewidth_us()':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/source/PwmOut.cpp:126:(.text._ZN4mbed6PwmOut18read_pulsewidth_usEv+0xa): undefined reference to `pwmout_read_pulsewidth_us'
collect2.exe: error: ld returned 1 exit status
[4/4] Linking CXX executable test-testshield-spi-microsd.elf
FAILED: test-testshield-spi-microsd.elf 
C:\WINDOWS\system32\cmd.exe /C "C:\WINDOWS\system32\cmd.exe /C "cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E touch J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.elf.map && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E rename J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.elf.map J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.elf.map.old && cd J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1" && C:\PROGRA~2\ARMGNU~1\14EFD8~1.2RE\bin\AR10B2~1.EXE -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-psabi -Wno-packed-bitfield-compat -Werror=return-type -fmessage-length=0 -fno-exceptions -ffunction-sections -fdata-sections -funsigned-char -fomit-frame-pointer -g3 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mcpu=cortex-m85 -Wno-register -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group -specs=nosys.specs -Wl,--cref    -T J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/mbed-fpb-ra8e1.link_script.ld -Wl,-Map=J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.elf.map -Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_memalign_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -Wl,-n -Wl,--wrap,printf -Wl,--wrap,sprintf -Wl,--wrap,snprintf -Wl,--wrap,vprintf -Wl,--wrap,vsprintf -Wl,--wrap,vsnprintf -Wl,--wrap,fprintf -Wl,--wrap,vfprintf @CMakeFiles\test-testshield-spi-microsd.rsp -o test-testshield-spi-microsd.elf && C:\WINDOWS\system32\cmd.exe /C "cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin\arm-none-eabi-objcopy.exe" -O binary J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.elf J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.bin && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E echo "-- built: J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.bin" && "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.2 rel1\bin\arm-none-eabi-objcopy.exe" -O ihex J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.elf J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.hex && C:\Users\jamie\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe -E echo "-- built: J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/test-testshield-spi-microsd.hex" && cd /D J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\cmake-build-develop-fpb_ra8e1 && J:\Mbed\mbed-ce-test-tools\CI-Shield-Tests\mbed-os\venv\Scripts\memap.exe -t GCC_ARM test-testshield-spi-microsd.elf.map --depth 2 --memory-banks-json J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/cmake-build-develop-fpb_ra8e1/memory_banks.json""
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/storage/blockdevice/COMPONENT_SD/libmbed-storage-sd.a(SDBlockDevice.cpp.obj): in function `mbed::impl::MbedCRC<4129ul, (unsigned char)16, (mbed::CrcMode)0>::compute_partial_start(unsigned long*)':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/include/drivers/MbedCRC.h:406:(.text._ZN4mbed4impl7MbedCRCILm4129ELh16ELNS_7CrcModeE0EE7computeEPKvjPm.isra.0+0x30): undefined reference to `hal_crc_compute_partial_start'
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/storage/blockdevice/COMPONENT_SD/libmbed-storage-sd.a(SDBlockDevice.cpp.obj): in function `std::enable_if<((mbed::CrcMode)0)==((mbed::CrcMode)0), long>::type mbed::impl::MbedCRC<4129ul, (unsigned char)16, (mbed::CrcMode)0>::do_compute_partial<(mbed::CrcMode)0>(unsigned char const*, unsigned int, unsigned long*) const':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/include/drivers/MbedCRC.h:843:(.text._ZN4mbed4impl7MbedCRCILm4129ELh16ELNS_7CrcModeE0EE7computeEPKvjPm.isra.0+0x3c): undefined reference to `hal_crc_compute_partial'
C:/PROGRA~2/ARMGNU~1/14EFD8~1.2RE/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/storage/blockdevice/COMPONENT_SD/libmbed-storage-sd.a(SDBlockDevice.cpp.obj): in function `mbed::impl::MbedCRC<4129ul, (unsigned char)16, (mbed::CrcMode)0>::compute_partial_stop(unsigned long*)':
J:/Mbed/mbed-ce-test-tools/CI-Shield-Tests/mbed-os/drivers/include/drivers/MbedCRC.h:427:(.text._ZN4mbed4impl7MbedCRCILm4129ELh16ELNS_7CrcModeE0EE7computeEPKvjPm.isra.0+0x40): undefined reference to `hal_crc_get_result'

Yes, there are some missing symbols in the code. I ran the test on the FPB-RA8E1 and am working on fixing the issues I found.

@multiplemonomials

Copy link
Copy Markdown
Collaborator

Also, I am trying to run tests locally and I cannot get Mbed to boot on my FPB-RA8E1 board. Getting a HardFault due to undefined instruction on this line, in R_BSP_SoftwareDelay():
image

@multiplemonomials

Copy link
Copy Markdown
Collaborator

Any idea what could be going on here?

@wdx04

wdx04 commented Aug 4, 2026

Copy link
Copy Markdown
Author

Any idea what could be going on here?

I remember I ran into some issues the first time I used the FPB-RA8E1. Later, I used the Renesas Flash Programmer to change the Flash's Secure/Non-Secure partitioning and allocated the entire Flash to the Secure section, and it went back to normal.

flash_boundary

14 tests are still failing:

Watchdog
49 - test-mbed-hal-watchdog-timing (Only 'timeout accuracy' test failed)

FlashIAP
6 - test-mbed-drivers-flashiap (Failed)
29 - test-mbed-hal-flash-functional-tests (Failed)

Tickers
25 - test-mbed-hal-common-tickers (Failed)

RTC
36 - test-mbed-hal-rtc (Failed)
37 - test-mbed-hal-rtc-reset (Failed)
38 - test-mbed-hal-rtc-time (Failed)

Storage
91 - test-mbed-storage-blockdevice-general_block_device (Failed)
96 - test-mbed-storage-kvstore-general_tests_phase_1 (Failed)
97 - test-mbed-storage-kvstore-general_tests_phase_2 (Failed)
98 - test-mbed-storage-kvstore-static_tests (Failed)
99 - test-mbed-storage-kvstore-filesystemstore (Failed)
100 - test-mbed-storage-kvstore-direct-access-devicekey (Failed)

Others
119 - test-mbed-device_key-functionality (Failed)
@multiplemonomials

Copy link
Copy Markdown
Collaborator

Huh, tried that, no dice. Still get illegal instruction on that line.

@multiplemonomials

multiplemonomials commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Another odd thing is that it does not use the hard fault handler, it for some reason jumps to address 0xFFFFFFFE on hard fault
image

@wdx04

wdx04 commented Aug 5, 2026

Copy link
Copy Markdown
Author

Huh, tried that, no dice. Still get illegal instruction on that line.

That's really weird. Anyway, MOV.W is obviously not an illegal instruction.
Which version of GCC are you using? I use GCC 13.2.1 20231009.

Also, please try temporarily modifying these two pieces of code::
1.Reduce the CPU frequency in TARGET_RENESAS/TARGET_RA/TARGET_RA8E1/TARGET_FPB_RA8E1/bsp_clock_cfg.h。

#define BSP_CFG_PLODIVP (BSP_CLOCKS_PLL_DIV_4) /* PLL1P Div /4 */
#define BSP_CFG_PLL1P_FREQUENCY_HZ (180000000) /* PLL1P 180000000Hz */
#define BSP_CFG_PLODIVQ (BSP_CLOCKS_PLL_DIV_4) /* PLL1Q Div /4 */
#define BSP_CFG_PLL1Q_FREQUENCY_HZ (180000000) /* PLL1Q 180000000Hz */
#define BSP_CFG_PLODIVR (BSP_CLOCKS_PLL_DIV_4) /* PLL1R Div /4 */
#define BSP_CFG_PLL1R_FREQUENCY_HZ (180000000) /* PLL1R 180000000Hz */

2.Comment out the 'noncached' region in the MPU settings(mbed_mpu_v8m.c). It seems the Cortex-v8m MPU doesn't allow overlapping regions.

@multiplemonomials

Copy link
Copy Markdown
Collaborator

OK, making some progress here! Changing those lines in the clock config file allows it to run stably. I still do not get working communications on the J-Link VCOM UART and can't run greentea tests (is that expected to work out of the box? Do I need to make any mods to the dev kit?), but the code does run without crashing. This sort of makes sense, it reminds me of what happens on MIMXRT when something is messed up with the XIP flash chip. The core reads an instruction wrong and just goes bananas.

Regarding the MPU settings, this is fixed in main branch (caught that issue on RP2350). However, I tried rebasing your branch on main, and I... can't. Something is really messed up with the git history, it looks like somehow you merged together two of your own branches plus some commits from main. Couldn't even use my old standby of squashing and merging. I ended up using this trick to make a squashed branch and then rebase it on main: https://github.com/mbed-ce/mbed-os/tree/add-renesas-ra-squashed

Also, we need to face the fact that this branch has a huge diff. I am thinking that we need to split this up into many different PRs. At minimum, the first PR would add all of the SDK files that don't need detailed review, then the second PR would add all the code needed to run to main(). If you don't have time for this that's OK, I can work on it, it will make the review way easier.

@wdx04

wdx04 commented Aug 5, 2026

Copy link
Copy Markdown
Author

OK, making some progress here! Changing those lines in the clock config file allows it to run stably. I still do not get working communications on the J-Link VCOM UART and can't run greentea tests (is that expected to work out of the box? Do I need to make any mods to the dev kit?), but the code does run without crashing. This sort of makes sense, it reminds me of what happens on MIMXRT when something is messed up with the XIP flash chip. The core reads an instruction wrong and just goes bananas.

You may need to upgrade the J-Link firmware and enable Virtual COM Port in J-Link Configurator.

Also, we need to face the fact that this branch has a huge diff. I am thinking that we need to split this up into many different PRs. At minimum, the first PR would add all of the SDK files that don't need detailed review, then the second PR would add all the code needed to run to main(). If you don't have time for this that's OK, I can work on it, it will make the review way easier.

OK, but before that, I want to fix most of the Greentea test failures first.

@wdx04

wdx04 commented Aug 5, 2026

Copy link
Copy Markdown
Author

@multiplemonomials By including the option settings in the linker script, you should be able to run apps at 360MHz on FPB-RA8E1. It looks like the factory default option settings can't support the CPU clock at 360MHz.

@multiplemonomials

Copy link
Copy Markdown
Collaborator

All right! With your latest commit, and no clock changes, I can run greentea tests now! Nice find!

wdx04 added 3 commits August 6, 2026 09:47
remaining failed tests:
25 - test-mbed-hal-common-tickers (Failed)
49 - test-mbed-hal-watchdog-timing (Failed)
@multiplemonomials

multiplemonomials commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Hi! I believe I have found and fixed an issue in the serial code. I was trying to run CI shield tests, but noticed that about half the tests were failing to start due to, apparently, UART not working. I did some further debugging and noticed:

  • On the tests that were not working, the data coming into the UART IRQ handler was garbled
  • The data was garbled because the ABCSE2 bit in CCR2 of the SCI was set, whereas in the working tests it was not set.

After some debugging, I narrowed it down to this code:

void serial_baud(serial_t *obj, int baudrate)
{
    MBED_ASSERT(obj);

    baud_setting_t setting;
    fsp_err_t err = R_SCI_UART_BaudCalculate(baudrate, true, 500, &setting);
    if (err == FSP_SUCCESS) {
        obj->p_api->baudSet(obj->p_ctrl, &setting);
    }
}

The problem is that R_SCI_UART_BaudCalculate does not fully overwrite setting, it merely assigns to specific bits within it. And, since setting is not initialized, it contains random stack data. So, if it happens to have a 1 in bit 7 of the data, the ABCSE2 bit gets set and the issue happens.

The fix appears to be to change it to work like in serial_init():

void serial_baud(serial_t *obj, int baudrate)
{
    MBED_ASSERT(obj);

    fsp_err_t err = R_SCI_UART_BaudCalculate(baudrate, true, 500, obj->ext.p_baud_setting);
    if (err == FSP_SUCCESS) {
        obj->p_api->baudSet(obj->p_ctrl, obj->ext.p_baud_setting);
    }
}

This way, it is not subject to this issue and it retains any other bits that were set during the init process.

@multiplemonomials

Copy link
Copy Markdown
Collaborator

OK, now I was able to get a good run with the FPB-RA8E1 and the CI shield.

CI shield image

Produced the following test results: ctest.log

Looks like SPI has a few failures, including some with 16-bit words. I2C also has a few failures -- maybe you need to define the I2C capabilities structure to indicate if there are limitations of the hardware (e.g. no zero length transactions). The test suite will obey the capabilities. The InterruptIn test is failing due to a pinmap issue -- looks like P1_13 does not support InterruptIn which is annoying -- might need to tweak the test setup to work around this. Test cases are here for reference: https://github.com/mbed-ce/mbed-ce-test-tools/tree/master/CI-Shield-Tests

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants