Skip to content

K64F, STM32F429: IAR linker scripts dynamic heap fix #10938

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 1 commit into from
Jul 3, 2019

Conversation

tymoteuszblochmobica
Copy link
Contributor

@tymoteuszblochmobica tymoteuszblochmobica commented Jul 1, 2019

Description

IAR icf linker scripts modified to use dynamic heap allocation of all available memory.
Modified targets
STM32F429
K64F

Pull request type

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

Reviewers

@kjbracey-arm
@juhhei01
@teetak01
@juhoeskeli

Release Notes

@ciarmcom
Copy link
Member

ciarmcom commented Jul 1, 2019

@tymoteuszblochmobica, thank you for your changes.
@teetak01 @maclobdell @kjbracey-arm @juhhei01 @MarceloSalazar @ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@juhhei01 juhhei01 left a comment

Choose a reason for hiding this comment

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

Looks good. Is it this generic change which is not tied to specific IAR version? If it is I like a lot. I try to google that with expanding size and did not found any matching content than GitHub mbedos #8306.

Copy link
Contributor

@teetak01 teetak01 left a comment

Choose a reason for hiding this comment

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

Looks good. Should this be done for all targets?

@kjbracey
Copy link
Contributor

kjbracey commented Jul 2, 2019

@deepikabhavnani was working on this for all targets. Can't quite follow where that work reached. This was PR reverting it?

#9432

Earlier version: #9205

It does require IAR 8, but IAR 7 is not officially supported any more.

@kjbracey
Copy link
Contributor

kjbracey commented Jul 2, 2019

I'd like to see it done for all targets, but don't have a particular problem with doing it piecemeal for a board that needs the memory now for some test, if there's no resource to do the full systematic sweep.

Another memory thing that came to my attention recently is having static prioritisation correct in ARM builds for split memory devices like K64F - it should have .ANY2 in its small 64K region and .ANY1 in its 192K region to prioritise putting static data in the first area, leaving more space in the second area for heap. Without that, ARM prioritises the bigger area.

If you don't fill the small area, spare space there goes totally wasted. Heap won't use it. (Only GCC retarget has split heap support at the moment).

How does IAR handle its two DATA regions? Will it fill the small one first?

@kjbracey
Copy link
Contributor

kjbracey commented Jul 2, 2019

Also for K64F, it doesn't have the GCC split heap addition. Unlike IAR+ARM, the first 64K can't be used for static data in GCC, because it can't auto-distribute it between regions, but you could use it for a second heap area. You'd need to turn on MBED_SPLIT_HEAP - check the (few) other targets defining that.

Copy link
Member

@bulislaw bulislaw left a comment

Choose a reason for hiding this comment

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

We already have couple of boards with the expanding heap.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 2, 2019

@deepikabhavnani was working on this for all targets. Can't quite follow where that work reached. This was PR reverting it?

cc @ARMmbed/mbed-os-core

@tymoteuszblochmobica
Copy link
Contributor Author

tymoteuszblochmobica commented Jul 2, 2019

This PR is to fix following problems for STM32F429 and K64F target
https://jira.arm.com/browse/IOTCORE-404
https://jira.arm.com/browse/IOTCORE-1218
Im not familiar why @deepikabhavnani PR #9432 reverts her previous commits for dynamic heap.

@0xc0170 0xc0170 changed the title IAR icf linker scripts update K64F, STM32F429: IAR linker scripts dynamic heap fix Jul 2, 2019
@deepikabhavnani
Copy link

deepikabhavnani commented Jul 2, 2019

Dynamic heap support was the needed feature as other toolchains do support it, it was done as part of compiler upgraded by management decision was not to have breaking changes in same release as compiler update. Plan was to un-revert that commit in next minor release.

@evedon
Copy link
Contributor

evedon commented Jul 2, 2019

I'd like to see it done for all targets, but don't have a particular problem with doing it piecemeal for a board that needs the memory now for some test, if there's no resource to do the full systematic sweep.

I will create a task in the backlog to do the same for all targets.

@kjbracey
Copy link
Contributor

kjbracey commented Jul 2, 2019

It would be worth incorporating my points about GCC split heap and ARMC6 (and IAR?) region prioritization into the same issue. Those will only be relevant to targets with split memory maps like the K64F, but for those, there may be an easy memory gain to get.

For K64F, all tools are currently wasting memory for different reasons, so it's kind of a no-score draw. This fix on its own would leave IAR 60-or-so KiB ahead of GCC and ARM.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 2, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Jul 2, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

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.

10 participants