-
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
malloc test: fix out of memory problem for NUCLEO_F070RB #5338
Conversation
f7dae3e
to
86860e7
Compare
Hi |
@jeromecoutant Thanks for the reference. |
This patch is also related #5285 (how much space should a target have available by default). |
86860e7
to
173c314
Compare
@jeromecoutant I believe with this patch, both devices you encoutered problems earlier (NUCLEO_F070RB, NUCLEO_F072RB) should pass |
/morph build |
tested only on NUCLEO_F070RB |
Build : SUCCESSBuild number : 255 Skipping test trigger, missing label 'NEED CI' |
Are you happy with this patch, please review |
Hi Yes, this makes the malloc test passed. Thx! | NUCLEO_F070RB-GCC_ARM | NUCLEO_F070RB | tests-mbedmicro-rtos-mbed-malloc | OK | 28.62 | default | Maybe we can apply the same patch with other failed rtos tests ? | NUCLEO_F070RB-GCC_ARM | tests-mbedmicro-rtos-mbed-basic | TIMEOUT |
@maciejbocianski are you able to do the same for other failing tests as suggested in the previous comment? |
/morph build |
Build : SUCCESSBuild number : 353 Triggering tests/morph test |
Test : FAILUREBuild number : 164 |
173c314
to
6bda590
Compare
problem fixed - there was lack of thread stack alignment |
/morph build |
Build : SUCCESSBuild number : 356 Triggering tests/morph test |
Test : SUCCESSBuild number : 169 |
@orenc17a Any idea why this is failing ? |
/morph uvisor-test |
@@ -54,17 +54,22 @@ void task_using_malloc(void) | |||
|
|||
int main() | |||
{ | |||
// static stack for threads to reduce heap usage on devices with small RAM | |||
// and eliminate run out of heap memory problem | |||
MBED_ALIGN(8) uint8_t stack[THREAD_STACK_SIZE * NUM_THREADS]; |
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.
The alignment isn't necessary with #5405.
If you make this a two dimensional array then the loop below will be clearer.
Declaration:
uint8_t stack[NUM_THREADS][THREAD_STACK_SIZE];
Loop:
thread_list[i] = new Thread(osPriorityNormal, THREAD_STACK_SIZE, stack[i]);
@c1728p9 Are you requesting changes? We were about to merge this. |
I don't want to block anything so lets merge it. @maciejbocianski can you address the comments in a separate PR? |
malloc test: fix out of memory problem for NUCLEO_F070RB
Build : SUCCESSBuild number : 422 Triggering tests/morph test |
Build : SUCCESSBuild number : 424 Triggering tests/morph test |
Test : FAILUREBuild number : 213 |
Test : FAILUREBuild number : 214 |
Description
This test cause out of memory error ("Operator new[] out of memory") when run on NUCLEO_F070RB with GCC_ARM compiler
Changes was introduced to reduce heap allocations
Now test threads uses static memory as a stack memory
Status
READY
Migrations
NO