-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Adjust Stack size Allocation (IAR, LPC176x) #4924
Conversation
538e885
to
b966b17
Compare
e3d1734
to
e742274
Compare
/*Heap 1/4 of ram and stack 1/8*/ | ||
define symbol __ICFEDIT_size_cstack__ = 0x1000; | ||
define symbol __ICFEDIT_size_heap__ = 0x2000; | ||
/*Heap 1/4 of ram and stack 1/4*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this comment true now with these update? Do we really need almost 2x bigger ISR stack (that is cstack as I recall) ?
I am still hoping IAR to add the feature for dynamic sized heap, checked the last time this week release notes, have not found it yet there 🙏
c0cd6e3
to
d716571
Compare
@0xc0170 who is going to review this ? Its a blocker for mbed-os-example-cellular. I don't have permission to add reviewers. |
It looks fine to me, just wondering if it is really required to increase ISR STACK for iar by 0x800? Does celullar use that much? cc @c1728p9 |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputExample Build failed! |
@0xc0170 Isn't that a fashion now to put stuff on stack rather than heap so that we can track memory allocations better ? |
Hi @hasnainvirk, most targets have an interrupt stack of 1K. In this PR you are increasing the interrupt stack from 4k to 6k. If that much stack is actually being used, then the application you are using will crash on other devices. What makes you think the interrupt stack is too small? Are you seeing a crash? |
@c1728p9 I don't think it is interrupt stack. |
@0xc0170 morph test show a failure for DISCO_F769NI for blinky and socket examples.
Here is the build result for blinky example:
My IAR version:
|
It is for IAR, therefore I asked as well. The default value ~1k should be sufficient. For IAR:
|
@0xc0170 Interesting. Then why was it set to 4K at the first place ? |
This target has not changed for some time. For mbed 2, this number defines actually a stack. We are not certain from the above description what is happening with the cellular ? And how 6K ISR stack fixes it |
@0xc0170 It needs half a K for serial buffers , then it uses LWIP .. |
d716571
to
e4d4558
Compare
@0xc0170 are you happy with the review changes ? |
Should be fine. This however will be replaced soon (IAR 8.x update and then IAR dynamic heap patch). |
@0xc0170 Yeah I heard about the patch. However, the thing it's a blocker for mbed-os-example-cellular. This particular example cannot be tagged to current mbed-os release as it doesn't build for IAR. |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
Failure for ARCH_PRO looks legit. Re-triggering /morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
@hasnainvirk Seems like ARCH PRO is affected, and threads test fails for it due to this change, please review the results above |
:) The test creates 3 threads with children in parallel(each with 768 B of stack size) and they are dynamically allocated and total heap allocation was 3K. I will send a patch through shortly. |
Since mbed-os 5.4.3, something increased foot print of mbed-os and the applications that were barely fitting in started to spill. IAR toolchain for LPC176x target family is set to use 2 RAM regions (32K each). RAM region 2 is being used for ETH/USB and 1 is being used for vector table, stack/heap/static data. In this commit we have decreased heap size allocation from 8K to 7K so that the is more room for stack and static data.
69bf3d3
to
fce2ca2
Compare
@0xc0170 A typo caused this issue. The idea was to take 1K off from the heap. Originally heap was 0x2000, i.e., 8K |
@studavekar Can you please kick the morph test again ? |
/morph test |
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
@hasnainvirk This relatively small decrease in heap results in lwip two tests failing to allocate memory for ARCH PRO. IAR will get soon the dynamic heap support so this PR will become obsolete. I'll talk to you now now, to resolve this. |
Since mbed-os 5.4.3, something increased foot print of mbed-os and the applications
that were barely fitting in started to spill.
IAR toolchain for LPC176x target family is set to use 2 RAM regions (32K each). RAM region
2 is being used for ETH/USB and 1 is being used for vector table, stack/heap/static data.
In this commit we have decreased heap size allocation from 8K to 7K so that the is more room for static data.