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

Reorg stm32f3xx crates and CI: enforce no-warnings on test builds #1568

Merged
merged 3 commits into from
May 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ members = [
"chips/nrf5x",
"chips/sam4l",
"chips/sifive",
"chips/stm32f3xx",
"chips/stm32f303xc",
"chips/stm32f429zi",
"chips/stm32f446re",
"chips/stm32f4xx",
Expand Down
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,29 +128,32 @@ ci-libraries:
@printf "$$(tput bold)*****************$$(tput sgr0)\n"
@printf "$$(tput bold)* CI: Libraries *$$(tput sgr0)\n"
@printf "$$(tput bold)*****************$$(tput sgr0)\n"
@cd libraries/tock-cells && CI=true cargo test
@cd libraries/tock-register-interface && CI=true cargo test
@cd libraries/enum_primitive && CI=true RUSTFLAGS="-D warnings" cargo test
@cd libraries/riscv-csr && CI=true RUSTFLAGS="-D warnings" cargo test
@cd libraries/tock-cells && CI=true RUSTFLAGS="-D warnings" cargo test
@cd libraries/tock-register-interface && CI=true RUSTFLAGS="-D warnings" cargo test
@cd libraries/tock-rt0 && CI=true RUSTFLAGS="-D warnings" cargo test

.PHONY: ci-archs
ci-archs:
@printf "$$(tput bold)*************$$(tput sgr0)\n"
@printf "$$(tput bold)* CI: Archs *$$(tput sgr0)\n"
@printf "$$(tput bold)*************$$(tput sgr0)\n"
@for f in `./tools/list_archs.sh`; do echo "$$(tput bold)Test $$f"; cd arch/$$f; CI=true TOCK_KERNEL_VERSION=ci_test cargo test || exit 1; cd ../..; done
@for f in `./tools/list_archs.sh`; do echo "$$(tput bold)Test $$f"; cd arch/$$f; CI=true RUSTFLAGS="-D warnings" TOCK_KERNEL_VERSION=ci_test cargo test || exit 1; cd ../..; done

.PHONY: ci-chips
ci-chips:
@printf "$$(tput bold)*************$$(tput sgr0)\n"
@printf "$$(tput bold)* CI: Chips *$$(tput sgr0)\n"
@printf "$$(tput bold)*************$$(tput sgr0)\n"
@for f in `./tools/list_chips.sh`; do echo "$$(tput bold)Test $$f"; cd chips/$$f; CI=true TOCK_KERNEL_VERSION=ci_test cargo test || exit 1; cd ../..; done
@for f in `./tools/list_chips.sh`; do echo "$$(tput bold)Test $$f"; cd chips/$$f; CI=true RUSTFLAGS="-D warnings" TOCK_KERNEL_VERSION=ci_test cargo test || exit 1; cd ../..; done

.PHONY: ci-kernel
ci-kernel:
@printf "$$(tput bold)**************$$(tput sgr0)\n"
@printf "$$(tput bold)* CI: Kernel *$$(tput sgr0)\n"
@printf "$$(tput bold)**************$$(tput sgr0)\n"
@cd kernel && CI=true TOCK_KERNEL_VERSION=ci_test cargo test
@cd kernel && CI=true RUSTFLAGS="-D warnings" TOCK_KERNEL_VERSION=ci_test cargo test

.PHONY: ci-syntax
ci-syntax:
Expand Down
1 change: 1 addition & 0 deletions arch/cortex-m0/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ pub unsafe extern "C" fn switch_to_user(
user_stack as *mut u8
}

#[cfg(all(target_arch = "arm", target_os = "none"))]
struct HardFaultStackedRegisters {
r0: u32,
r1: u32,
Expand Down
2 changes: 1 addition & 1 deletion boards/stm32f3discovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ components = { path = "../components" }
cortexm4 = { path = "../../arch/cortex-m4" }
capsules = { path = "../../capsules" }
kernel = { path = "../../kernel" }
stm32f3xx = { path = "../../chips/stm32f3xx", features = ["stm32f303vct6"] }
stm32f303xc = { path = "../../chips/stm32f303xc" }
6 changes: 3 additions & 3 deletions boards/stm32f3discovery/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use kernel::hil::led;
use kernel::hil::uart;
use kernel::hil::uart::Configure;

use stm32f3xx;
use stm32f3xx::gpio::PinId;
use stm32f303xc;
use stm32f303xc::gpio::PinId;

use crate::CHIP;
use crate::PROCESSES;
Expand Down Expand Up @@ -38,7 +38,7 @@ impl Write for Writer {

impl IoWrite for Writer {
fn write(&mut self, buf: &[u8]) {
let uart = unsafe { &mut stm32f3xx::usart::USART1 };
let uart = unsafe { &mut stm32f303xc::usart::USART1 };

if !self.initialized {
self.initialized = true;
Expand Down
232 changes: 116 additions & 116 deletions boards/stm32f3discovery/src/main.rs

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions chips/stm32f3xx/Cargo.toml → chips/stm32f303xc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "stm32f3xx"
name = "stm32f303xc"
version = "0.1.0"
authors = ["Tock Project Developers <tock-dev@googlegroups.com>"]
edition = "2018"
Expand All @@ -9,6 +9,3 @@ cortexm4 = { path = "../../arch/cortex-m4" }
enum_primitive = { path = "../../libraries/enum_primitive" }
kernel = { path = "../../kernel" }
tock_rt0 = { path = "../../libraries/tock-rt0" }

[features]
stm32f303vct6= []
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions chips/stm32f3xx/src/lib.rs → chips/stm32f303xc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! STM32F303: <https://www.st.com/en/microcontrollers-microprocessors/stm32f303.html>

#![crate_name = "stm32f3xx"]
#![crate_name = "stm32f303xc"]
#![crate_type = "rlib"]
#![feature(asm, const_fn, in_band_lifetimes)]
#![no_std]
Expand Down Expand Up @@ -82,7 +82,6 @@ pub static BASE_VECTORS: [unsafe extern "C" fn(); 16] = [
// STM32F303VCT6 has total of 82 interrupts
// Extracted from `CMSIS/Device/ST/STM32F3xx/Include/stm32f303xc.h`
// NOTE: There are missing IRQn between 0 and 81
#[cfg(feature = "stm32f303vct6")]
#[cfg_attr(all(target_arch = "arm", target_os = "none"), link_section = ".irqs")]
// used Ensures that the symbol is kept until the final binary
#[cfg_attr(all(target_arch = "arm", target_os = "none"), used)]
Expand Down
File renamed without changes.
33 changes: 11 additions & 22 deletions chips/stm32f3xx/src/rcc.rs → chips/stm32f303xc/src/rcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,15 @@ register_bitfields![u32,
/// Microcontroller clock output
MCO OFFSET(24) NUMBITS(3) [],
/// I2S clock selection
#[cfg(feature = "stm32f303vct6")]
I2SSRC OFFSET(23) NUMBITS(1) [],
I2SSRC OFFSET(23) NUMBITS(1) [], //stm32f303vct6 specific
/// USB prescaler
USBPRE OFFSET(22) NUMBITS(1) [],
/// PLL multiplication factor
PLLMUL OFFSET(18) NUMBITS(4) [],
/// HSE divider for PLL input clock
PLLXTPRE OFFSET(17) NUMBITS(1) [],
/// PLL entry clock source
#[cfg(feature = "stm32f303vct6")]
PLLSRC OFFSET(16) NUMBITS(1) [],
PLLSRC OFFSET(16) NUMBITS(1) [], //stm32f303vct6 specific
/// APB high-speed prescaler (APB2)
PPRE2 OFFSET(11) NUMBITS(3) [],
/// APB Low speed prescaler (APB1)
Expand Down Expand Up @@ -198,8 +196,7 @@ register_bitfields![u32,
],
AHBENR [
/// ADC3 and ADC4 enable
#[cfg(feature = "stm32f303vct6")]
ADC34EN OFFSET(29) NUMBITS(1) [],
ADC34EN OFFSET(29) NUMBITS(1) [], //stm32f303vct6 specific
/// ADC1 and ADC2 enable
ADC12EN OFFSET(28) NUMBITS(1) [],
/// Touch sensing controller clock enable
Expand All @@ -223,8 +220,7 @@ register_bitfields![u32,
/// SRAM interface clock enable
SRAMEN OFFSET(2) NUMBITS(1) [],
/// DMA2 clock enable
#[cfg(feature = "stm32f303vct6")]
DMA2EN OFFSET(1) NUMBITS(1) [],
DMA2EN OFFSET(1) NUMBITS(1) [], //stm32f303vct6 specific
/// DMA1 clock enable
DMA1EN OFFSET(0) NUMBITS(1) []
],
Expand Down Expand Up @@ -280,8 +276,7 @@ register_bitfields![u32,
/// I2C2 clock enable
I2C2EN OFFSET(22) NUMBITS(1) [],
/// USB clock enable
#[cfg(feature = "stm32f303vct6")]
USBEN OFFSET(23) NUMBITS(1) [],
USBEN OFFSET(23) NUMBITS(1) [], //stm32f303vct6 specific
/// I2CFMP1 clock enable
I2CFMP1EN OFFSET(24) NUMBITS(1) [],
/// CAN clock enable
Expand Down Expand Up @@ -337,8 +332,7 @@ register_bitfields![u32,
],
AHBRSTR [
/// ADC3 and ADC4
#[cfg(feature = "stm32f303vct6")]
ADC34RST OFFSET(29) NUMBITS(1) [],
ADC34RST OFFSET(29) NUMBITS(1) [], //stm32f303vct6 specific
/// ADC1 and ADC2 reset
ADC12RST OFFSET(28) NUMBITS(1) [],
/// Touch sensing controller reset
Expand All @@ -358,30 +352,25 @@ register_bitfields![u32,
],
CFGR2 [
/// ADC34 prescaler
#[cfg(feature = "stm32f303vct6")]
ADC34PRES OFFSET(9) NUMBITS(5) [],
ADC34PRES OFFSET(9) NUMBITS(5) [], //stm32f303vct6 specific
/// ADC12 prescaler
ADC12PRES OFFSET(4) NUMBITS(5) [],
/// PREDIV division factor
PREDIV OFFSET(0) NUMBITS(4) []
],
CFGR3 [
/// USART5 clock source selection
#[cfg(feature = "stm32f303vct6")]
USART5SW OFFSET(22) NUMBITS(2) [],
USART5SW OFFSET(22) NUMBITS(2) [], //stm32f303vct6 specific
/// USART4 clock source selection
#[cfg(feature = "stm32f303vct6")]
USART4SW OFFSET(20) NUMBITS(2) [],
USART4SW OFFSET(20) NUMBITS(2) [], //stm32f303vct6 specific
/// USART2 clock source selection
USART2SW OFFSET(16) NUMBITS(2) [],
/// Timer8 clock source selection
#[cfg(feature = "stm32f303vct6")]
TIM8SW OFFSET(9) NUMBITS(1) [],
TIM8SW OFFSET(9) NUMBITS(1) [], //stm32f303vct6 specific
/// Timer1 clock source selection
TIM1SW OFFSET(8) NUMBITS(1) [],
/// I2C2 clock source selection
#[cfg(feature = "stm32f303vct6")]
I2C2SW OFFSET(5) NUMBITS(1) [],
I2C2SW OFFSET(5) NUMBITS(1) [], //stm32f303vct6 specific
/// I2C1 clock source selection
I2C1SW OFFSET(4) NUMBITS(1) [],
/// USART1 clock source selection
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.