Skip to content
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

Make Nucleo F303K8 number of interrupts consistent with amount of SRAM allocated #1633

Merged
merged 1 commit into from
Mar 29, 2016
Merged

Conversation

ducky64
Copy link
Contributor

@ducky64 ducky64 commented Mar 26, 2016

Fix for #1631

The linker scripts allocate 0x188 bytes of SRAM, but for 101 vectors, it really needs 0x194 bytes. This causes the NVIC initialization to clobber the beginning the the data section, leading to all kinds of fun like the heap pointer getting clobbered and crashing when attempting to create a Serial object.

I'm not convinced that 98 vectors is actually correct, but it seems consistently used in all the F303K8 linker scripts. And it allows Serial to initialize properly as well, too.
The STM32F3 reference (http://www.st.com/web/en/resource/technical/document/programming_manual/DM00046982.pdf section 4.3) says the NVIC supports up to 81 interrupts.
The STM32F303X6/8 reference (http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/DM00092070.pdf section 3.9) says its NVIC supports 60 interrupt channels.
Some documentation also mentions 16 core interrupts separate from the NVIC.
In any case, 98 vectors may be more than actually necessary, but it shouldn't cause errors.

So if the chip actually needs less than 98 interrupt vectors, there's more optimization possible to save some SRAM. But that seems like a much larger clean-up effort, since it's also unclear where the interrupt vector numbers for some of the other chips like the F303RE are coming from (whose code says it has 16 core vectors + 85 peripheral vectors, while the datasheet only mentions 73 masked interrupt channels under the NVIC).

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 26, 2016

@ducky64 Can you please sign https://developer.mbed.org/contributor_agreement/ ?

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 26, 2016

Please have a look @bcostm @adustm

@ducky64
Copy link
Contributor Author

ducky64 commented Mar 27, 2016

CLA signed

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 29, 2016

@ducky64 What's your nick on mbed?

@ducky64
Copy link
Contributor Author

ducky64 commented Mar 29, 2016

Also ducky64

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 29, 2016

@adustm commented in the referenced issue, that 98 is correct.

@0xc0170 0xc0170 merged commit 4694003 into ARMmbed:master Mar 29, 2016
@adustm
Copy link
Member

adustm commented Mar 29, 2016

Hello, It looks good to me. Thanks for the fix.

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.

3 participants