-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
matter/fast pair: Add support for merging hex files without partition manager #18792
matter/fast pair: Add support for merging hex files without partition manager #18792
Conversation
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
CI InformationTo view the history of this post, clich the 'edited' button above Inputs:Sources:sdk-nrf: PR head: 63ac22028d253f0e691b971246f6d53d5994a37e more detailssdk-nrf:
matter:
Github labels
List of changed files detected by CI (10)
Outputs:ToolchainVersion: f51bdba1d9 Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds. Note: This comment is automatically posted by the Documentation Publishing GitHub Action. |
Memory footprint analysis revealed the following potential issuessample.matter.template.release[nrf7002dk/nrf5340/cpuapp]: High ROM usage: 811902[B] - link (cc: @kkasperczyk-no @ArekBalysNordic @markaj-nordic) Note: This message is automatically posted and updated by the CI (latest/sdk-nrf/PR-18792/9) |
4df741a
to
2b3619b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
storage_partition: partition@1e3000 { | ||
reg = <0x1e3000 DT_SIZE_K(20)>; | ||
}; | ||
|
||
bt_fast_pair_partition: partition@1e8fb8 { | ||
label = "bt_fast_pair"; | ||
reg = <0x1e8fb8 0x48>; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if the addresses are correct. 20kB is equal to 0x5000 so I think the bt_fast_pair_partition
address should be set to 0x1e8000 (0x1e3000 + 0x5000) instead of 0x1e8fb8. Correct me if I'm wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I positioned it at the end of the 0x1000 memory chunk to mimick the PM solution in the case of automatic builds without the specific memory layout file (pm.yaml). On the other hand, we typically position the provisioning data at the beginning of the 0x1000 memory chunk in builds where we define the memory layout file (pm.yaml).
@alstrzebonski, I don't have a preference here. We can align it according to your suggestion or we can leave this part and think about the position of the fast pair provisioning data hex in the nRF54H20 memory in the follow-up task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be aligned to my suggestion or, if we want to mimic the PM, we should add the comment explaining the gap in the memory map. I'm okay with both solutions. It can be also left as is and improved in follow-up task - maybe that's the best option considering it's @nordicjm's PR. It will be easier to leave it as is for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alstrzebonski, could you create a follow-up task?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: 0x1e8fb8
is not divisible by 128 bits, which is the "erase block" for MRAM, so this assignment is OK as long as you do not need to erase this partition using flash_*
APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomchy - just to make sure - you're referring here to write-block-size which is equal to 16 bytes? That means that addresses should be divisible by 0x10. Am I correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Fast Pair part looks good to me. The configurations aspects of Fast Pair (e.g. partition position) can be improved in the follow-up PRs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple of observations and a small proposal improvement, but nothing blocking.
set_property( | ||
GLOBAL APPEND PROPERTY SUIT_POST_BUILD_COMMANDS | ||
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py | ||
--overlap replace | ||
-o ${OUTPUT_HEX_FILE} | ||
${ARTIFACTS_TO_MERGE} | ||
${ARTIFACTS_TO_MERGE} ${merge_files} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
observation: this is really not self-explaining what the difference between ARTIFACTS_TO_MERGE
and merge_files
is.
But as this file in general is messy, then there is not change requested for this PR.
2b3619b
to
5e5c4f7
Compare
You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds. Note: This comment is automatically posted by the Documentation Publish GitHub Action. |
set_property( | ||
GLOBAL APPEND PROPERTY SUIT_POST_BUILD_COMMANDS | ||
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py | ||
--overlap replace | ||
-o ${OUTPUT_HEX_FILE} | ||
${ARTIFACTS_TO_MERGE} | ||
${ARTIFACTS_TO_MERGE} ${merge_files} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intentional to merge those files multiple times (see a for loop in line 505)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this ran multiple times? Is this for multiple cores?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, once for each domain (app and radio in case of nRF54H). This is the most challenging part of the whole mergehex process - it is important which debugger passes which HEX files, thus two uicr_merged.hex files are generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So how do you know what device the current image is for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could define the SUIT_MERGE_FILE
property independently for each image and make the caller of suit_add_merge_hex_file
(e.g. Fast Pair CMake) responsible for indicating the target image.
However, since the Matter PR has already been merged, I suggest making this improvement in the follow-up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since SUIT is supported on nRF54H20 only, it is assumed in this preliminary implementation that the device is the nRF54H SoC.
When it comes to the domains - any sysbuild image that has IMAGE_TARGET_NAME
and CONFIG_NRF_REGTOOL_GENERATE_UICR
defined is assumed to be the main image for the domain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that we may have customer use cases in which the provisioned data needs to be placed in the Radio Core image together with their "main application". Some customers won't use the Application Core to minimize the latency in their radio-based applications (IPC delay). That's why I suggested adding the image argument to the suit_add_merge_hex_file
function to make the overall provisioning solution more flexible.
However, for now, I think it is enough to support only provisioning for the main image of the Application Core.
Adds support for merging other files onto the uicr_merged.hex file of the application core Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Adds support for generating fast pair data for nRF54H20 which does not use partition manager Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no> Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Added nRF54H20 DK support to the Fast Pair Input Device sample. Ref: NCSDK-29602 Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Updates matter to include support for generating factory data when partition manager is not used Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Calls the updated factory data function irrespective of partition manager enablement Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
5e5c4f7
to
63ac220
Compare
For nRF54H20 only