Skip to content

Update linker scripts for bootloader target L496GZ #8508

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

Merged
merged 4 commits into from
Oct 25, 2018

Conversation

micgur01
Copy link
Contributor

@micgur01 micgur01 commented Oct 23, 2018

Description

Add MBED_APP_START and MBED_APP_SIZE to linker script so the start and size of an image can be specified. This allows the ROM to be split into a bootloader region and an application region.
Tested on NUCLEO_L496ZG, had to build bootloader as well with this fix.

Pull request type

[ ] Fix
[ ] Refactor
[x] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@cmonr
Copy link
Contributor

cmonr commented Oct 23, 2018

@micgur01 Would you mind mentioning in the PR description what was updated instead of just mentioning that they were updated

@@ -1,7 +1,10 @@
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x80000; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not 0x100000 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's the previous value, maybe it's a other issue - but not familiar enough with details
The change only not to be hardcoded

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's the previous value

No... it was 0x100000
define symbol region_ROM_end = 0x08000000 + 0x100000 - 1;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are right, checking
maybe i took it from other target ( 429)

@@ -4282,7 +4282,8 @@
"detect_code": ["0823"],
"device_has_add": ["ANALOGOUT", "CAN", "CRC", "SERIAL_ASYNCH", "SERIAL_FC", "TRNG", "FLASH"],
"release_versions": ["2", "5"],
"device_name": "STM32L496ZG"
"device_name": "STM32L496ZG",
"bootloader_supported": true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add bootloader_supported to DISCO_L496AG also ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

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.

It seems also that you need to add
#! armcc -E
in ARM sct files

Thx

@micgur01
Copy link
Contributor Author

Hi
is it related to current fix? Could you explain what does it means?
I can see it not in every ARM sct files.

#! armcc -E
in ARM sct files

@jeromecoutant
Copy link
Collaborator

I don't know...
But without that line, your patch can't compile.

@micgur01
Copy link
Contributor Author

Hi
Delivered latest code review fixes
Thank you very much for your comments

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 24, 2018

#! armcc -E

To run preprocessor on the linker scripts. In this case, because we got some config we want to pass to the linker script, we need this step.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 24, 2018

@micgur01 How was this tested (as ARMCC failure was not found earlier)?

@micgur01
Copy link
Contributor Author

It's my fault , first time delivering to mbed-os
I did not checked for all toolchains, run tests only for ARM_GCC

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.

ST CI quick test OK :

target platform_name test suite result elapsed_time (sec) copy_method
DISCO_L496AG-ARM DISCO_L496AG tests-mbed_drivers-echo OK 18.11 default
DISCO_L496AG-GCC_ARM DISCO_L496AG tests-mbed_drivers-echo OK 19.08 default
DISCO_L496AG-IAR DISCO_L496AG tests-mbed_drivers-echo OK 19.05 default
NUCLEO_L496ZG-ARM NUCLEO_L496ZG tests-mbed_drivers-echo OK 18.75 default
NUCLEO_L496ZG-GCC_ARM NUCLEO_L496ZG tests-mbed_drivers-echo OK 19.31 default
NUCLEO_L496ZG-IAR NUCLEO_L496ZG tests-mbed_drivers-echo OK 18.58 default

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 24, 2018

@jeromecoutant Thanks for the test results 👍

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 24, 2018

Build : SUCCESS

Build number : 3451
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8508/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Oct 24, 2018

@mbed-ci
Copy link

mbed-ci commented Oct 24, 2018

@adbridge
Copy link
Contributor

adbridge commented Nov 2, 2018

Mmm something funny in this PR:
error: patch failed: targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/device/TOOLCHAIN_IAR/stm32l496xx.icf:1
error: targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/device/TOOLCHAIN_IAR/stm32l496xx.icf: patch does not apply
error: Did you hand edit your patch?
It does not apply to blobs recorded in its index.

I'll try hand patching it at the end

@cmonr
Copy link
Contributor

cmonr commented Nov 5, 2018

For future reference, figured out the patching issue.

We need to be passing the --keep-cr flag when running git am -3

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

Successfully merging this pull request may close these issues.

6 participants