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
New Platform: Msp432 #1911
New Platform: Msp432 #1911
Conversation
Thanks for the PR!!! Would you mind rebasing on master? It looks like GitHub is confused and has included other patches in the PR. It makes it hard to review your changes. Also the Tock porting guide gives some hints for porting: https://github.com/tock/tock/blob/master/doc/Porting.md#adding-a-platform-to-tock-repository |
It also looks like the tests are failing. Make sure to run at least |
Hi! Concerning the console and timer: I read this guide and somewhere at the beginning it said that after GPIO is working it's a good time to open a pull request. So should I close/delete this PR, fix my tests, get the console working and open a new one? |
Great! Thanks. I think opening a PR makes sense. It lets everyone know what you are working on (so we don't duplicate efforts). It is also a great way to get feedback. It might make sense to convert it to a draft PR until you have the tests and UART working though. |
Very cool! Can I ask what attracted you to this board/MCU? |
Yeah, sure! I'm doing my master thesis in porting Tock to a new platform, and my only 'requirement' was to choose a platform which is of course not supported yet and where a cheap evaluation board exists. In our university (FH Joanneum) we work a lot with all forms of TI products, so I had a look at their microcontroller boards. I chose this particular one because openOCD had good support for it, it contains a quite new Cortex-M4-based chip and the board costs only 20$. |
Hi! So far I managed it to get the UART in TX direction working in order to print panic- and debug-messages. Is it necessary for a first pull into the main-repo to get also the RX-functionality working? Also the GPIO implementation doesn't support interrupts at the moment. Is this also necessary to get merged? |
You don't need to have RX working, so that's fine. For GPIO I think that's also ok. |
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.
Looks REALLY good! :)
I have added some comments, they should all be pretty small. Overall this looks really good. I didn't compare it to the datasheet but everything looks reasonable.
Do you mind addressesing the comments and then I'll have another look?
I think I have addressed all your comments with the latest commits. |
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.
Overall, looks great!
boards/msp_exp432p401r/src/main.rs
Outdated
#![no_std] | ||
#![cfg_attr(not(doc), no_main)] | ||
#![feature(asm, core_intrinsics)] | ||
// #![deny(missing_docs)] |
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.
// #![deny(missing_docs)] | |
#![deny(missing_docs)] |
This still needs to be addressed. Should just be the listed change here.
When you address a comment can you mark it as resolved? |
Sure! I didn't know that I was supposed to mark the comments as resolved. |
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.
Take a look at the SAM4L spi implementation for an example of PeripheralManager use. The idea is that the manager encapsulates the registers, so all register access must go through the manager. That way, hardware is provably always locked/unlocked at compile time.
e.g. when accessing registers, first create an instance of the manager: https://github.com/tock/tock/blob/master/chips/sam4l/src/spi.rs#L264
helper functions take a reference to the manager: https://github.com/tock/tock/blob/master/chips/sam4l/src/spi.rs#L241
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.
I think this is looking pretty much ready! Very exciting!
I think you can move this from a Draft PR to a full-fledged one at the point :) |
I implemented no a very first version for handling GPIO interrupts. However, there is a problem with this controller, it does NOT support detecting interrupts at the falling edge and at the rising edge simultaneously. Just for testing the implementation with the button-capsule I detect only falling edges where actually both should be detected. How should I solve this problem? Just 'ignore' the fact that both should be detected? Maybe |
Regarding a software implementation, I think it would basically involve re-configuring a pin to check for the other edge type each time an interrupt arrived for that pin. This would just be done in the chip GPIO driver -- basically when a falling edge interrupt arrives, check that the pin is still low, and if so configure that pin to look for a rising edge interrupt, and vice-versa. Unfortunately it would have to take place in the bottom half interrupt handler, which means there is the possibility for large enough delays that interrupts could be missed, but I think this is still a better solution than only handling interrupts in one direction. |
Ok, thanks! |
I have now implemented a first approach for detecting both interrupts by software. Can somebody please have a look on it if the implementation makes sense? |
With the latest commit I added some missing lifetime specifiers in the GPIO module. However, since the struct |
bors r+ |
New Platform Support for the MSP-EXP432P401R Eval-Board
This pull-request adds support for MSP432P401R chip from Texas Instruments.
The implementation is currently very, very basic, only the GPIO-module is properly implemented in order to create a panic-handler which blinks an LED and to be able to test a simple user-space application.
If this PR will be accepted, the next step would be to implement the UART and timer modules for supporting debug-output and delays in userspace.
Adding a Platform to Tock Repository