Compare commits
3 Commits
embassy-sy
...
boot-hil
Author | SHA1 | Date | |
---|---|---|---|
9010bfe79b | |||
2a437d31c4 | |||
2d78aa763a |
9
.github/ci/doc.sh
vendored
9
.github/ci/doc.sh
vendored
@ -48,9 +48,8 @@ kubectl cp webroot/static $POD:/data
|
||||
|
||||
# build and upload stm32 last
|
||||
# so that it doesn't prevent other crates from getting docs updates when it breaks.
|
||||
rm -rf webroot
|
||||
docserver-builder -i ./embassy-stm32 -o webroot/crates/embassy-stm32/git.zup
|
||||
|
||||
# temporarily disabled because it's bringing CI down.
|
||||
#rm -rf webroot
|
||||
#docserver-builder -i ./embassy-stm32 -o webroot/crates/embassy-stm32/git.zup
|
||||
#POD=$(kubectl -n embassy get po -l app=docserver -o jsonpath={.items[0].metadata.name})
|
||||
#kubectl cp webroot/crates $POD:/data
|
||||
POD=$(kubectl -n embassy get po -l app=docserver -o jsonpath={.items[0].metadata.name})
|
||||
kubectl cp webroot/crates $POD:/data
|
||||
|
9
ci.sh
9
ci.sh
@ -145,8 +145,8 @@ cargo batch \
|
||||
--- build --release --manifest-path examples/stm32u5/Cargo.toml --target thumbv8m.main-none-eabihf --out-dir out/examples/stm32u5 \
|
||||
--- build --release --manifest-path examples/stm32wb/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/stm32wb \
|
||||
--- build --release --manifest-path examples/stm32wl/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/stm32wl \
|
||||
--- build --release --manifest-path examples/boot/application/nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840,skip-include --out-dir out/examples/boot/nrf52840 \
|
||||
--- build --release --manifest-path examples/boot/application/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9160-ns,skip-include --out-dir out/examples/boot/nrf9160 \
|
||||
--- build --release --manifest-path examples/boot/application/nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840,skip-include --out-dir out/examples/boot/nrf \
|
||||
--- build --release --manifest-path examples/boot/application/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9160-ns,skip-include --out-dir out/examples/boot/nrf \
|
||||
--- build --release --manifest-path examples/boot/application/rp/Cargo.toml --target thumbv6m-none-eabi --features skip-include --out-dir out/examples/boot/rp \
|
||||
--- build --release --manifest-path examples/boot/application/stm32f3/Cargo.toml --target thumbv7em-none-eabi --features skip-include --out-dir out/examples/boot/stm32f3 \
|
||||
--- build --release --manifest-path examples/boot/application/stm32f7/Cargo.toml --target thumbv7em-none-eabi --features skip-include --out-dir out/examples/boot/stm32f7 \
|
||||
@ -155,7 +155,7 @@ cargo batch \
|
||||
--- build --release --manifest-path examples/boot/application/stm32l1/Cargo.toml --target thumbv7m-none-eabi --features skip-include --out-dir out/examples/boot/stm32l1 \
|
||||
--- build --release --manifest-path examples/boot/application/stm32l4/Cargo.toml --target thumbv7em-none-eabi --features skip-include --out-dir out/examples/boot/stm32l4 \
|
||||
--- build --release --manifest-path examples/boot/application/stm32wl/Cargo.toml --target thumbv7em-none-eabihf --features skip-include --out-dir out/examples/boot/stm32wl \
|
||||
--- build --release --manifest-path examples/boot/bootloader/nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840 \
|
||||
--- build --release --manifest-path examples/boot/bootloader/nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840 --out-dir out/examples/bootloader/nrf \
|
||||
--- build --release --manifest-path examples/boot/bootloader/nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features embassy-nrf/nrf9160-ns \
|
||||
--- build --release --manifest-path examples/boot/bootloader/rp/Cargo.toml --target thumbv6m-none-eabi \
|
||||
--- build --release --manifest-path examples/boot/bootloader/stm32/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32wl55jc-cm4 \
|
||||
@ -171,6 +171,7 @@ cargo batch \
|
||||
--- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585ai --out-dir out/tests/stm32u585ai \
|
||||
--- build --release --manifest-path tests/rp/Cargo.toml --target thumbv6m-none-eabi --out-dir out/tests/rpi-pico \
|
||||
--- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv7em-none-eabi --out-dir out/tests/nrf52840-dk \
|
||||
--- build --release --manifest-path tests/boot/nrf/Cargo.toml --target thumbv7em-none-eabi --out-dir out/tests/boot/nrf52840-dk \
|
||||
--- build --release --manifest-path tests/riscv32/Cargo.toml --target riscv32imac-unknown-none-elf \
|
||||
$BUILD_EXTRA
|
||||
|
||||
@ -180,6 +181,4 @@ if [[ -z "${TELEPROBE_TOKEN-}" ]]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
rm out/tests/stm32wb55rg/wpan_ble
|
||||
|
||||
teleprobe client run -r out/tests
|
||||
|
@ -12,7 +12,7 @@ firmware-logs = []
|
||||
|
||||
[dependencies]
|
||||
embassy-time = { version = "0.1.3", path = "../embassy-time"}
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync"}
|
||||
embassy-sync = { version = "0.2.0", path = "../embassy-sync"}
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures"}
|
||||
embassy-net-driver-channel = { version = "0.1.0", path = "../embassy-net-driver-channel"}
|
||||
atomic-polyfill = "0.1.5"
|
||||
|
@ -28,7 +28,7 @@ digest = "0.10"
|
||||
log = { version = "0.4", optional = true }
|
||||
ed25519-dalek = { version = "1.0.1", default_features = false, features = ["u32_backend"], optional = true }
|
||||
embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync" }
|
||||
embedded-storage = "0.3.0"
|
||||
embedded-storage-async = { version = "0.4.0", optional = true }
|
||||
salty = { git = "https://github.com/ycrypto/salty.git", rev = "a9f17911a5024698406b75c0fac56ab5ccf6a8c7", optional = true }
|
||||
|
@ -20,7 +20,7 @@ default = ["time"]
|
||||
|
||||
[dependencies]
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures", optional = true }
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../embassy-sync" }
|
||||
embassy-time = { version = "0.1.3", path = "../embassy-time", optional = true }
|
||||
embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = [
|
||||
"unproven",
|
||||
|
@ -21,7 +21,7 @@ defmt = { version = "0.3", optional = true }
|
||||
log = { version = "0.4.14", optional = true }
|
||||
|
||||
embassy-time = { version = "0.1.3", path = "../embassy-time", optional = true }
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../embassy-sync" }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32", default-features = false, optional = true }
|
||||
embedded-hal-async = { version = "=1.0.0-rc.1" }
|
||||
embedded-hal = { version = "0.2", features = ["unproven"] }
|
||||
|
@ -284,7 +284,11 @@ where
|
||||
self.busy.wait_for_low().await.map_err(|_| Busy)
|
||||
}
|
||||
async fn await_irq(&mut self) -> Result<(), RadioError> {
|
||||
self.dio1.wait_for_high().await.map_err(|_| DIO1)?;
|
||||
if self.board_type != BoardType::RpPicoWaveshareSx1262 {
|
||||
self.dio1.wait_for_high().await.map_err(|_| DIO1)?;
|
||||
} else {
|
||||
self.dio1.wait_for_rising_edge().await.map_err(|_| DIO1)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,6 @@ features = ["defmt"]
|
||||
defmt = { version = "0.3", optional = true }
|
||||
log = { version = "0.4.14", optional = true }
|
||||
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../embassy-sync" }
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures" }
|
||||
embassy-net-driver = { version = "0.1.0", path = "../embassy-net-driver" }
|
||||
|
@ -8,7 +8,7 @@ defmt = { version = "0.3", optional = true }
|
||||
log = { version = "0.4.14", optional = true }
|
||||
|
||||
embassy-time = { version = "0.1.3", path = "../embassy-time" }
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync"}
|
||||
embassy-sync = { version = "0.2.0", path = "../embassy-sync"}
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures"}
|
||||
embassy-net-driver-channel = { version = "0.1.0", path = "../embassy-net-driver-channel"}
|
||||
|
||||
|
@ -19,7 +19,7 @@ embedded-io-async = { version = "0.5.0" }
|
||||
embassy-net-driver-channel = { version = "0.1.0", path = "../embassy-net-driver-channel" }
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures" }
|
||||
ppproto = { version = "0.1.2"}
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../embassy-sync" }
|
||||
|
||||
[package.metadata.embassy_docs]
|
||||
src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-ppp-v$VERSION/embassy-net-ppp/src/"
|
||||
|
@ -52,7 +52,7 @@ smoltcp = { version = "0.10.0", default-features = false, features = [
|
||||
|
||||
embassy-net-driver = { version = "0.1.0", path = "../embassy-net-driver" }
|
||||
embassy-time = { version = "0.1.3", path = "../embassy-time" }
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../embassy-sync" }
|
||||
embedded-io-async = { version = "0.5.0", optional = true }
|
||||
|
||||
managed = { version = "0.8.0", default-features = false, features = [ "map" ] }
|
||||
|
@ -168,7 +168,7 @@ impl Config {
|
||||
}
|
||||
}
|
||||
|
||||
/// IPv4 configuration with dynamic addressing.
|
||||
/// IPv6 configuration with dynamic addressing.
|
||||
///
|
||||
/// # Example
|
||||
/// ```rust
|
||||
|
@ -92,7 +92,7 @@ _gpio-p1 = []
|
||||
|
||||
[dependencies]
|
||||
embassy-time = { version = "0.1.3", path = "../embassy-time", optional = true }
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../embassy-sync" }
|
||||
embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-3"] }
|
||||
embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" }
|
||||
embassy-usb-driver = {version = "0.1.0", path = "../embassy-usb-driver", optional=true }
|
||||
|
@ -86,6 +86,7 @@ pub(crate) fn init(irq_prio: crate::interrupt::Priority) {
|
||||
unsafe { irq.enable() };
|
||||
|
||||
let g = regs();
|
||||
g.events_port.write(|w| w);
|
||||
g.intenset.write(|w| w.port().set());
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ nightly = ["embedded-hal-1", "embedded-hal-async", "embedded-storage-async", "em
|
||||
unstable-traits = ["embedded-hal-1", "embedded-hal-nb"]
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../embassy-sync" }
|
||||
embassy-time = { version = "0.1.3", path = "../embassy-time", features = [ "tick-hz-1_000_000" ] }
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures" }
|
||||
embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-2"] }
|
||||
|
@ -12,7 +12,7 @@ features = ["stm32wb55rg"]
|
||||
|
||||
[dependencies]
|
||||
embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32" }
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../embassy-sync" }
|
||||
embassy-time = { version = "0.1.3", path = "../embassy-time", optional = true }
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures" }
|
||||
embassy-hal-internal = { version = "0.1.0", path = "../embassy-hal-internal" }
|
||||
|
@ -31,7 +31,7 @@ flavors = [
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../embassy-sync" }
|
||||
embassy-time = { version = "0.1.3", path = "../embassy-time", optional = true }
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures" }
|
||||
embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-4"] }
|
||||
@ -58,11 +58,11 @@ sdio-host = "0.5.0"
|
||||
embedded-sdmmc = { git = "https://github.com/embassy-rs/embedded-sdmmc-rs", rev = "a4f293d3a6f72158385f79c98634cb8a14d0d2fc", optional = true }
|
||||
critical-section = "1.1"
|
||||
atomic-polyfill = "1.0.1"
|
||||
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-4e6a74f69c4bc5d2d4872ba50d805e75bfe55cad" }
|
||||
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-e667107cf81934383ec5744f49b2cda0599ec749" }
|
||||
vcell = "0.1.3"
|
||||
bxcan = "0.7.0"
|
||||
nb = "1.0.0"
|
||||
stm32-fmc = "0.3.0"
|
||||
stm32-fmc = "0.2.4"
|
||||
seq-macro = "0.3.0"
|
||||
cfg-if = "1.0.0"
|
||||
embedded-io = { version = "0.5.0" }
|
||||
@ -77,7 +77,7 @@ critical-section = { version = "1.1", features = ["std"] }
|
||||
[build-dependencies]
|
||||
proc-macro2 = "1.0.36"
|
||||
quote = "1.0.15"
|
||||
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-4e6a74f69c4bc5d2d4872ba50d805e75bfe55cad", default-features = false, features = ["metadata"]}
|
||||
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-e667107cf81934383ec5744f49b2cda0599ec749", default-features = false, features = ["metadata"]}
|
||||
|
||||
[features]
|
||||
default = ["rt"]
|
||||
|
@ -49,9 +49,6 @@ impl<'d, T: Instance> Adc<'d, T> {
|
||||
|
||||
while T::regs().cr().read().adcal() {}
|
||||
|
||||
// Wait more than 4 clock cycles after adcal is cleared (RM0364 p. 223)
|
||||
delay.delay_us(6 * 1_000_000 / Self::freq().0);
|
||||
|
||||
// Enable the adc
|
||||
T::regs().cr().modify(|w| w.set_aden(true));
|
||||
|
||||
|
@ -80,21 +80,17 @@ foreach_peripheral!(
|
||||
#[cfg(any(stm32h7, adc_f3, adc_v4))]
|
||||
foreach_peripheral!(
|
||||
(adc, ADC3) => {
|
||||
#[cfg(not(any(stm32g4x1, stm32g4x2, stm32g4x3, stm32g4x4)))]
|
||||
impl crate::adc::sealed::Instance for peripherals::ADC3 {
|
||||
fn regs() -> crate::pac::adc::Adc {
|
||||
crate::pac::ADC3
|
||||
}
|
||||
#[cfg(all(not(adc_f1), not(adc_v1)))]
|
||||
#[allow(unreachable_code)]
|
||||
fn common_regs() -> crate::pac::adccommon::AdcCommon {
|
||||
foreach_peripheral!{
|
||||
(adccommon, ADC3_COMMON) => {
|
||||
return crate::pac::ADC3_COMMON
|
||||
};
|
||||
// Fall back to ADC_COMMON if ADC3_COMMON does not exist
|
||||
(adccommon, ADC_COMMON) => {
|
||||
return crate::pac::ADC_COMMON
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,24 +100,21 @@ foreach_peripheral!(
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(stm32g4x1, stm32g4x2, stm32g4x3, stm32g4x4)))]
|
||||
impl crate::adc::Instance for peripherals::ADC3 {}
|
||||
};
|
||||
(adc, ADC4) => {
|
||||
#[cfg(not(any(stm32g4x1, stm32g4x2, stm32g4x3, stm32g4x4)))]
|
||||
impl crate::adc::sealed::Instance for peripherals::ADC4 {
|
||||
fn regs() -> crate::pac::adc::Adc {
|
||||
crate::pac::ADC4
|
||||
}
|
||||
#[cfg(not(any(adc_f1, adc_v1)))]
|
||||
#[allow(unreachable_code)]
|
||||
fn common_regs() -> crate::pac::adccommon::AdcCommon {
|
||||
foreach_peripheral!{
|
||||
(adccommon, ADC3_COMMON) => {
|
||||
return crate::pac::ADC3_COMMON
|
||||
};
|
||||
// Fall back to ADC_COMMON if ADC3_COMMON does not exist
|
||||
(adccommon, ADC_COMMON) => {
|
||||
return crate::pac::ADC_COMMON
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,34 +124,11 @@ foreach_peripheral!(
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(stm32g4x1, stm32g4x2, stm32g4x3, stm32g4x4)))]
|
||||
impl crate::adc::Instance for peripherals::ADC4 {}
|
||||
};
|
||||
(adc, ADC5) => {
|
||||
impl crate::adc::sealed::Instance for peripherals::ADC5 {
|
||||
fn regs() -> crate::pac::adc::Adc {
|
||||
crate::pac::ADC5
|
||||
}
|
||||
#[cfg(not(any(adc_f1, adc_v1)))]
|
||||
#[allow(unreachable_code)]
|
||||
fn common_regs() -> crate::pac::adccommon::AdcCommon {
|
||||
foreach_peripheral!{
|
||||
(adccommon, ADC3_COMMON) => {
|
||||
return crate::pac::ADC3_COMMON
|
||||
};
|
||||
// Fall back to ADC_COMMON if ADC3_COMMON does not exist
|
||||
(adccommon, ADC_COMMON) => {
|
||||
return crate::pac::ADC_COMMON
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(adc_f3)]
|
||||
fn frequency() -> crate::time::Hertz {
|
||||
unsafe { crate::rcc::get_freqs() }.adc34.unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::adc::Instance for peripherals::ADC5 {}
|
||||
};
|
||||
(adc, $inst:ident) => {
|
||||
impl crate::adc::sealed::Instance for peripherals::$inst {
|
||||
|
@ -102,7 +102,7 @@ where
|
||||
let presc = Prescaler::from_pclk2(T::frequency());
|
||||
T::common_regs().ccr().modify(|w| w.set_adcpre(presc.adcpre()));
|
||||
T::regs().cr2().modify(|reg| {
|
||||
reg.set_adon(true);
|
||||
reg.set_adon(crate::pac::adc::vals::Adon::ENABLED);
|
||||
});
|
||||
|
||||
delay.delay_us(ADC_POWERUP_TIME_US);
|
||||
|
@ -410,6 +410,12 @@ impl<'d, T: BasicInstance> Drop for BufferedUartTx<'d, T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl embedded_io_async::Error for Error {
|
||||
fn kind(&self) -> embedded_io_async::ErrorKind {
|
||||
embedded_io_async::ErrorKind::Other
|
||||
}
|
||||
}
|
||||
|
||||
impl<'d, T: BasicInstance> embedded_io_async::ErrorType for BufferedUart<'d, T> {
|
||||
type Error = Error;
|
||||
}
|
||||
|
@ -545,13 +545,6 @@ impl<'d, T: BasicInstance, RxDma> UartRx<'d, T, RxDma> {
|
||||
unsafe { rdr(r).read_volatile() };
|
||||
clear_interrupt_flags(r, sr);
|
||||
|
||||
if enable_idle_line_detection {
|
||||
// enable idle interrupt
|
||||
r.cr1().modify(|w| {
|
||||
w.set_idleie(true);
|
||||
});
|
||||
}
|
||||
|
||||
compiler_fence(Ordering::SeqCst);
|
||||
|
||||
let has_errors = sr.pe() || sr.fe() || sr.ne() || sr.ore();
|
||||
@ -1037,61 +1030,20 @@ mod eh1 {
|
||||
}
|
||||
}
|
||||
|
||||
impl embedded_io::Error for Error {
|
||||
fn kind(&self) -> embedded_io::ErrorKind {
|
||||
embedded_io::ErrorKind::Other
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, TxDma, RxDma> embedded_io::ErrorType for Uart<'_, T, TxDma, RxDma>
|
||||
where
|
||||
T: BasicInstance,
|
||||
{
|
||||
type Error = Error;
|
||||
}
|
||||
|
||||
impl<T, TxDma> embedded_io::ErrorType for UartTx<'_, T, TxDma>
|
||||
where
|
||||
T: BasicInstance,
|
||||
{
|
||||
type Error = Error;
|
||||
}
|
||||
|
||||
impl<T, TxDma, RxDma> embedded_io::Write for Uart<'_, T, TxDma, RxDma>
|
||||
where
|
||||
T: BasicInstance,
|
||||
TxDma: crate::usart::TxDma<T>,
|
||||
{
|
||||
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> {
|
||||
self.blocking_write(buf)?;
|
||||
Ok(buf.len())
|
||||
}
|
||||
|
||||
fn flush(&mut self) -> Result<(), Self::Error> {
|
||||
self.blocking_flush()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, TxDma> embedded_io::Write for UartTx<'_, T, TxDma>
|
||||
where
|
||||
T: BasicInstance,
|
||||
TxDma: crate::usart::TxDma<T>,
|
||||
{
|
||||
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> {
|
||||
self.blocking_write(buf)?;
|
||||
Ok(buf.len())
|
||||
}
|
||||
|
||||
fn flush(&mut self) -> Result<(), Self::Error> {
|
||||
self.blocking_flush()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "unstable-traits", feature = "nightly"))]
|
||||
mod eio {
|
||||
use embedded_io_async::{ErrorType, Write};
|
||||
|
||||
use super::*;
|
||||
|
||||
impl<T, TxDma, RxDma> embedded_io_async::Write for Uart<'_, T, TxDma, RxDma>
|
||||
impl<T, TxDma, RxDma> ErrorType for Uart<'_, T, TxDma, RxDma>
|
||||
where
|
||||
T: BasicInstance,
|
||||
{
|
||||
type Error = Error;
|
||||
}
|
||||
|
||||
impl<T, TxDma, RxDma> Write for Uart<'_, T, TxDma, RxDma>
|
||||
where
|
||||
T: BasicInstance,
|
||||
TxDma: super::TxDma<T>,
|
||||
@ -1106,7 +1058,14 @@ mod eio {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, TxDma> embedded_io_async::Write for UartTx<'_, T, TxDma>
|
||||
impl<T, TxDma> ErrorType for UartTx<'_, T, TxDma>
|
||||
where
|
||||
T: BasicInstance,
|
||||
{
|
||||
type Error = Error;
|
||||
}
|
||||
|
||||
impl<T, TxDma> Write for UartTx<'_, T, TxDma>
|
||||
where
|
||||
T: BasicInstance,
|
||||
TxDma: super::TxDma<T>,
|
||||
|
@ -5,13 +5,6 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## 0.3.0 - 2023-09-14
|
||||
|
||||
- switch to embedded-io 0.5
|
||||
- add api for polling channels with context
|
||||
- standardise fn names on channels
|
||||
- add zero-copy channel
|
||||
|
||||
## 0.2.0 - 2023-04-13
|
||||
|
||||
- pubsub: Fix messages not getting popped when the last subscriber that needed them gets dropped.
|
||||
@ -26,4 +19,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## 0.1.0 - 2022-08-26
|
||||
|
||||
- First release
|
||||
- First release
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "embassy-sync"
|
||||
version = "0.3.0"
|
||||
version = "0.2.0"
|
||||
edition = "2021"
|
||||
description = "no-std, no-alloc synchronization primitives with async support"
|
||||
repository = "https://github.com/embassy-rs/embassy"
|
||||
|
@ -133,13 +133,7 @@ impl Ticker {
|
||||
Self { expires_at, duration }
|
||||
}
|
||||
|
||||
/// Resets the ticker back to its original state.
|
||||
/// This causes the ticker to go back to zero, even if the current tick isn't over yet.
|
||||
pub fn reset(&mut self) {
|
||||
self.expires_at = Instant::now() + self.duration;
|
||||
}
|
||||
|
||||
/// Waits for the next tick.
|
||||
/// Waits for the next tick
|
||||
pub fn next(&mut self) -> impl Future<Output = ()> + '_ {
|
||||
poll_fn(|cx| {
|
||||
if self.expires_at <= Instant::now() {
|
||||
|
@ -10,7 +10,7 @@ target = "thumbv7em-none-eabi"
|
||||
|
||||
[dependencies]
|
||||
embassy-usb = { version = "0.1.0", path = "../embassy-usb" }
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../embassy-sync" }
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures" }
|
||||
futures = { version = "0.3", default-features = false }
|
||||
static_cell = "1"
|
||||
|
@ -41,7 +41,7 @@ max-handler-count-8 = []
|
||||
[dependencies]
|
||||
embassy-futures = { version = "0.1.0", path = "../embassy-futures" }
|
||||
embassy-usb-driver = { version = "0.1.0", path = "../embassy-usb-driver" }
|
||||
embassy-sync = { version = "0.3.0", path = "../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../embassy-sync" }
|
||||
embassy-net-driver-channel = { version = "0.1.0", path = "../embassy-net-driver-channel" }
|
||||
|
||||
defmt = { version = "0.3", optional = true }
|
||||
|
@ -5,7 +5,7 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly"] }
|
||||
embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", "nightly"] }
|
||||
|
@ -5,7 +5,7 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly"] }
|
||||
embassy-rp = { version = "0.1.0", path = "../../../../embassy-rp", features = ["time-driver", "unstable-traits", "nightly"] }
|
||||
|
@ -5,7 +5,7 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f303re", "time-driver-any", "exti"] }
|
||||
|
@ -5,7 +5,7 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f767zi", "time-driver-any", "exti"] }
|
||||
|
@ -5,7 +5,7 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32h743zi", "time-driver-any", "exti"] }
|
||||
|
@ -5,7 +5,7 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l072cz", "time-driver-any", "exti", "memory-x"] }
|
||||
|
@ -5,7 +5,7 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l151cb-a", "time-driver-any", "exti"] }
|
||||
|
@ -5,7 +5,7 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l475vg", "time-driver-any", "exti"] }
|
||||
|
@ -5,7 +5,7 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../../../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32wl55jc-cm4", "time-driver-any", "exti"] }
|
||||
|
@ -1,17 +1,6 @@
|
||||
[unstable]
|
||||
build-std = ["core"]
|
||||
build-std-features = ["panic_immediate_abort"]
|
||||
|
||||
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
|
||||
#runner = "./fruitrunner"
|
||||
runner = "probe-rs run --chip nrf52840_xxAA"
|
||||
|
||||
rustflags = [
|
||||
# Code-size optimizations.
|
||||
"-Z", "trap-unreachable=no",
|
||||
#"-C", "no-vectorize-loops",
|
||||
"-C", "force-frame-pointers=yes",
|
||||
]
|
||||
runner = "teleprobe local run --chip nRF52832_xxAA --elf"
|
||||
|
||||
[build]
|
||||
target = "thumbv7em-none-eabi"
|
||||
|
@ -6,8 +6,8 @@ description = "Bootloader for nRF chips"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
defmt = { version = "0.3", optional = true }
|
||||
defmt-rtt = { version = "0.4", optional = true }
|
||||
defmt = { version = "0.3" }
|
||||
defmt-rtt = { version = "0.4" }
|
||||
|
||||
embassy-nrf = { path = "../../../../embassy-nrf", features = ["nightly"] }
|
||||
embassy-boot-nrf = { path = "../../../../embassy-boot/nrf" }
|
||||
@ -17,15 +17,9 @@ cortex-m-rt = { version = "0.7" }
|
||||
cfg-if = "1.0.0"
|
||||
|
||||
[features]
|
||||
defmt = [
|
||||
"dep:defmt",
|
||||
"embassy-boot-nrf/defmt",
|
||||
"embassy-nrf/defmt",
|
||||
]
|
||||
softdevice = [
|
||||
"embassy-boot-nrf/softdevice",
|
||||
]
|
||||
debug = ["defmt-rtt", "defmt"]
|
||||
|
||||
[profile.dev]
|
||||
debug = 2
|
||||
|
@ -4,7 +4,6 @@
|
||||
use core::cell::RefCell;
|
||||
|
||||
use cortex_m_rt::{entry, exception};
|
||||
#[cfg(feature = "defmt")]
|
||||
use defmt_rtt as _;
|
||||
use embassy_boot_nrf::*;
|
||||
use embassy_nrf::nvmc::Nvmc;
|
||||
|
@ -16,7 +16,7 @@ log = [
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "rtos-trace", "rtos-trace-interrupt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time" }
|
||||
embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] }
|
||||
|
@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
rtic = { version = "2", features = ["thumbv7-backend"] }
|
||||
|
||||
embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime", "generic-queue"] }
|
||||
embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["nightly", "unstable-traits", "defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] }
|
||||
|
||||
|
@ -29,7 +29,7 @@ nightly = [
|
||||
|
||||
[dependencies]
|
||||
embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] }
|
||||
embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] }
|
||||
|
@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = [
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = [
|
||||
"defmt",
|
||||
] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread",
|
||||
|
@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime"] }
|
||||
embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver", "critical-section-impl"] }
|
||||
|
@ -5,7 +5,7 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["log"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["log"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-std", "executor-thread", "log", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["log", "std", "nightly"] }
|
||||
embassy-net = { version = "0.1.0", path = "../../embassy-net", features=[ "std", "nightly", "log", "medium-ethernet", "medium-ip", "tcp", "udp", "dns", "dhcpv4", "proto-ipv6"] }
|
||||
|
@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32c031c6 to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32c031c6", "memory-x", "unstable-pac", "exti"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
|
||||
|
@ -14,7 +14,7 @@ cortex-m-rt = "0.7.0"
|
||||
defmt = "0.3"
|
||||
defmt-rtt = "0.4"
|
||||
panic-probe = "0.3"
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
static_cell = { version = "1.1", features = ["nightly"]}
|
||||
|
@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32f103c8 to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any", "unstable-traits" ] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
|
||||
|
@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32f207zg to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
|
||||
|
@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32f303ze to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
|
||||
|
@ -5,7 +5,7 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f334r8", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
|
||||
|
@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32f429zi to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "embedded-sdmmc", "chrono"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] }
|
||||
embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
|
||||
|
@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32f767zi to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f767zi", "memory-x", "unstable-pac", "time-driver-any", "exti"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-net = { path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet"] }
|
||||
|
@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32g071rb to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
|
||||
|
@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32g491re to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
|
||||
|
@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32h563zi to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h563zi", "memory-x", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] }
|
||||
embassy-net = { path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6"] }
|
||||
@ -29,7 +29,7 @@ heapless = { version = "0.7.5", default-features = false }
|
||||
rand_core = "0.6.3"
|
||||
critical-section = "1.1"
|
||||
micromath = "2.0.0"
|
||||
stm32-fmc = "0.3.0"
|
||||
stm32-fmc = "0.2.4"
|
||||
embedded-storage = "0.3.0"
|
||||
static_cell = { version = "1.1", features = ["nightly"]}
|
||||
|
||||
|
@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32h743bi to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "time-driver-any", "exti", "memory-x", "unstable-pac", "unstable-traits"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] }
|
||||
embassy-net = { path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6"] }
|
||||
@ -29,7 +29,7 @@ heapless = { version = "0.7.5", default-features = false }
|
||||
rand_core = "0.6.3"
|
||||
critical-section = "1.1"
|
||||
micromath = "2.0.0"
|
||||
stm32-fmc = "0.3.0"
|
||||
stm32-fmc = "0.2.4"
|
||||
embedded-storage = "0.3.0"
|
||||
static_cell = { version = "1.1", features = ["nightly"]}
|
||||
|
||||
|
@ -12,7 +12,7 @@ nightly = ["embassy-stm32/nightly", "embassy-time/nightly", "embassy-time/unstab
|
||||
[dependencies]
|
||||
# Change stm32l072cz to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-any", "exti", "unstable-traits", "memory-x"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["time", "defmt"], optional = true }
|
||||
|
@ -5,7 +5,7 @@ version = "0.1.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] }
|
||||
|
@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32l4s5vi to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l4s5qi", "memory-x", "time-driver-any", "exti", "unstable-traits", "chrono"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768", "unstable-traits", "nightly"] }
|
||||
embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" }
|
||||
|
@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32l552ze to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "unstable-traits", "memory-x"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
|
||||
|
@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32u585ai to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
|
||||
|
@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
# Change stm32wb55rg to your chip name in both dependencies, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wb55rg", "time-driver-any", "memory-x", "exti"] }
|
||||
embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", features = ["defmt", "stm32wb55rg"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "udp", "proto-ipv6", "medium-ieee802154", "nightly"], optional=true }
|
||||
|
@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
# Change stm32wl55jc-cm4 to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "unstable-pac", "exti", "chrono"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" }
|
||||
|
@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["log"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["log"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-wasm", "executor-thread", "log", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["log", "wasm", "nightly"] }
|
||||
|
||||
|
9
tests/boot/nrf/.cargo/config.toml
Normal file
9
tests/boot/nrf/.cargo/config.toml
Normal file
@ -0,0 +1,9 @@
|
||||
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
|
||||
runner = "teleprobe local run --chip nRF52832_xxAA --elf"
|
||||
#runner = "teleprobe client run"
|
||||
|
||||
[build]
|
||||
target = "thumbv7em-none-eabi"
|
||||
|
||||
[env]
|
||||
DEFMT_LOG = "trace"
|
@ -1,6 +1,6 @@
|
||||
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
|
||||
#runner = "teleprobe local run --chip nRF52840_xxAA --elf"
|
||||
runner = "teleprobe client run"
|
||||
runner = "teleprobe local run --chip nRF52832_xxAA --elf"
|
||||
#runner = "teleprobe client run"
|
||||
|
||||
[build]
|
||||
target = "thumbv7em-none-eabi"
|
||||
|
@ -8,10 +8,10 @@ license = "MIT OR Apache-2.0"
|
||||
teleprobe-meta = "1"
|
||||
|
||||
embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt", "nightly"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt", "nightly"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "nightly", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "nightly", "unstable-traits", "defmt-timestamp-uptime"] }
|
||||
embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nightly", "unstable-traits", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] }
|
||||
embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nightly", "unstable-traits", "nrf52832", "time-driver-rtc1", "gpiote", "unstable-pac"] }
|
||||
embedded-io-async = { version = "0.5.0" }
|
||||
embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "nightly"] }
|
||||
embassy-net-esp-hosted = { version = "0.1.0", path = "../../embassy-net-esp-hosted", features = ["defmt"] }
|
||||
|
@ -1,17 +1,35 @@
|
||||
use std::error::Error;
|
||||
use std::path::PathBuf;
|
||||
use std::{env, fs};
|
||||
//! This build script copies the `memory.x` file from the crate root into
|
||||
//! a directory where the linker can always find it at build time.
|
||||
//! For many projects this is optional, as the linker always searches the
|
||||
//! project root directory -- wherever `Cargo.toml` is. However, if you
|
||||
//! are using a workspace or have a more complicated build setup, this
|
||||
//! build script becomes required. Additionally, by requesting that
|
||||
//! Cargo re-run the build script whenever `memory.x` is changed,
|
||||
//! updating `memory.x` ensures a rebuild of the application with the
|
||||
//! new memory settings.
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let out = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
fs::write(out.join("link_ram.x"), include_bytes!("link_ram.x")).unwrap();
|
||||
use std::env;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
// Put `memory.x` in our output directory and ensure it's
|
||||
// on the linker search path.
|
||||
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
|
||||
File::create(out.join("memory.x"))
|
||||
.unwrap()
|
||||
.write_all(include_bytes!("memory.x"))
|
||||
.unwrap();
|
||||
println!("cargo:rustc-link-search={}", out.display());
|
||||
println!("cargo:rerun-if-changed=link_ram.x");
|
||||
|
||||
// By default, Cargo will re-run a build script whenever
|
||||
// any file in the project changes. By specifying `memory.x`
|
||||
// here, we ensure the build script is only re-run when
|
||||
// `memory.x` is changed.
|
||||
println!("cargo:rerun-if-changed=memory.x");
|
||||
|
||||
println!("cargo:rustc-link-arg-bins=--nmagic");
|
||||
println!("cargo:rustc-link-arg-bins=-Tlink_ram.x");
|
||||
println!("cargo:rustc-link-arg-bins=-Tlink.x");
|
||||
println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
|
||||
println!("cargo:rustc-link-arg-bins=-Tteleprobe.x");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -1,254 +0,0 @@
|
||||
/* ##### EMBASSY NOTE
|
||||
Originally from https://github.com/rust-embedded/cortex-m-rt/blob/master/link.x.in
|
||||
Adjusted to put everything in RAM
|
||||
*/
|
||||
|
||||
/* # Developer notes
|
||||
|
||||
- Symbols that start with a double underscore (__) are considered "private"
|
||||
|
||||
- Symbols that start with a single underscore (_) are considered "semi-public"; they can be
|
||||
overridden in a user linker script, but should not be referred from user code (e.g. `extern "C" {
|
||||
static mut __sbss }`).
|
||||
|
||||
- `EXTERN` forces the linker to keep a symbol in the final binary. We use this to make sure a
|
||||
symbol if not dropped if it appears in or near the front of the linker arguments and "it's not
|
||||
needed" by any of the preceding objects (linker arguments)
|
||||
|
||||
- `PROVIDE` is used to provide default values that can be overridden by a user linker script
|
||||
|
||||
- On alignment: it's important for correctness that the VMA boundaries of both .bss and .data *and*
|
||||
the LMA of .data are all 4-byte aligned. These alignments are assumed by the RAM initialization
|
||||
routine. There's also a second benefit: 4-byte aligned boundaries means that you won't see
|
||||
"Address (..) is out of bounds" in the disassembly produced by `objdump`.
|
||||
*/
|
||||
|
||||
/* Provides information about the memory layout of the device */
|
||||
/* This will be provided by the user (see `memory.x`) or by a Board Support Crate */
|
||||
INCLUDE memory.x
|
||||
|
||||
/* # Entry point = reset vector */
|
||||
EXTERN(__RESET_VECTOR);
|
||||
EXTERN(Reset);
|
||||
ENTRY(Reset);
|
||||
|
||||
/* # Exception vectors */
|
||||
/* This is effectively weak aliasing at the linker level */
|
||||
/* The user can override any of these aliases by defining the corresponding symbol themselves (cf.
|
||||
the `exception!` macro) */
|
||||
EXTERN(__EXCEPTIONS); /* depends on all the these PROVIDED symbols */
|
||||
|
||||
EXTERN(DefaultHandler);
|
||||
|
||||
PROVIDE(NonMaskableInt = DefaultHandler);
|
||||
EXTERN(HardFaultTrampoline);
|
||||
PROVIDE(MemoryManagement = DefaultHandler);
|
||||
PROVIDE(BusFault = DefaultHandler);
|
||||
PROVIDE(UsageFault = DefaultHandler);
|
||||
PROVIDE(SecureFault = DefaultHandler);
|
||||
PROVIDE(SVCall = DefaultHandler);
|
||||
PROVIDE(DebugMonitor = DefaultHandler);
|
||||
PROVIDE(PendSV = DefaultHandler);
|
||||
PROVIDE(SysTick = DefaultHandler);
|
||||
|
||||
PROVIDE(DefaultHandler = DefaultHandler_);
|
||||
PROVIDE(HardFault = HardFault_);
|
||||
|
||||
/* # Interrupt vectors */
|
||||
EXTERN(__INTERRUPTS); /* `static` variable similar to `__EXCEPTIONS` */
|
||||
|
||||
/* # Pre-initialization function */
|
||||
/* If the user overrides this using the `pre_init!` macro or by creating a `__pre_init` function,
|
||||
then the function this points to will be called before the RAM is initialized. */
|
||||
PROVIDE(__pre_init = DefaultPreInit);
|
||||
|
||||
/* # Sections */
|
||||
SECTIONS
|
||||
{
|
||||
PROVIDE(_stack_start = ORIGIN(RAM) + LENGTH(RAM));
|
||||
|
||||
/* ## Sections in RAM */
|
||||
/* ### Vector table */
|
||||
.vector_table ORIGIN(RAM) :
|
||||
{
|
||||
/* Initial Stack Pointer (SP) value */
|
||||
LONG(_stack_start);
|
||||
|
||||
/* Reset vector */
|
||||
KEEP(*(.vector_table.reset_vector)); /* this is the `__RESET_VECTOR` symbol */
|
||||
__reset_vector = .;
|
||||
|
||||
/* Exceptions */
|
||||
KEEP(*(.vector_table.exceptions)); /* this is the `__EXCEPTIONS` symbol */
|
||||
__eexceptions = .;
|
||||
|
||||
/* Device specific interrupts */
|
||||
KEEP(*(.vector_table.interrupts)); /* this is the `__INTERRUPTS` symbol */
|
||||
} > RAM
|
||||
|
||||
PROVIDE(_stext = ADDR(.vector_table) + SIZEOF(.vector_table));
|
||||
|
||||
/* ### .text */
|
||||
.text _stext :
|
||||
{
|
||||
__stext = .;
|
||||
*(.Reset);
|
||||
|
||||
*(.text .text.*);
|
||||
|
||||
/* The HardFaultTrampoline uses the `b` instruction to enter `HardFault`,
|
||||
so must be placed close to it. */
|
||||
*(.HardFaultTrampoline);
|
||||
*(.HardFault.*);
|
||||
|
||||
. = ALIGN(4); /* Pad .text to the alignment to workaround overlapping load section bug in old lld */
|
||||
__etext = .;
|
||||
} > RAM
|
||||
|
||||
/* ### .rodata */
|
||||
.rodata : ALIGN(4)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__srodata = .;
|
||||
*(.rodata .rodata.*);
|
||||
|
||||
/* 4-byte align the end (VMA) of this section.
|
||||
This is required by LLD to ensure the LMA of the following .data
|
||||
section will have the correct alignment. */
|
||||
. = ALIGN(4);
|
||||
__erodata = .;
|
||||
} > RAM
|
||||
|
||||
/* ## Sections in RAM */
|
||||
/* ### .data */
|
||||
.data : ALIGN(4)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__sdata = .;
|
||||
__edata = .;
|
||||
*(.data .data.*);
|
||||
. = ALIGN(4); /* 4-byte align the end (VMA) of this section */
|
||||
} > RAM
|
||||
/* Allow sections from user `memory.x` injected using `INSERT AFTER .data` to
|
||||
* use the .data loading mechanism by pushing __edata. Note: do not change
|
||||
* output region or load region in those user sections! */
|
||||
. = ALIGN(4);
|
||||
|
||||
/* LMA of .data */
|
||||
__sidata = LOADADDR(.data);
|
||||
|
||||
/* ### .gnu.sgstubs
|
||||
This section contains the TrustZone-M veneers put there by the Arm GNU linker. */
|
||||
/* Security Attribution Unit blocks must be 32 bytes aligned. */
|
||||
/* Note that this pads the RAM usage to 32 byte alignment. */
|
||||
.gnu.sgstubs : ALIGN(32)
|
||||
{
|
||||
. = ALIGN(32);
|
||||
__veneer_base = .;
|
||||
*(.gnu.sgstubs*)
|
||||
. = ALIGN(32);
|
||||
__veneer_limit = .;
|
||||
} > RAM
|
||||
|
||||
/* ### .bss */
|
||||
.bss (NOLOAD) : ALIGN(4)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__sbss = .;
|
||||
*(.bss .bss.*);
|
||||
*(COMMON); /* Uninitialized C statics */
|
||||
. = ALIGN(4); /* 4-byte align the end (VMA) of this section */
|
||||
} > RAM
|
||||
/* Allow sections from user `memory.x` injected using `INSERT AFTER .bss` to
|
||||
* use the .bss zeroing mechanism by pushing __ebss. Note: do not change
|
||||
* output region or load region in those user sections! */
|
||||
. = ALIGN(4);
|
||||
__ebss = .;
|
||||
|
||||
/* ### .uninit */
|
||||
.uninit (NOLOAD) : ALIGN(4)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__suninit = .;
|
||||
*(.uninit .uninit.*);
|
||||
. = ALIGN(4);
|
||||
__euninit = .;
|
||||
} > RAM
|
||||
|
||||
/* Place the heap right after `.uninit` in RAM */
|
||||
PROVIDE(__sheap = __euninit);
|
||||
|
||||
/* ## .got */
|
||||
/* Dynamic relocations are unsupported. This section is only used to detect relocatable code in
|
||||
the input files and raise an error if relocatable code is found */
|
||||
.got (NOLOAD) :
|
||||
{
|
||||
KEEP(*(.got .got.*));
|
||||
}
|
||||
|
||||
/* ## Discarded sections */
|
||||
/DISCARD/ :
|
||||
{
|
||||
/* Unused exception related info that only wastes space */
|
||||
*(.ARM.exidx);
|
||||
*(.ARM.exidx.*);
|
||||
*(.ARM.extab.*);
|
||||
}
|
||||
}
|
||||
|
||||
/* Do not exceed this mark in the error messages below | */
|
||||
/* # Alignment checks */
|
||||
ASSERT(ORIGIN(RAM) % 4 == 0, "
|
||||
ERROR(cortex-m-rt): the start of the RAM region must be 4-byte aligned");
|
||||
|
||||
ASSERT(__sdata % 4 == 0 && __edata % 4 == 0, "
|
||||
BUG(cortex-m-rt): .data is not 4-byte aligned");
|
||||
|
||||
ASSERT(__sidata % 4 == 0, "
|
||||
BUG(cortex-m-rt): the LMA of .data is not 4-byte aligned");
|
||||
|
||||
ASSERT(__sbss % 4 == 0 && __ebss % 4 == 0, "
|
||||
BUG(cortex-m-rt): .bss is not 4-byte aligned");
|
||||
|
||||
ASSERT(__sheap % 4 == 0, "
|
||||
BUG(cortex-m-rt): start of .heap is not 4-byte aligned");
|
||||
|
||||
/* # Position checks */
|
||||
|
||||
/* ## .vector_table */
|
||||
ASSERT(__reset_vector == ADDR(.vector_table) + 0x8, "
|
||||
BUG(cortex-m-rt): the reset vector is missing");
|
||||
|
||||
ASSERT(__eexceptions == ADDR(.vector_table) + 0x40, "
|
||||
BUG(cortex-m-rt): the exception vectors are missing");
|
||||
|
||||
ASSERT(SIZEOF(.vector_table) > 0x40, "
|
||||
ERROR(cortex-m-rt): The interrupt vectors are missing.
|
||||
Possible solutions, from most likely to less likely:
|
||||
- Link to a svd2rust generated device crate
|
||||
- Check that you actually use the device/hal/bsp crate in your code
|
||||
- Disable the 'device' feature of cortex-m-rt to build a generic application (a dependency
|
||||
may be enabling it)
|
||||
- Supply the interrupt handlers yourself. Check the documentation for details.");
|
||||
|
||||
/* ## .text */
|
||||
ASSERT(ADDR(.vector_table) + SIZEOF(.vector_table) <= _stext, "
|
||||
ERROR(cortex-m-rt): The .text section can't be placed inside the .vector_table section
|
||||
Set _stext to an address greater than the end of .vector_table (See output of `nm`)");
|
||||
|
||||
ASSERT(_stext + SIZEOF(.text) < ORIGIN(RAM) + LENGTH(RAM), "
|
||||
ERROR(cortex-m-rt): The .text section must be placed inside the RAM memory.
|
||||
Set _stext to an address smaller than 'ORIGIN(RAM) + LENGTH(RAM)'");
|
||||
|
||||
/* # Other checks */
|
||||
ASSERT(SIZEOF(.got) == 0, "
|
||||
ERROR(cortex-m-rt): .got section detected in the input object files
|
||||
Dynamic relocations are not supported. If you are linking to C code compiled using
|
||||
the 'cc' crate then modify your build script to compile the C code _without_
|
||||
the -fPIC flag. See the documentation of the `cc::Build.pic` method for details.");
|
||||
/* Do not exceed this mark in the error messages above | */
|
||||
|
||||
|
||||
/* Provides weak aliases (cf. PROVIDED) for device specific interrupt handlers */
|
||||
/* This will usually be provided by a device crate generated using svd2rust (see `device.x`) */
|
||||
INCLUDE device.x
|
@ -1,5 +1,7 @@
|
||||
MEMORY
|
||||
{
|
||||
FLASH : ORIGIN = 0x00000000, LENGTH = 1024K
|
||||
RAM : ORIGIN = 0x20000000, LENGTH = 256K
|
||||
/* NOTE 1 K = 1 KiBi = 1024 bytes */
|
||||
/* These values correspond to the NRF52840 with Softdevices S140 7.0.1 */
|
||||
FLASH : ORIGIN = 0x00000000, LENGTH = 256K
|
||||
RAM : ORIGIN = 0x20000000, LENGTH = 32K
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
teleprobe_meta::target!(b"nrf52840-dk");
|
||||
teleprobe_meta::target!(b"nrf52-dk");
|
||||
|
||||
use defmt::{assert, info};
|
||||
use embassy_executor::Spawner;
|
||||
|
@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
critical-section = { version = "1.1.1", features = ["restore-state-bool"] }
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync" }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync" }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-riscv32", "nightly", "executor-thread"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time" }
|
||||
embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
|
||||
|
@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
[dependencies]
|
||||
teleprobe-meta = "1.1"
|
||||
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "nightly", "unstable-traits"] }
|
||||
embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["nightly", "defmt", "unstable-pac", "unstable-traits", "time-driver", "critical-section-impl", "intrinsics", "rom-v2-intrinsics", "run-from-ram"] }
|
||||
|
@ -29,7 +29,7 @@ dac-adc-pin = []
|
||||
[dependencies]
|
||||
teleprobe-meta = "1"
|
||||
|
||||
embassy-sync = { version = "0.3.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "tick-hz-32_768", "defmt-timestamp-uptime"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "memory-x", "time-driver-any"] }
|
||||
|
Reference in New Issue
Block a user