Skip to content

NANO130: Change initial stack size to 1K #6799

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

Closed

Conversation

ccli8
Copy link
Contributor

@ccli8 ccli8 commented May 3, 2018

Description

This PR tries to spare more memory for adding new feature by decreasing initial stack size, especially for IAR with which heap size is statically allocated.

Related PR

#6768

Pull request type

[X] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

@deepikabhavnani

This is to spare more memory for adding new feature, especially heap size which must hard-code with IAR.
@0xc0170
Copy link
Contributor

0xc0170 commented May 3, 2018

This is decreasing stack size by half. This might break some apps, so we need to be careful about this change (definitely not patch release).

@ccli8
Copy link
Contributor Author

ccli8 commented May 3, 2018

@0xc0170 OK. Then just follow #6768. I would close this PR.

@ccli8 ccli8 closed this May 3, 2018
@0xc0170
Copy link
Contributor

0xc0170 commented May 3, 2018

I was checking the target so its just for Mbed OS 5 - thus this stack is used as isr stack size.

Why it was closed? You preferred this solution to the one that decreased the heap?

@ccli8
Copy link
Contributor Author

ccli8 commented May 3, 2018

@0xc0170 Do you also approve this change? In fact, both #6768 and this one would break some apps. But we need to pick one.

@0xc0170
Copy link
Contributor

0xc0170 commented May 3, 2018

@0xc0170 Do you also approve this change? In fact, both #6768 and this one would break some apps. But we need to pick one.

I would like to understand the drive for this change and the heap. What @deepikabhavnani proposed was just for the limitation of current IAR version we support (its change to one toolchain). This one is changing it to all thus the scope is much bigger.

will the heap IAR fix solve the issue you are having? was 0x1200 too big heap for that target? This is again application specific, would be nice to have this configured

@ccli8
Copy link
Contributor Author

ccli8 commented May 3, 2018

Per our experience, decreasing heap size (0x1200) would fail some Greentea/CI tests at run-time, so I send this PR to spare memory from other source - initial stack here. But as you point out, scope of this PR is much bigger. #6768 would be safer.

As far as I know, Mbed OS doesn't export interface to configure initial stack (ISR stack) and heap size by user application. The issue gets worse with IAR 7.8 because it doesn't allow using available SRAM for heap. Heap size in IAR 7.8 must be hard-coded. Larger heap size is well for run-time, but it also makes less static memory which would cause application failed to build. That's a dilemma.

@deepikabhavnani
Copy link

deepikabhavnani commented May 3, 2018

@ccli8 - We can change stack size to 0x400, instead of heap size but only for IAR and not other tool chains.

@ccli8
Copy link
Contributor Author

ccli8 commented May 4, 2018

@deepikabhavnani Continuing #6768, go with 0x1000 or 0x1200 heap size and 0x400 stack size only for IAR toolchain.

@ccli8 ccli8 deleted the nuvoton_nano130_adjust_memory branch December 20, 2018 06:43
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.

4 participants