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

Fix crashes on boot on some Kinetis devices #4939

Merged
merged 1 commit into from Sep 4, 2017

Conversation

Projects
None yet
6 participants
@c1728p9
Contributor

c1728p9 commented Aug 18, 2017

Fix a crash on boot due to incorrectly size vector count. This patch also reduces the ram vector size for devices which reserved too much space.

@c1728p9

This comment has been minimized.

Contributor

c1728p9 commented Aug 18, 2017

@maclobdell can you verify this patch on the KL27Z, KL43Z, KL82Z and KL41Z?

@maclobdell

This comment has been minimized.

Contributor

maclobdell commented Aug 21, 2017

@c1728p9 yes - will test asap.

cc @mmahadevan108 - this seems like the fix for the issues we have been having with KL27

@mmahadevan108

This comment has been minimized.

Contributor

mmahadevan108 commented Aug 21, 2017

@c1728p9 Thank you.
Could you also help fix ram vector table size in K66F, KW24D, K22F, K64F

@c1728p9

This comment has been minimized.

Contributor

c1728p9 commented Aug 21, 2017

Hi @mmahadevan108, my intent here was only to track down the reason some devices were crashing. I light of this bug I would recommend NXP does a review of all Kinetis devices to ensure the vector table and vector count are sized accordingly.

@c1728p9

This comment has been minimized.

Contributor

c1728p9 commented Aug 21, 2017

/morph test

@mmahadevan108

This comment has been minimized.

Contributor

mmahadevan108 commented Aug 21, 2017

0xc0170. Please let me know if this change was made as an error?

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Aug 22, 2017

@mbed-bot

This comment has been minimized.

mbed-bot commented Aug 22, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1071

Test failed!

...RGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL27Z/device/TOOLCHAIN_ARM_STD/MKL27Z64xxx4.sct Outdated
@@ -51,7 +51,7 @@
#define __ram_vector_table__ 1
#if (defined(__ram_vector_table__))
#define __ram_vector_table_size__ 0x00000200

This comment has been minimized.

@mmahadevan108

mmahadevan108 Aug 22, 2017

Contributor

Is this change required? The issue seems to be the large value for the number of NVIC_VECTORS

This comment has been minimized.

@0xc0170

0xc0170 Aug 23, 2017

Member

It used tobe large, 0x200, with this patch it would be now 0xc0?

This comment has been minimized.

@c1728p9

c1728p9 Aug 23, 2017

Contributor

Nope, that change is not required. It just saves space. The commit "Update ram vector size to save space" just saves space and could be removed entirely. Let me know if you want me to.

This comment has been minimized.

@mmahadevan108

mmahadevan108 Aug 23, 2017

Contributor

It has been reduced to match the number of NVIC_VECTORS, we had reserved a fixed space as this varies by platform. My request was to go back to the original value as it helps minimize changes in this file. I can check with the internal SDK team if this space can be adjusted per platform.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Aug 23, 2017

/morph test

1 similar comment
@studavekar

This comment has been minimized.

Collaborator

studavekar commented Aug 24, 2017

/morph test

@mbed-bot

This comment has been minimized.

mbed-bot commented Aug 24, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1104

Build failed!

@mmahadevan108

This comment has been minimized.

Contributor

mmahadevan108 commented Sep 1, 2017

@maclobdell @c1728p9 Can this fix be integrated into the mainline.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Sep 1, 2017

@maclobdell @c1728p9 Can this fix be integrated into the mainline.

Waiting for CI to complete, then shall go in

Fix crash on boot due to vector size mismatch
If NVIC_NUM_VECTORS is larger than the space allocated by the vector
table in ram (__ram_vector_table_size__) then the call to mbed_cpy_nvic
during boot will corrupt valid data, which can lead to a crash. This
patch fixes the declared number of vectors on the KL27Z, KL43Z and
KL82Z to fix this crash.

@c1728p9 c1728p9 force-pushed the c1728p9:crash_on_boot branch to b402b7a Sep 1, 2017

@c1728p9

This comment has been minimized.

Contributor

c1728p9 commented Sep 1, 2017

Rebased to master so testing can be re-triggered. Also removed the space saving patch at the request of @mmahadevan108.

@c1728p9

This comment has been minimized.

Contributor

c1728p9 commented Sep 1, 2017

/morph test

@mbed-bot

This comment has been minimized.

mbed-bot commented Sep 2, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1160

All builds and test passed!

@0xc0170 0xc0170 merged commit b0dd984 into ARMmbed:master Sep 4, 2017

4 checks passed

Cam-CI uvisor Build & Test Success
Details
ci/morph-test Job has completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@0xc0170 0xc0170 removed the ready for merge label Sep 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment