Skip to content

Commit a91dccd

Browse files
authored
Merge pull request #9072 from theotherjimmy/toggle-memory-defines
Enable stats reporting with a flag in targets.json
2 parents 27e1bc3 + 9dbdbe8 commit a91dccd

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

targets/targets.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"public": false,
1414
"default_lib": "std",
1515
"bootloader_supported": false,
16+
"static_memory_defines": true,
1617
"config": {
1718
"console-uart-flow-control": {
1819
"help": "Console hardware flow control. Options: null, RTS, CTS, RTSCTS.",
@@ -6514,6 +6515,7 @@
65146515
"MCU_NRF52832": {
65156516
"inherits": ["Target"],
65166517
"core": "Cortex-M4F",
6518+
"static_memory_defines": false,
65176519
"macros": [
65186520
"BOARD_PCA10040",
65196521
"NRF52",
@@ -6633,6 +6635,7 @@
66336635
"MCU_NRF52840": {
66346636
"inherits": ["Target"],
66356637
"core": "Cortex-M4F",
6638+
"static_memory_defines": false,
66366639
"macros": [
66376640
"BOARD_PCA10056",
66386641
"NRF52840_XXAA",

tools/toolchains/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ def add_regions(self):
761761

762762
try:
763763
# Add all available ROM regions to build profile
764+
if not getattr(self.target, "static_memory_defines", False):
765+
raise ConfigException()
764766
rom_available_regions = self.config.get_all_active_memories(ROM_ALL_MEMORIES)
765767
for key, value in rom_available_regions.items():
766768
rom_start, rom_size = value
@@ -773,6 +775,8 @@ def add_regions(self):
773775
pass
774776
try:
775777
# Add all available RAM regions to build profile
778+
if not getattr(self.target, "static_memory_defines", False):
779+
raise ConfigException()
776780
ram_available_regions = self.config.get_all_active_memories(RAM_ALL_MEMORIES)
777781
for key, value in ram_available_regions.items():
778782
ram_start, ram_size = value

0 commit comments

Comments
 (0)