Skip to content

Commit 9dbdbe8

Browse files
committed
Enable stats reporting with a flag in targets.json
### Description PR #8607 will cause problems for the NRF52832 and the NRF52840 in the online compiler starting with 5.10.2. This PR prevents this problem by using a toggle in `targets.json` to enable these new defines for every target except for the NRF52832 and NRF52840. ### Pull request type [x] Fix [ ] Refactor [ ] Target update [ ] Functionality change [ ] Docs update [ ] Test update [ ] Breaking change
1 parent 0a832dd commit 9dbdbe8

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.",
@@ -6501,6 +6502,7 @@
65016502
"MCU_NRF52832": {
65026503
"inherits": ["Target"],
65036504
"core": "Cortex-M4F",
6505+
"static_memory_defines": false,
65046506
"macros": [
65056507
"BOARD_PCA10040",
65066508
"NRF52",
@@ -6620,6 +6622,7 @@
66206622
"MCU_NRF52840": {
66216623
"inherits": ["Target"],
66226624
"core": "Cortex-M4F",
6625+
"static_memory_defines": false,
66236626
"macros": [
66246627
"BOARD_PCA10056",
66256628
"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)