From f88aa9ce4857d59a5bcb40e300728c9b1f6e8f06 Mon Sep 17 00:00:00 2001 From: James Munns Date: Mon, 27 Nov 2023 21:42:10 +0100 Subject: [PATCH 1/2] (FAQ): Add time driver note --- docs/modules/ROOT/pages/faq.adoc | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/docs/modules/ROOT/pages/faq.adoc b/docs/modules/ROOT/pages/faq.adoc index 2994c627..1b4357be 100644 --- a/docs/modules/ROOT/pages/faq.adoc +++ b/docs/modules/ROOT/pages/faq.adoc @@ -80,3 +80,39 @@ unsafe fn HardFault(_frame: &ExceptionFrame) -> ! { ---- Refer to cortex-m's link:https://docs.rs/cortex-m-rt/latest/cortex_m_rt/attr.exception.html[exception handling] for more info. + +== `embassy-time` throws linker errors + +If you see linker error like this: + +[source,text] +---- + = note: rust-lld: error: undefined symbol: _embassy_time_now + >>> referenced by driver.rs:127 (src/driver.rs:127) + >>> embassy_time-846f66f1620ad42c.embassy_time.4f6a638abb75dd4c-cgu.0.rcgu.o:(embassy_time::driver::now::hefb1f99d6e069842) in archive Devel/Embedded/pogodyna/target/thumbv7em-none-eabihf/debug/deps/libembassy_time-846f66f1620ad42c.rlib + + rust-lld: error: undefined symbol: _embassy_time_allocate_alarm + >>> referenced by driver.rs:134 (src/driver.rs:134) + >>> embassy_time-846f66f1620ad42c.embassy_time.4f6a638abb75dd4c-cgu.0.rcgu.o:(embassy_time::driver::allocate_alarm::hf5145b6bd46706b2) in archive Devel/Embedded/pogodyna/target/thumbv7em-none-eabihf/debug/deps/libembassy_time-846f66f1620ad42c.rlib + + rust-lld: error: undefined symbol: _embassy_time_set_alarm_callback + >>> referenced by driver.rs:139 (src/driver.rs:139) + >>> embassy_time-846f66f1620ad42c.embassy_time.4f6a638abb75dd4c-cgu.0.rcgu.o:(embassy_time::driver::set_alarm_callback::h24f92388d96eafd2) in archive Devel/Embedded/pogodyna/target/thumbv7em-none-eabihf/debug/deps/libembassy_time-846f66f1620ad42c.rlib + + rust-lld: error: undefined symbol: _embassy_time_set_alarm + >>> referenced by driver.rs:144 (src/driver.rs:144) + >>> embassy_time-846f66f1620ad42c.embassy_time.4f6a638abb75dd4c-cgu.0.rcgu.o:(embassy_time::driver::set_alarm::h530a5b1f444a6d5b) in archive Devel/Embedded/pogodyna/target/thumbv7em-none-eabihf/debug/deps/libembassy_time-846f66f1620ad42c.rlib +---- + +You probably need to enable a time driver for your HAL (not in `embassy-time`!). For example with `embassy-stm32`, you might need to enable `time-driver-any`: + +[source,toml] +---- +[dependencies.embassy-stm32] +version = "0.1.0", +features = [ + # ... + "time-driver-any", # Add this line! + # ... +] +---- From 74a6855f0104f5e9a4ad8603546444d9428c8917 Mon Sep 17 00:00:00 2001 From: James Munns Date: Mon, 27 Nov 2023 21:43:05 +0100 Subject: [PATCH 2/2] Update docs/modules/ROOT/pages/faq.adoc --- docs/modules/ROOT/pages/faq.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/ROOT/pages/faq.adoc b/docs/modules/ROOT/pages/faq.adoc index 1b4357be..37a2605d 100644 --- a/docs/modules/ROOT/pages/faq.adoc +++ b/docs/modules/ROOT/pages/faq.adoc @@ -109,7 +109,7 @@ You probably need to enable a time driver for your HAL (not in `embassy-time`!). [source,toml] ---- [dependencies.embassy-stm32] -version = "0.1.0", +version = "0.1.0" features = [ # ... "time-driver-any", # Add this line!