Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
29b3d64
Start on using pydantic schemas. mbed_lib.json schema working!
multiplemonomials Nov 2, 2025
4ead881
Start on schema for targets.json5
multiplemonomials Nov 3, 2025
6b03241
Schema almost done, start removing old stuff from targets.json5
multiplemonomials Nov 3, 2025
15fa326
Add memory bank schema
multiplemonomials Nov 4, 2025
69773b8
Still crunching away on targets.json5
multiplemonomials Nov 6, 2025
37eb1c8
Finish targets.json5 logic, appears to generate config correctly!
multiplemonomials Nov 16, 2025
7956f2c
Implement schema for mbed_app.json5
multiplemonomials Nov 16, 2025
bac95f0
Fix tests
multiplemonomials Nov 16, 2025
8aab639
Use `Self`
multiplemonomials Nov 17, 2025
753d2d3
Use legacy Union
multiplemonomials Nov 17, 2025
6061fba
Install eval_type_backport
multiplemonomials Nov 17, 2025
1a59256
Fix another union to be legacy
multiplemonomials Nov 17, 2025
3d2dcc2
Import future annotations
multiplemonomials Nov 17, 2025
342edb2
Maybe I should just install python 3.7 locally...
multiplemonomials Nov 17, 2025
e6bff90
Another one
multiplemonomials Nov 17, 2025
54ce011
Another
multiplemonomials Nov 17, 2025
23e9c7d
OK let's do this for every remaining python file
multiplemonomials Nov 17, 2025
bfcc22d
Fix compatibility with pydantic<2.12
multiplemonomials Nov 17, 2025
04b7bd8
Fix test building in baremetal (due to previously ignored JSON config…
multiplemonomials Nov 17, 2025
c1a8ee1
One more
multiplemonomials Nov 17, 2025
4709771
options -> accepted_values
multiplemonomials Nov 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions TESTS/configs/greentea_baremetal.json5
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{
"target_overrides": {
"*": {
"target.c_lib": "small",
"target.application-profile": "bare-metal"
}
},
"overrides": {
"target.c_lib": "small",

"target.application-profile": "bare-metal",

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Based on my reverse engineering of the code, using overrides and target_overrides at the same time used to be unsafe (though this should be fixed now)

// Enable Mbed Stats tests
"platform.all-stats-enabled": 1,

Expand Down
1 change: 0 additions & 1 deletion cmsis/device/rtos/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "rtos",
"config": {
"present": 1,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removing these legacy config defines everywhere.

"main-thread-stack-size": {
"help": "The size of the main thread's stack",
"value": 4096
Expand Down
1 change: 0 additions & 1 deletion connectivity/FEATURE_BLE/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "ble",
"requires": ["ble-api-implementation"],
"config": {
"present": 1,
"ble-role-observer": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"name": "cordio-stm32wb",
"requires": ["cordio", "ble"]
Copy link
Collaborator Author

@multiplemonomials multiplemonomials Nov 16, 2025

Choose a reason for hiding this comment

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

I am removing all remaining vestiges of this "requires" system in this PR. This dates back from Mbed CLI 1 and could be used to specify dependencies between libraries. Now, library dependencies should be, and are, specified via CMake, and this system was serving only to exclude non-required libraries' mbed_lib.json5 files from processing if the user added "requires" to their mbed_app.json5 file.

This does mean that users no longer have the option to speed up JSON processing / reduce the number of MBED_CONF_xxx defines via using requires, but this option was not used by default and I am quite doubtful that anyone knew it even worked in Mbed CLI 2.

"name": "cordio-stm32wb"
}
1 change: 0 additions & 1 deletion connectivity/drivers/lora/COMPONENT_SX126X/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "SX126X-lora-driver",
"requires": ["lora"],
"config": {
"spi-frequency": {
"help": "SPI frequency, Default: 16 MHz",
Expand Down
1 change: 0 additions & 1 deletion connectivity/drivers/lora/COMPONENT_SX1272/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "sx1272-lora-driver",
"requires": ["lora"],
"config": {
"spi-frequency": {
"help": "SPI frequency, Default: 8 MHz",
Expand Down
1 change: 0 additions & 1 deletion connectivity/drivers/lora/COMPONENT_SX1276/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "sx1276-lora-driver",
"requires": ["lora"],
"config": {
"spi-frequency": {
"help": "SPI frequency, Default: 8 MHz",
Expand Down
1 change: 0 additions & 1 deletion connectivity/drivers/lora/TARGET_STM32WL/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "stm32wl-lora-driver",
"requires": ["lora"],
"config": {
"buffer-size": {
"help": "Max. buffer size the radio can handle, Default: 255 B",
Expand Down
1 change: 0 additions & 1 deletion connectivity/lorawan/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "lora",
"requires": ["mbedtls", "events"],
"config": {
"phy": {
"help": "LoRa PHY region: EU868, AS923, AU915, CN470, CN779, EU433, IN865, KR920, US915",
Expand Down
1 change: 0 additions & 1 deletion connectivity/lwipstack/mbed_lib.json5
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "lwip",
"config": {
"present": 1,
"ipv4-enabled": {
"help": "Enable IPv4",
"value": true
Expand Down
1 change: 0 additions & 1 deletion connectivity/nanostack/mbed-mesh-api/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "mbed-mesh-api",
"requires": ["nanostack"],
"config": {
"heap-size": {
"help": "Nanostack's heap size [bytes: 0-4294967295]",
Expand Down
3 changes: 1 addition & 2 deletions connectivity/nanostack/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"name": "nanostack-interface",
"requires": ["nanostack"]
"name": "nanostack-interface"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "nanostack-eventloop",
"requires": ["nanostack-hal"],
"config": {
"use_platform_tick_timer": {
"help": "Use platform provided low resolution tick timer for eventloop",
Expand Down
1 change: 0 additions & 1 deletion connectivity/nanostack/sal-stack-nanostack/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "nanostack",
"requires": ["nanostack-eventloop", "coap-service"],
"config": {
"configuration": {
"help": "Build time configuration. Refer to Handbook for valid values. Default: full stack",
Expand Down
1 change: 0 additions & 1 deletion connectivity/netsocket/mbed_lib.json5
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "nsapi",
"config": {
"present": 1,
"add-event-listener-return-change": {
"help": "Updates the add_event_listener to return a nsapi_error_t value which can indicate allocation failure. See documents for more details.",
"value": 0
Expand Down
1 change: 0 additions & 1 deletion events/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "events",
"config": {
"present": 1,
"shared-stacksize": {
"help": "Stack size (bytes) for shared event queue thread",
"value": 2048
Expand Down
5 changes: 1 addition & 4 deletions features/frameworks/cy_rtos_rtx_adapter/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"name": "cy_psoc6csp_rtos",
"config": {
"present": 1
}
"name": "cy_psoc6csp_rtos"
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
{
"name": "psa-services",
"requires": [
"drivers",
"platform",
"mbedtls",
"storage",
"flashiap-block-device",
"kv-global-api",
"storage_tdb_internal"
]
"name": "psa-services"
}
3 changes: 1 addition & 2 deletions platform/bare_metal/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"name": "bare-metal",
"requires": ["platform", "drivers", "rtos-api", "mbed-trace", "blockdevice"]
"name": "bare-metal"
}
2 changes: 1 addition & 1 deletion platform/mbed-trace/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"color-theme": {
"help": "Set color theme. 0 for readable, 1 for unobtrusive.",
"options": [0, 1],
"accepted_values": [0, 1],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As far as I could tell, there was no accepted way to specify the range of legal values for an option until now. So, people added stuff like this as "wishful thinking" / for documentation only (remember this was json so you couldn't have comments).

This PR turns this wish into a reality with the new accepted_values, value_max, and value_min options.

"macro_name": "MBED_TRACE_COLOR_THEME",
"value": 0
},
Expand Down
5 changes: 1 addition & 4 deletions rtos/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"name": "rtos-api",
"config": {
"present": 1
}
"name": "rtos-api"
}
5 changes: 1 addition & 4 deletions storage/filesystem/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"name": "filesystem",
"config": {
"present": 1
}
"name": "filesystem"
}
38 changes: 0 additions & 38 deletions storage/kvstore/kv_config/filesystem_no_rbp/mbed_lib.json
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have no idea what this file was for as it's in an empty folder, I removed it.

This file was deleted.

3 changes: 1 addition & 2 deletions storage/kvstore/kvstore_global_api/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"name": "kv-global-api",
"requires": ["kvstore"]
"name": "kv-global-api"
}
Loading
Loading