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
Expose target_offset and header_offset parameters in targets.json #12081
Conversation
@micgur01, thank you for your changes. |
Where are the APPLICATION_ADDR and HEADER_ADDR coming from? I can't see their definition in target.json so I assume they are defined elsewhere. Should we add the offset to the same place to keep it consistent? |
These values ( |
@bulislaw As mentioned in PR description the auto defined macros ( Instead we have chosen to expose the the offset macros which are always present at build time via autogenerated mbed_config.h The changes purposed in this PR have a workaround nature as they do not address original problem. But these changes allow us to move forward without introducing duplications in application level config files. I think the whole portion of logic around bootloader builds should be carefully reviewed and may be simplified a bit. |
@ARMmbed/mbed-os-maintainers ping |
A lot of info above, but still dont understand how this fixes it. As this set them to null, they are not defined ? why not from config docs:
The override is a key here? So an app can overwrite these, correct? Might be good to illustrate in app, how this PR fixes it (code snippet before after the fix). |
@micgur01 Please review the above. This is the simple update but it touches all targets. Let's have this resolved and fixed. |
0xc0170, sorry for late response. Yes, the whole purpose of this exercise is being able to override these values. On a custom project with custom board and perhaps different flash layout - customer is required to specify these values twice: in bootloader configurations and in the application configuration. The idea to bring these configurations as close as possible by reusing the same configuration keys. This PR allows to reuse defines set for the BL configuration in the application code. Without this PR we need to provide additional configurations for setting these values yet another time. |
@donatieng Please review |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Summary of changes
The app_offset and header_offset parameters have always been a part of the target configuration parameters. However, they were intercepted by the tools and never exposed to the application. The new FOTA (update client next generation) functionality requires these parameters in the code as well now. So this PR adds them to targets.json file. The only result of this PR is the addition of these two macros into the code.
Note that the tools already expose the macros APPLICATION_ADDR and HEADER_ADDR having the same values. However, these macros are only available when the application is built with the bootloader. If it isn't, these macros aren't available, hence this PR.
This change is required for new fota client.
Impact of changes
None
Migration actions required
None
Documentation
None
Pull request type
Test results
Reviewers
@alzix
@donatieng