Skip to content

Increase background stack size to fix overflows with debug profile #10367

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
Apr 17, 2019

Conversation

jeromecoutant
Copy link
Collaborator

@jeromecoutant jeromecoutant commented Apr 10, 2019

Description

Fix #9106

Test done with with NUCLEO_F091RC and GCC_ARM:

  • in developer profile:

================ THREAD STATS ===============
Name: rtx_idle
State: 1
Priority: 1
Stack Size: 512
Stack Space: 152

  • in debug profile:

================ THREAD STATS ===============
Name: rtx_idle
State: 1
Priority: 1
Stack Size: 768
Stack Space: 220

Pull request type

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

Reviewers

@deepikabhavnani
@geobruce

@0xc0170 0xc0170 requested a review from c1728p9 April 10, 2019 13:38
},
"idle-thread-stack-size-debug-extra": {
"help": "Additional size to add to the idle thread when tickless is enabled and LPTICKER_DELAY_TICKS is used",
"value": 256
Copy link

@deepikabhavnani deepikabhavnani Apr 10, 2019

Choose a reason for hiding this comment

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

Some low end devices might fail because of limited memory, shall we keep this as 0 as default and update it to 256 for all ST targets only?

Also please verify this addition for TARGET_STM32F070RB and TARGET_STM32F072RB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why only ST targets is affected to debug memory increase ?

Choose a reason for hiding this comment

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

ST hal implementation uses more stack

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, I will propose default value 0,
and update few ST targets.

See quick measurements in #9106

@ciarmcom ciarmcom requested review from deepikabhavnani and a team April 10, 2019 15:00
@ciarmcom
Copy link
Member

@jeromecoutant, thank you for your changes.
@deepikabhavnani @ARMmbed/mbed-os-core @ARMmbed/mbed-os-maintainers please review.

#ifdef MBED_CONF_APP_IDLE_THREAD_STACK_SIZE
#define OS_IDLE_THREAD_STACK_SIZE (MBED_CONF_APP_IDLE_THREAD_STACK_SIZE + EXTRA_IDLE_STACK)
#define OS_IDLE_THREAD_STACK_SIZE MBED_CONF_APP_IDLE_THREAD_STACK_SIZE
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed this line,
as I think that different calculation for idle size value depending on tickless and/or debug
is needed only if the user doesn't specify explicitly the needed and expected size.

@c1728p9

@jeromecoutant
Copy link
Collaborator Author

Tested OK with NUCLEO_F072RB

Copy link

@deepikabhavnani deepikabhavnani 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 to me 👍

@cmonr
Copy link
Contributor

cmonr commented Apr 12, 2019

CI started

@cmonr
Copy link
Contributor

cmonr commented Apr 12, 2019

LGTM, but @ARMmbed/mbed-os-maintainers should this come into a patch or a feature release?

This very much adds new functionality, but it appears small enough and targeted enough that it could warrant a patch release.

@mbed-ci
Copy link

mbed-ci commented Apr 12, 2019

Test run: FAILED

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

Failed test jobs:

  • jenkins-ci/mbed-os-ci_exporter

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 12, 2019

Exporters restarted - internal symlink error

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 12, 2019

Waiting for @c1728p9 approval

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 16, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Apr 17, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 3
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test

@0xc0170 0xc0170 merged commit 5fb5e98 into ARMmbed:master Apr 17, 2019
@jeromecoutant jeromecoutant deleted the PR_STACK_SIZE_DEBUG branch April 23, 2019 07:23
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.

Wait() function causes system to hang on STM32F0(91RC)
7 participants