Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@phil-levis
Copy link
Contributor

This mostly takes the M4code and just copies it over to M3. The one major change an M3 chip
will see is some slight changes to handlers (svc_handler instead of SVC_handler).

Fixes a minor bug in the Cortex-M4 hard fault handler output, so
it correctly prints the start of the stack even when it's not the
same as _ezero.

Pull Request Overview

The cortex-m3 library code, adding MPU support. It also fixes a tiny bug in the M4 hard fault handler.

Testing Strategy

This pull request was tested by compiling for M4 and running on hotel (m3).

TODO or Help Wanted

This pull request still needs others who are using M3s to update their code with the new handler names.

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make formatall.

…e M4

code and just copies it over to M3. The one major change an M3 chip
will see is some slight changes to handlers (svc_handler instead of
SVC_handler).

Fixes a minor bug in the Cortex-M4 hard fault handler output, so
it correctly prints the start of the stack even when it's not the
same as _ezero.
@bradjc bradjc mentioned this pull request Nov 15, 2018
29 tasks
Move the mpu code to arch/cortex-m and use it for the m3 and m4
platforms.
@alevy
Copy link
Member

alevy commented Nov 16, 2018

This pull request was tested by compiling for M4 and running on hotel (m3).

Can you also test by compiling for M3, with this new M3 crate? Just for completeness?

Copy link
Member

@alevy alevy left a comment

Choose a reason for hiding this comment

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

Looks generally good, though testing with the new code on real hardware would be nice.

@bradjc
Copy link
Contributor

bradjc commented Nov 19, 2018

If the m3 and m4 mpu is identical hardware I feel strongly we should only have one driver for it. Based on past experience with Tock bugs just won't get fixed on both if there are multiple copies.

However, we need this to do 1.3 testing so I would rather just get this merged today.

@phil-levis
Copy link
Contributor Author

phil-levis commented Nov 19, 2018

I agree -- let's just get it in now and come up with the right solution after 1.3.

Maybe the right approach is a symlink? I don't think we want to go down the approach of different ARMv as well as specific microcontrollers.

@alevy
Copy link
Member

alevy commented Nov 19, 2018

bors r+

bors bot added a commit that referenced this pull request Nov 19, 2018
1212: Brings Cortex-M3 support in line with Cortex-M4.  r=alevy a=phil-levis

This mostly takes the M4code and just copies it over to M3. The one major change an M3 chip
will see is some slight changes to handlers (svc_handler instead of SVC_handler).

Fixes a minor bug in the Cortex-M4 hard fault handler output, so
it correctly prints the start of the stack even when it's not the
same as _ezero.

### Pull Request Overview

The cortex-m3 library code, adding MPU support. It also fixes a tiny bug in the M4 hard fault handler.


### Testing Strategy

This pull request was tested by compiling for M4 and running on hotel (m3).


### TODO or Help Wanted

This pull request still needs others who are using M3s to update their code with the new handler names.


### Documentation Updated

- [X] Updated the relevant files in `/docs`, or no updates are required.

### Formatting

- [X] Ran `make formatall`.


Co-authored-by: Philip Levis <[email protected]>
Co-authored-by: Brad Campbell <[email protected]>
@bors
Copy link
Contributor

bors bot commented Nov 19, 2018

Build succeeded

@bors bors bot merged commit 4e6cd4f into master Nov 19, 2018
@bors bors bot deleted the m3-mpu branch November 19, 2018 23:20
@phil-levis-google
Copy link
Contributor

phil-levis-google commented Nov 20, 2018

I am mildly distressed that we just put cortex-m[34] specific code into cortex-m. I agree that we should have one driver, but not at the cost of having incorrect code.

#1217

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants