Skip to content

Commit 6ea826f

Browse files
theotherjimmyadbridge
authored andcommitted
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 e09493e commit 6ea826f

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.",
@@ -6482,6 +6483,7 @@
64826483
"MCU_NRF52832": {
64836484
"inherits": ["Target"],
64846485
"core": "Cortex-M4F",
6486+
"static_memory_defines": false,
64856487
"macros": [
64866488
"BOARD_PCA10040",
64876489
"NRF52",
@@ -6596,6 +6598,7 @@
65966598
"MCU_NRF52840": {
65976599
"inherits": ["Target"],
65986600
"core": "Cortex-M4F",
6601+
"static_memory_defines": false,
65996602
"macros": [
66006603
"BOARD_PCA10056",
66016604
"NRF52840_XXAA",

tools/toolchains/__init__.py

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

756756
try:
757757
# Add all available ROM regions to build profile
758+
if not getattr(self.target, "static_memory_defines", False):
759+
raise ConfigException()
758760
rom_available_regions = self.config.get_all_active_memories(ROM_ALL_MEMORIES)
759761
for key, value in rom_available_regions.items():
760762
rom_start, rom_size = value
@@ -767,6 +769,8 @@ def add_regions(self):
767769
pass
768770
try:
769771
# Add all available RAM regions to build profile
772+
if not getattr(self.target, "static_memory_defines", False):
773+
raise ConfigException()
770774
ram_available_regions = self.config.get_all_active_memories(RAM_ALL_MEMORIES)
771775
for key, value in ram_available_regions.items():
772776
ram_start, ram_size = value

0 commit comments

Comments
 (0)