Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy memory regions and sectors from tools/arm_pack_manager/index.json to targets.json (On hold) #14975

Closed
wants to merge 3 commits into from

Conversation

rajkan01
Copy link
Contributor

@rajkan01 rajkan01 commented Aug 3, 2021

Summary of changes

fixes ARMmbed/mbed-tools#271
Previously Mbed CLI1 parses index.json to get the memory information and sectors information for a target which has bootloader_supported with true in targets configuration in targets.json as going further with CLI2 like to get mem and sectors info from target.json as part of targets configuration, so this PR changes copy mem regions and sectors info into targets JSON and retain the existing mem and sectors info in index.json until CLI1 is deprecated

Impact of changes

None.

Migration actions required

As going further new targets gets added or existing targets have to add/update mem and sectors info in targets.json instead of index.json

Documentation

None.


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Aug 3, 2021
@ciarmcom ciarmcom requested a review from a team August 3, 2021 12:30
@ciarmcom
Copy link
Member

ciarmcom commented Aug 3, 2021

@rajkan01, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

@ciarmcom ciarmcom added needs: review stale Stale Pull Request labels Aug 3, 2021
@ciarmcom
Copy link
Member

ciarmcom commented Aug 6, 2021

This pull request has automatically been marked as stale because it has had no recent activity. @ARMmbed/mbed-os-maintainers, please complete review of the changes to move the PR forward. Thank you for your contributions.

@ciarmcom ciarmcom added stale Stale Pull Request and removed stale Stale Pull Request labels Aug 6, 2021
Patater
Patater previously requested changes Aug 9, 2021
@@ -1689,7 +1787,11 @@
"SERIAL_ASYNCH",
"FLASH",
"MPU"
]
],
"mbed_rom_start": "0x8000000",
Copy link
Contributor

Choose a reason for hiding this comment

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

Which device in index.json did these come from?

Should we add a "device_name": "somedevice" entry here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

MCU_STM32xxxx represents a "family" of devices with RAM and ROM common values.
But you can't define a specific device_name here, this has to be defined in the board target.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

device_name: STM32F303RETx and target NUCLEO_F303RE & device name : STM32F303ZETx and target NUCLEO_F303ZE.

Both device_name has similar memory configuration and both targets inherited from MCU_STM32F303xE

@@ -1834,7 +1946,11 @@
],
"extra_labels_add": [
"STM32F411xE"
]
],
"mbed_rom_start": "0x8000000",
Copy link
Contributor

Choose a reason for hiding this comment

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

Which device in index.json are these from? Should we add "device_name"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Targets: NUCLEO_F411RE, MTS_DRAGONFLY_F411RE, MTS_MDOT_F411RE has from the same device_name: STM32F411RETx and all targets are inherited from MCU_STM32F411xE family device

@@ -1906,7 +2022,11 @@
"device_has_add": [
"CAN",
"TRNG"
]
],
"mbed_rom_start": "0x8000000",
Copy link
Contributor

Choose a reason for hiding this comment

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

Which device in index.json are these from? Should we add "device_name"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Targets: NUCLEO_F412ZG, WIO_EMW3166 has the same device_name: STM32F412ZGTx and all targets are inherited from MCU_STM32F412xG family

"mbed_rom_start": "0x8000000",
"mbed_rom_size": "0x100000",
"mbed_ram_start": "0x20000000",
"mbed_ram_size": "0x40000"
},
"NUCLEO_F412ZG": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add rom and ram entries for the NUCLEO_F412ZG target directly? I see it inherits from MCU_STM32F412xG to get these, but we are putting "device_name" here, not under MCU_STM32F412xG. Shouldn't we keep "device_name" entries next to the mbed_rom_* and mbed_ram_* entries to make it easy to verify which device the values came from in index.json?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is better to keep memory info in the device family instead of duplicating the same configuration.

And In this case Targets: NUCLEO_F412ZG, WIO_EMW3166 has the same device_name: STM32F412ZGTx and both targets are derived from the same MCU_STM32F412xG family

@@ -7601,6 +8028,8 @@
"CYBSP_WIFI_CAPABLE"
],
"device_name": "CY8C6247BZI-D54",
"mbed_rom_start": "0x10000000",
"mbed_rom_size": "0x100000",
"mbed_ram_start": "0x08002000",
"mbed_ram_size": "0x00045800",
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these RAM values correct? They seem to have similar issues to the CY8C624ABZI-D44 issues.

@@ -7642,6 +8071,8 @@
"PSOC6"
],
"device_name": "CY8C6347BZI-BLD53",
"mbed_rom_start": "0x10000000",
"mbed_rom_size": "0x100000",
"mbed_ram_start": "0x08002000",
"mbed_ram_size": "0x00045800",
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these RAM values correct? They seem to have similar issues to the CY8C624ABZI-D44 issues.

@@ -7686,6 +8117,8 @@
"CYBSP_WIFI_CAPABLE"
],
"device_name": "CY8C6247BZI-D54",
"mbed_rom_start": "0x10000000",
"mbed_rom_size": "0x100000",
"mbed_ram_start": "0x08002000",
"mbed_ram_size": "0x00045800",
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these RAM values correct? They seem to have similar issues to the CY8C624ABZI-D44 issues.

@@ -7741,6 +8174,8 @@
"CYBSP_WIFI_CAPABLE"
],
"device_name": "CY8C6247FDI-D52",
"mbed_rom_start": "0x10000000",
"mbed_rom_size": "0x100000",
"mbed_ram_start": "0x08002000",
"mbed_ram_size": "0x00045800",
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these RAM values correct? They seem to have similar issues to the CY8C624ABZI-D44 issues.

65536,
32768
]
],
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this change tested in CI? What tests would fail in our CI if we got these sector values incorrect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I am not wrong, currently, we don't have any test available to test the sector values.

@ciarmcom ciarmcom removed the stale Stale Pull Request label Aug 9, 2021
@Patater
Copy link
Contributor

Patater commented Aug 9, 2021

I'm curious to know which greentea tests require adding this sectors and ram_start stuff. Could you add that in the commit message as part of the "why" behind these changes?

Copy link
Collaborator

@jeromecoutant jeromecoutant left a comment

Choose a reason for hiding this comment

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

This is a big change, please don't merge it just before a new release version...

You could also remove arm_pack_manager/index.json to validate the changes...?

"mbed_ram_size": "0x40000",
"sectors" : [
[ 134217728, 4096 ],
[ 134221824, 4096 ],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Only 1 line is needed ?

@ciarmcom ciarmcom added the stale Stale Pull Request label Aug 19, 2021
@ciarmcom
Copy link
Member

This pull request has automatically been marked as stale because it has had no recent activity. @rajkan01, please carry out any necessary work to get the changes merged. Thank you for your contributions.

@ciarmcom ciarmcom added stale Stale Pull Request and removed stale Stale Pull Request labels Aug 20, 2021
@ciarmcom ciarmcom added stale Stale Pull Request and removed stale Stale Pull Request labels Aug 27, 2021
@ciarmcom ciarmcom added stale Stale Pull Request and removed stale Stale Pull Request labels Sep 3, 2021
@ciarmcom ciarmcom added stale Stale Pull Request and removed stale Stale Pull Request labels Sep 10, 2021
Previously mbed CLI1 parses index.json to get the memory information as
going further with CLI2 like to get mem info from target.json as part of
targets configuration, so this PR changes copy all memory regions into
targets JSON and retain the existing mem info in index.json until CLI1 deprecate
Previously mbed CLI1 parses index.json to get the sector information for
a target which has "bootloader_supported" with "true" in targets
configuration in targets.json as going further with CLI2 like to get
sectors info from target.json as part of targets configuration, so
this PR changes copy sectors info into targets JSON and retain the
existing sectors info in index.json until CLI1 deprecate
@rajkan01 rajkan01 force-pushed the copy_mem_sectors_config branch from f99b803 to 9ceccca Compare September 14, 2021 15:10
@mergify mergify bot dismissed Patater’s stale review September 14, 2021 15:10

Pull request has been modified.

@ciarmcom ciarmcom removed the stale Stale Pull Request label Sep 14, 2021
@jeromecoutant
Copy link
Collaborator

Removing index.json file will break the export feature which is well appreciated by customers

@rajkan01 rajkan01 added stale Stale Pull Request and removed needs: work release-type: patch Indentifies a PR as containing just a patch labels Sep 17, 2021
@rajkan01 rajkan01 changed the title Copy memory regions and sectors from tools/arm_pack_manager/index.json to targets.json Copy memory regions and sectors from tools/arm_pack_manager/index.json to targets.json (On hold) Sep 21, 2021
@rajkan01
Copy link
Contributor Author

When we copy the mbed_rom_size, mbed_ram_size configs from index.json to targets.json causes the build failure for non-bootloader supported targets as MBED CLI1 expects that if any of the mem (ROM, RAM) configs are present in targets.json should have bootloader support, so putting these PR changes on hold until MBED CLI1 is deprecated.

Meanwhile introducing new rom-size and ram-size using config in targets.json to generate MBED_CONF_TARGET_ROM_SIZE and MBED_CONF_TARGET_RAM_SIZE macros by Mbed CLI1 and Mbed CLI2 which can be used in the greentea test.

@mergify
Copy link

mergify bot commented Oct 1, 2021

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 9, 2022

We are closing this pull request due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate memory regions from tools/arm_pack_manager/index.json to targets.json
7 participants