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

K64F linker script refactor, also fix some misc bugs #402

Merged
merged 5 commits into from
Dec 11, 2024

Conversation

multiplemonomials
Copy link
Collaborator

Summary of changes

This MR refactors the K64F linker script to support memory bank configuration. This is needed as I'm using it to test the MCUBoot bootloader.

I also fixed a couple misc bugs I ran into while working on MCUBoot.

Impact of changes

K64F can now be configured to use only a portion of flash using target_overrides.memory_bank_config in mbed_app.json.

Migration actions required

Documentation

None


Pull request type

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[X] 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)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

I reran the Mbed test suite for K64F. Results here, don't see any suspicious failures.


@JohnK1987
Copy link
Member

This is cool, I like that.

/* If we are not configured to execute out of the start of ROM, then a bootloader is
 * present.  This tells us whether we need to add the Flash Configuration Field at the start of flash. */
#if MBED_CONFIGURED_ROM_BANK_IROM1_START == 0
#define IS_BOOTLOADER_PRESENT 0
#else
#define IS_BOOTLOADER_PRESENT 1
#endif

@JohnK1987
Copy link
Member

Unfortunately I don't have much experience with linker script, only a marginal awareness. So I am not able to say anything to these changes :D
BTW when we want to add an information header (version, release date and so on) to application. Is also necessary to modify linker script?

@multiplemonomials
Copy link
Collaborator Author

BTW when we want to add an information header (version, release date and so on) to application. Is also necessary to modify linker script?

If you mean like an mcuboot header, no, mcuboot prepends that to the binary file after it's been linked. If you are rolling your own format, and you just want to include a specific C struct at the start of the image, then yeah, you can do that with a linker script.

@multiplemonomials multiplemonomials force-pushed the dev/k64f-linker-script-refactor branch from 9b6c7e7 to 2cf4f59 Compare December 11, 2024 17:33
@multiplemonomials multiplemonomials merged commit 156cd15 into master Dec 11, 2024
52 checks passed
@multiplemonomials multiplemonomials deleted the dev/k64f-linker-script-refactor branch December 11, 2024 20:18
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.

2 participants