Fix platform tree for Tiva C/Stellaris Launchpad boards#399
Fix platform tree for Tiva C/Stellaris Launchpad boards#399farcaller merged 6 commits intohackndev:masterfrom jamwaffles:tiva-c-regression-fix
Conversation
This is fixed in the next commit. I missed the fact that I was including the regex crate in my child project, which was trying to compile for ARM no_std which obviously doesn't work.
2 similar comments
| name = "platformtree" | ||
| plugin = true | ||
|
|
||
| [dependencies] |
There was a problem hiding this comment.
it's a dev-dependencies, I believe?
There was a problem hiding this comment.
That might work for non-release builds, however when I run cargo build --target=thumbv7em-none-eabi --release in my downstream project, I get extern crate regex; can't find crate so I'm inclined to leave it in dependencies so all builds work.
src/hal/tiva_c/uart_pt.rs
Outdated
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| // extern crate regex; |
src/lib.rs
Outdated
| #![allow(improper_ctypes)] | ||
| #![feature(const_fn)] | ||
| #![deny(missing_docs)] | ||
| // #![deny(missing_docs)] |
There was a problem hiding this comment.
What does it trigger on? I'd prefer to fix the docs instead.
There was a problem hiding this comment.
I agree, fixed docs is the best solution here. It fails on most of the const definitions in the tiva_c platform tree code which probably don't need documenting. For example:
pub const PORT_A: *const Port = 0x40004000 as *const Port;
pub const PORT_B: *const Port = 0x40005000 as *const Port;
pub const PORT_C: *const Port = 0x40006000 as *const Port;
...
in /src/hal/tiva_c/pin.rs. I can add #[allow(missing_docs)] everywhere, but it seems very messy:
#[allow(missing_docs)] pub const PORT_A: *const Port = 0x40004000 as *const Port;
#[allow(missing_docs)] pub const PORT_B: *const Port = 0x40005000 as *const Port;
#[allow(missing_docs)] pub const PORT_C: *const Port = 0x40006000 as *const Port;
...
Should I just add #[allow(missing_docs)] and uncomment the line in src/lib.rs or is there a better way?
There was a problem hiding this comment.
Yes, please add #[allow(missing_docs)] and a TODO(jamwaffles) to clean it up, although obviously I wouldn't force you to clean it, merely to track who placed it there
2 similar comments
This reinstates disallow(missing_docs) in the HAL lib.rs and instead moves the allow(missing_docs) exceptions to the individual files in tiva_c that were breaking the build. Not a perfect solution but better than either a global or line by line solution IMO.
|
Glad to see it merged, thank you! Now to implement SPI on the Tiva... |
This pull request fixes regressions in the
mcu_tiva_cplatform tree allowing Zinc to be built for the Stellaris Launchpad and Tiva C boards. I've test-compiled a boilerplate project onto my Stellaris Launchpad which works, and I've compiled a few of thetiva_c_*projects underexamples/, which built fine as well, although I haven't flashed them to any boards yet.Apologies for the messy commits. I hope the overall diff makes apparent what I did. There's a lot of
.unwrap()unsafe code in the platform tree files, but that seems to be on par with the lpc17xx files, so I left my changes as is. An incorrect platform tree will panic with no error currently, but that seems to be a general issue with Zinc at the moment as the codebase is still in flux.Notable changes:
|&: err: &str |no longer need&:; the compiler infers this partString::as_slice()doesn't exist any more, so I converted those occurrences toString::as_str()#![deny(missing_docs)]insrc/lib.rsas it fails builds. Obviously documentation is a good thing, but I feel it's outside the scope of this PR which is just to get the Tiva C build working again.Software versions:
macOS Sierra
Thank you to the Zinc team for making it possible to write Rust on ARM CPUs!