Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f2e374f
added support for Cortex-M85 CPUs
wdx04 Jun 14, 2026
e1fb9eb
add minimal lincense header
wdx04 Jun 16, 2026
63b16b3
enable SPI Burst mode only on RA8E1
wdx04 Jun 16, 2026
f5a9eb5
added "rtc-clock-source" config option to RA MCUs
wdx04 Jun 19, 2026
d15f2c4
added GPIO speed settings for UART/I2C/SPI/CAN peripherals
wdx04 Jun 19, 2026
1ca53a1
remove RTT code from TARGET_RA
wdx04 Jun 25, 2026
749eb6c
Add non-cached section support and use it for RTT (#582)
multiplemonomials Jun 28, 2026
2ef1880
Updated ESP32 driver documentation (#583)
zhiyong-ft Jun 29, 2026
003c815
Updated command to get RSSI (#584)
zhiyong-ft Jun 29, 2026
81a4a64
Update CHANGELOG with RSSI retrieval for ESP32 (#585)
zhiyong-ft Jun 29, 2026
8a6b2d8
added support for Cortex-M85 CPUs
wdx04 Jun 14, 2026
20eb845
add minimal lincense header
wdx04 Jun 16, 2026
dec0517
enable SPI Burst mode only on RA8E1
wdx04 Jun 16, 2026
70aca09
added "rtc-clock-source" config option to RA MCUs
wdx04 Jun 19, 2026
28bfbc7
added GPIO speed settings for UART/I2C/SPI/CAN peripherals
wdx04 Jun 19, 2026
b9ddb6b
remove RTT code from TARGET_RA
wdx04 Jun 25, 2026
e9cbe2f
use Mbed-provided memory bank definitions in linker scripts
wdx04 Jul 26, 2026
983e4da
Merge branch 'add-renesas-ra' of https://github.com/wdx04/mbed-os int…
wdx04 Jul 26, 2026
271ebd8
added RAM vector table
wdx04 Jul 27, 2026
98ff6a8
more flexible clock settings for pwmout
wdx04 Aug 1, 2026
4a59768
Fix some bugs revealed by Greentea tests.
wdx04 Aug 4, 2026
7479569
updated linker scripts to include the options bytes
wdx04 Aug 5, 2026
829d643
passed Greentea's RTC tests
wdx04 Aug 6, 2026
14cdbbc
passed FlashIAP and Storage tests.
wdx04 Aug 6, 2026
a58a81c
bug fixes for CAN/CAN FD, support 5Mbps CAN FD data rate on FPB-RA8E1
wdx04 Aug 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .github/workflows/greentea_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ jobs:
profile: full
- target: RZ_A1H
profile: full
- target: FPB_RA4E1
profile: full
- target: FPB_RA6E2
profile: full
- target: FPB_RA8E1
profile: full

# Ambiq MCUs
- target: SFE_ARTEMIS_DK
Expand Down
16 changes: 13 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ A message that notes the main changes in the update.
- Added support for Real-Time Transfer (RTT), a method of transferring text from a target device using a debugger connection. RTT allows getting UART console-like behavior at a higher speed and with no additional wires to the target.
- RTT can be used automatically by Mbed via the `target.console-rtt` JSON option, or manually in code by linking the `mbed-rtt` CMake library and using the `RTTHandle` class.
- RTT is supported in the JLINK, OPENOCD, and PYOCD upload methods. RTT can be used with command-line development and VS Code, but not with CLion at this time.
- Added a new `MBED_NONCACHED` define which can be used to store global variables in non-cached memory on devices with a data cache. This is supported on STM32F7, STM32H7, and MIMXRT (which I believe are the only currently supported MCUs with a D-cache)
- Added a new global, `mbed_used_mpu_regions`, which gives the number of MPU regions used by Mbed. This is intended to allow applications to also use the MPU without creating breakages in the future if Mbed uses additional MPU regions.
- Added new header, `mbed_math_helpers.h`, containing some useful math functions. Currently this contains `mbed_integer_log_2()` and `mbed_is_power_of_two()`
- MIMRT117x: Memory bank configuration is now supported in the linker script.
- RP2xxx
- `RASPBERRY_PI_PICO_W` board target added (though note that the wi-fi module on this board is not currently supported, and would take a huge amount of effort to support, so the utility of this board compared to the non-W version is limited).
- `RASPBERRY_PI_PICO_W` board target added (though note that the wi-fi module on this board is not currently supported, and would take a huge amount of effort to support, so the utility of this board with Mbed compared to the non-W version is limited).
- `SFE_THING_PLUS_RP2040` board target added for the [SparkFun Thing Plus RP2040 board](https://www.sparkfun.com/sparkfun-thing-plus-rp2040.html)
- MPU configuration support added
- Support for single-byte i2c operations implemented (allowing features like the I2C EEPROM block device to work).
Expand All @@ -33,7 +37,8 @@ A message that notes the main changes in the update.
- Reworked targets CMake code to only recurse into the subdir for the current target family, which should speed up the CMake configure a bit
- The `I2C` class now keeps track of the I2C bus state and prevents you from doing operations that are obviously wrong, such as calling `start()` before `stop()` or calling `write_byte()` before `start()`. Previously these operations would get passed down to the HAL API which may or may not have appropriate error handling for them.
- The `I2C` class now detects and rejects attempts to perform a zero-length transaction on hardware which does not support it.
- Use `-Werror=return-type` in the default GCC flags so that a missing return statement in a function becomes a fatal error
- Use `-Werror=return-type` in the default GCC flags so that a missing return statement in a function becomes a fatal error
- On targets with a data cache (`__DCACHE_PRESENT` is defined), one additional MPU region is used to implement the new non-cacheable memory support.
- STM32F4
- HAL driver update to `stm32f4xx-hal-driver` v1.8.5 (2025), now integrated as a submodule.
- CMSIS device update to `cmsis-device-f4` v2.6.11 (2025), now integrated as a submodule.
Expand All @@ -50,7 +55,7 @@ A message that notes the main changes in the update.
- Standardized ROM names in `cmsis_mcu_descriptions` across STM32F7 targets.
- Replaced per-target linker scripts with one common STM32F7 linker script.
- Replaced most STM32F7 `system_clock.c` files with one common clock configuration.
- Added target metadata cleanup (`adc-vref`, `hse-value for all F7 targets).
- Added target metadata cleanup (`adc-vref`, `hse-value` for all F7 targets).
- Updated STM32F7 config/init files by consolidating Mbed changes with latest upstream templates. Removed unused Ethernet HAL sections from config (Mbed does not use ST Ethernet stack here)
- Applied interim local HAL fixes until upstream release includes them: https://github.com/STMicroelectronics/stm32f7xx-hal-driver/issues/23
- F7 Vector table size and vector start is now covered by linker script and all cmsis_nvic.h files were removed
Expand All @@ -63,6 +68,11 @@ A message that notes the main changes in the update.
- The `POWER_ON` reset reason is no longer supported on RP2040 because it could also be [erroneously triggered for non-actual-power-on reasons](https://forums.raspberrypi.com/viewtopic.php?p=2378084), like flashing code through OpenOCD. Mbed now returns the unknown reset reason if this flag is set in HW.
- STM32H5/H7
- `mem-size` of lwIP stack increased to 32768 from default 4000
- ESP32 Wi-Fi driver
- Added tested working modules and their firmware version
- Added note to increase RX buffer size to ensure data integrity and system stability
- Updated code to get RSSI from ESP32 module

### Deprecated

### Fixed
Expand Down
3 changes: 2 additions & 1 deletion TESTS/configs/greentea_full.json5
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
// This assumes that such boards (e.g. RASPBERRY_PI_PICO) have an external USB-serial
// adapter connected.
"target.console-usb": false,
"target.console-uart": true
"target.console-uart": true,
"target.console-rtt": false
}
}
11 changes: 11 additions & 0 deletions cmsis/device/rtos/TOOLCHAIN_GCC_ARM/mbed_boot_gcc_arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,18 @@ void mbed_toolchain_init()
env_mutex_id = osMutexNew(&env_mutex_attr);

/* Run the C++ global object constructors */
#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.

extern void (* __init_array_start[])(void);
extern void (* __init_array_end[])(void);
int32_t count = __init_array_end - __init_array_start;
for (int32_t i = 0; i < count; i++)
{
__init_array_start[i]();
}
#endif
}

extern int __real_main(void);
Expand Down
35 changes: 19 additions & 16 deletions connectivity/drivers/wifi/COMPONENT_ESPRESSIF_ESP32/ESP32/ESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,31 +624,34 @@ const char *ESP32::getNetmask_ap()

int8_t ESP32::getRSSI()
{
bool ret;
int8_t rssi[2]; /* It needs 1 byte extra. */
// Practically we only care about RSSI when a station is actually connected to AP
// The way AT+CWLAP operates has also changed since ESP8266 era therefore deprecated
// If we ever want to see the RSSI of AP with certain SSID
// Please parse a SSID str here then issue command: AT+CWLAP="SSID"
// Typical response will be:
// +CWLAP:(<ecn>,<"ssid">,<rssi>,<"mac">,<channel>,<freq_offset>,<freqcal_val>,<pairwise_cipher>,<group_cipher>,<wifi_protocol>,<wps>)
int rssi = -128/* the least possible RSSI value */;
if (!isConnected()) {
return rssi;
}

// The following 3 variables are not actually needed
// Declared to faciliate parsing
// Typical response to AT+CWJAP?
// +CWJAP:<"ssid">,<"bssid">,<channel>,<rssi>,<pci_en>,<reconn_interval>,<listen_interval>,<scan_mode>,<pmf>
char ssid[33];
char bssid[18];
int elements[6];
bool ret;

_smutex.lock();
_startup_wifi();
ret = _parser.send("AT+CWJAP?")
&& _parser.recv("+CWJAP:\"%32[^\"]\",\"%17[^\"]\"", ssid, bssid)
&& _parser.recv("OK");
if (!ret) {
_smutex.unlock();
return 0;
}

ret = _parser.send("AT+CWLAP=\"%s\",\"%s\"", ssid, bssid)
&& _parser.recv("+CWLAP:(%*d,\"%*[^\"]\",%hhd,", &rssi[0])
&& _parser.recv("+CWJAP:\"%32[^\"]\",\"%17[^\"]\",%d,%d,%d,%d,%d,%d,%d", ssid, bssid, &elements[0], &rssi, &elements[1], &elements[2], &elements[3], &elements[4], &elements[5])
&& _parser.recv("OK");
_smutex.unlock();

if (!ret) {
return 0;
}

return rssi[0];
return ret ? rssi : -128;
}

int ESP32::scan(WiFiAccessPoint *res, unsigned limit)
Expand Down
14 changes: 12 additions & 2 deletions connectivity/drivers/wifi/COMPONENT_ESPRESSIF_ESP32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@
The Mbed OS driver for the ESP32 WiFi module.

## Firmware version
How to write mbed-os compatible firmware for GR-LCYHEE and GR-PEACH.
https://github.com/d-kato/GR-Boards_ESP32_Serial_Bridge
The following ESP32 modules and firmware versions have been tested working: ESP32-WROOM-32-AT-V3.4.0.0, ESP32-S2-MINI_AT_Bin_V2.1.0.0, ESP32-S2-MINI-AT-V3.4.0.0, ESP32-S2-MINI-AT-V4.1.1.0, ESP32-S2-MINI-AT-V4.2.0.0, ESP32-C5-AT-v5.0.0.0, ESP32-C5-AT-v5.0.1.0

## Mbed OS BLE stack using ESP32
You can use the Mbed OS BLE stack with ESP32 by using [esp32-at-ble-stack.lib](https://github.com/d-kato/esp32-at-ble-stack).

## Restrictions
- Setting up an UDP server is not possible

## Note:
Please consider increasing the size of RX buffer of BufferedSerial class that underpins this driver if one of the following use cases are involved:
- ESP32 is used to download large files
- HTTPS is used
- Concurrent HTTP/HTTPS and other network requests such as WS/WSS
- Other thread(s) with higher priority may hog CPU for longer time than it takes to fillup RX buffer
The default RX buffer is limited at 256. Data might be lost while your system is busy handling other tasks. This may even make system unstable. To increase the RX buffer size of BufferedSerial class, please add the following entry into the `target_overrides` section of `mbed_app.json5`, either globally or a particular target.
```
"drivers.uart-serial-rxbuf-size": 2048,
```
3 changes: 2 additions & 1 deletion doxyfile_options
Original file line number Diff line number Diff line change
Expand Up @@ -2356,7 +2356,8 @@ PREDEFINED = DOXYGEN_ONLY \
BLE_FEATURE_WHITELIST=1 \
BLE_FEATURE_PRIVACY=1 \
BLE_FEATURE_PERIODIC_ADVERTISING=1 \
BLE_FEATURE_EXTENDED_ADVERTISING=1
BLE_FEATURE_EXTENDED_ADVERTISING=1 \
__DCACHE_PRESENT=1

# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
Expand Down
4 changes: 2 additions & 2 deletions features/frameworks/rtt/RTTHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class RTTHandle : public FileHandle {
* @param down_buffer_size Size of the down buffer in bytes.
* @param name Optional name to give this channel.
*
* @warning On targets with a data cache, the up and down buffer memory needs to be declared in the section
* defined by \c SEGGER_RTT_SECTION, or otherwise placed into non-cachable memory. The same is true for
* @warning On targets with a data cache, the up and down buffer memory needs to be declared as \c MBED_NONCACHED ,
* or otherwise placed into non-cachable memory. The same is true for
* \c name if it is not a string constant in flash.
*/
RTTHandle(unsigned int buffer_index, char * up_buffer, size_t up_buffer_size, char * down_buffer, size_t down_buffer_size, char const * name = nullptr);
Expand Down
6 changes: 4 additions & 2 deletions features/frameworks/rtt/SEGGER_RTT_Conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#ifndef __ASSEMBLER__
#include "device.h" // for __DCACHE_PRESENT
#include "mbed_critical.h"
#include "mbed_toolchain.h"
#endif

// Buffer counts and sizes
Expand All @@ -38,6 +39,7 @@
// Cache setup
#if __DCACHE_PRESENT
// NOTE: On targets with a data cache, the RTT control block and buffers must be put in an uncached section of memory.
// This requires that the linker script contain logic to place the ".rtt" section.
#define SEGGER_RTT_SECTION ".rtt"
// This requires that the linker script contain logic to place the ".noncached" section.
#define SEGGER_RTT_SECTION MBED_NONCACHED_SECTION_NAME
#define SEGGER_RTT_BUFFER_SECTION MBED_NONCACHED_SECTION_NAME
#endif
26 changes: 26 additions & 0 deletions features/frameworks/rtt/mbed_lib.json5
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,32 @@
"max-channels": {
help: "Maximum number of channels supported by RTT. This controls the size of some static arrays within the RTT code. Note that this does NOT, by itself, allocate space for the buffers.",
value: 3
},
"cb-search-range-start": {
help: "Override the start (first address) of the search range that will be used when a debugger searches for the RTT control block.",
value: null
},
"cb-search-range-end": {
help: "Override the end (last address) of the search range that will be used when a debugger searches for the RTT control block.",
value: null
}
},
target_overrides: {
"MCU_STM32H7": {
// STM32H7 has an ITCM bank at address 0, which then causes OpenOCD to fault out when searching for the RTT control
// block between the end of that bank and the start of the next one. So, manually target SRAM_D1
"cb-search-range-start": 0x24000000,
"cb-search-range-end": 0x2407FFFF
},
"MIMXRT105X": {
// RTT lives in DTCM
"cb-search-range-start": 0x20000000,
"cb-search-range-end": 0x2023FFFF
},
"MIMXRT1170": {
// RTT lives in OCRAM combined
"cb-search-range-start": 0x20240000,
"cb-search-range-end": 0x2035FFFF
}
}
}
60 changes: 56 additions & 4 deletions hal/include/hal/mpu_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

#include "device.h"
#include <stdbool.h>
#include "cmsis.h"

#include <mstd_cstddef>

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -60,6 +63,55 @@ extern "C" {
* mbed test -t <toolchain> -m <target> -n tests-mbed_hal-mpu*
*/

#if !defined(MBED_MPU_CUSTOM)

#ifdef MBED_CONF_TARGET_MPU_ROM_END
#define MBED_MPU_ROM_END MBED_CONF_TARGET_MPU_ROM_END
#else
#define MBED_MPU_ROM_END (0x10000000 - 1)
#endif

#ifdef MBED_CONF_TARGET_MPU_RAM_START
#define MBED_MPU_RAM_START MBED_CONF_TARGET_MPU_RAM_START
#else
// Default to the end of ROM
#define MBED_MPU_RAM_START (MBED_MPU_ROM_END + 1)
#endif

#if ((__ARM_ARCH_8M_BASE__ == 1U) || (__ARM_ARCH_8M_MAIN__ == 1U) || (__ARM_ARCH_8_1M_MAIN__ == 1U))
/// On ARMv8 cores, MPU regions must use one of 8 global "attribute registers", which give the attributes
/// for one or more memory regions. This enum gives the attribute registers (i.e. the first arg to
/// \c ARM_MPU_SetMemAttr() ) that are defined by Mbed.
/// The application is free to use attribute registers above this number.
enum mbed_mpu_attr_index {
/// Normal memory, write-through (i.e. writes are always sent immediately to main memory)
MBED_MPU_ATTR_INDEX_NORMAL_WRITE_THROUGH = 0,

/// Normal memory, write-back (i.e. writes may only write to the cache immediately, and get synced to main memory later)
MBED_MPU_ATTR_INDEX_NORMAL_WRITE_BACK = 1,

/// Non-cacheable: Reads and writes hit main memory directly.
/// Note that this is still normal memory, not device, so the CPU can still reorder accesses.
MBED_MPU_ATTR_INDEX_NON_CACHEABLE = 2,
};
#endif

/// Number of MPU regions that will be used by Mbed OS's MPU configuration.
/// The application is generally free to use regions above this number.
static MSTD_CONSTEXPR_OBJ_11 size_t mbed_used_mpu_regions =
#if ((__ARM_ARCH_8M_BASE__ == 1U) || (__ARM_ARCH_8M_MAIN__ == 1U) || (__ARM_ARCH_8_1M_MAIN__ == 1U))
4
#else
3
#endif
#if MBED_MPU_RAM_START < 0x20000000
+ 1
#endif
#if __DCACHE_PRESENT
+ 1
#endif
;
#endif

/**
* Initialize the MPU
Expand All @@ -78,9 +130,9 @@ void mbed_mpu_init(void);
*
* By default writes to ROM are disabled.
*
* @param enable true to disable writes to ROM, false otherwise
* @param disable true to disable writes to ROM, false otherwise
*/
void mbed_mpu_enable_rom_wn(bool enable);
void mbed_mpu_enable_rom_wn(bool disable);

/**
* Enable or disable ram MPU protection
Expand All @@ -90,9 +142,9 @@ void mbed_mpu_enable_rom_wn(bool enable);
*
* By default execution from RAM is disabled.
*
* @param enable true to disable execution from RAM, false otherwise
* @param disable true to disable execution from RAM, false otherwise
*/
void mbed_mpu_enable_ram_xn(bool enable);
void mbed_mpu_enable_ram_xn(bool disable);

/** Deinitialize the MPU
*
Expand Down
Loading
Loading