embassy-rs / embassy

Modern embedded framework, using Rust and async.
https://embassy.dev
Apache License 2.0
5.67k stars 791 forks source link

Difficulty Compiling for STM32 #1466

Closed alexshirley closed 1 year ago

alexshirley commented 1 year ago

So a bit of a n00b, but I'm running into troubles creating a new project

error logs ```bash libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol WWDG libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol RTC libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol FLASH libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol RCC libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol EXTI0_1 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol EXTI2_3 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol EXTI4_15 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol DMA1_CHANNEL1 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol DMA1_CHANNEL2_3 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol DMA1_CHANNEL4_5 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol ADC1 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM1_BRK_UP_TRG_COM libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM1_CC libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM3 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM6 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM7 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM14 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM15 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM16 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM17 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol I2C1 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol I2C2 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol SPI1 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol SPI2 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol USART1 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol USART2 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol USART3_4 libstm32_metapac-bd62a65356f59473.rlib(stm32_metapac-bd62a65356f59473.stm32_metapac.160da54d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol USB libcortex_m_rt-e3b58d0a626900a1.rlib(cortex_m_rt-e3b58d0a626900a1.cortex_m_rt.2fb0f525-cgu.3.rcgu.o) : error LNK2001: unresolved external symbol Reset libcortex_m_rt-e3b58d0a626900a1.rlib(cortex_m_rt-e3b58d0a626900a1.cortex_m_rt.2fb0f525-cgu.3.rcgu.o) : error LNK2001: unresolved external symbol NonMaskableInt libcortex_m_rt-e3b58d0a626900a1.rlib(cortex_m_rt-e3b58d0a626900a1.cortex_m_rt.2fb0f525-cgu.3.rcgu.o) : error LNK2001: unresolved external symbol HardFaultTrampoline libcortex_m_rt-e3b58d0a626900a1.rlib(cortex_m_rt-e3b58d0a626900a1.cortex_m_rt.2fb0f525-cgu.3.rcgu.o) : error LNK2001: unresolved external symbol MemoryManagement libcortex_m_rt-e3b58d0a626900a1.rlib(cortex_m_rt-e3b58d0a626900a1.cortex_m_rt.2fb0f525-cgu.3.rcgu.o) : error LNK2001: unresolved external symbol BusFault libcortex_m_rt-e3b58d0a626900a1.rlib(cortex_m_rt-e3b58d0a626900a1.cortex_m_rt.2fb0f525-cgu.3.rcgu.o) : error LNK2001: unresolved external symbol UsageFault libcortex_m_rt-e3b58d0a626900a1.rlib(cortex_m_rt-e3b58d0a626900a1.cortex_m_rt.2fb0f525-cgu.3.rcgu.o) : error LNK2001: unresolved external symbol SVCall libcortex_m_rt-e3b58d0a626900a1.rlib(cortex_m_rt-e3b58d0a626900a1.cortex_m_rt.2fb0f525-cgu.3.rcgu.o) : error LNK2001: unresolved external symbol DebugMonitor libcortex_m_rt-e3b58d0a626900a1.rlib(cortex_m_rt-e3b58d0a626900a1.cortex_m_rt.2fb0f525-cgu.3.rcgu.o) : error LNK2001: unresolved external symbol PendSV libcortex_m_rt-e3b58d0a626900a1.rlib(cortex_m_rt-e3b58d0a626900a1.cortex_m_rt.2fb0f525-cgu.3.rcgu.o) : error LNK2001: unresolved external symbol SysTick ```

Here are my dependencies

[dependencies]
stm32-metapac = "7.0.0"
cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] }
cortex-m-rt = "0.7.1"
cortex-m-semihosting = "0.3.3"
panic-halt = "0.2.0"
embassy-executor = {version = "0.2.0", git = "https://github.com/embassy-rs/embassy", features = ["defmt", "integrated-timers"] }
embassy-time = {version = "0.1.0", git = "https://github.com/embassy-rs/embassy", features = ["defmt", "defmt-timestamp-uptime"] }
embassy-stm32 = {version = "0.1.0", git = "https://github.com/embassy-rs/embassy.git", features = ["defmt","stm32f070cb"]}

My kneejerk reaction is that embassy-stm32 and cortex-m-rt are missing additional dependencies, or some additional toml settings, which I've tried to remediate by pulling them into my dependencies as well. However, I have no idea what seems to be wrong with my current setup.

alexshirley commented 1 year ago

Quick update:

I decided to switch over to nightly, redownloaded the STM32 v6m compiler, and still got a very similar message, this time with the full context:

bash output ```bash error: linking with `link.exe` failed: exit code: 1120 | = note: "D:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\Users\\Me\\AppData\\Local\\Temp\\rustcN4WX28\\symbols.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.build_script_build.81c1c68622bd59a9-cgu.0.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.build_script_build.81c1c68622bd59a9-cgu.1.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.build_script_build.81c1c68622bd59a9-cgu.10.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.build_script_build.81c1c68622bd59a9-cgu.11.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.build_script_build.81c1c68622bd59a9-cgu.12.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.build_script_build.81c1c68622bd59a9-cgu.13.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.build_script_build.81c1c68622bd59a9-cgu.14.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.build_script_build.81c1c68622bd59a9-cgu.15.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.build_script_build.81c1c68622bd59a9-cgu.2.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.build_script_build.81c1c68622bd59a9-cgu.3.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.build_script_build.81c1c68622bd59a9-cgu.4.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.build_script_build.81c1c68622bd59a9-cgu.5.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.build_script_build.81c1c68622bd59a9-cgu.6.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.build_script_build.81c1c68622bd59a9-cgu.7.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.build_script_build.81c1c68622bd59a9-cgu.8.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.build_script_build.81c1c68622bd59a9-cgu.9.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.1859h6dhhcwkefk9.rcgu.o" "/LIBPATH:C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\deps" "/LIBPATH:C:\\Users\\Me\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\stm32-metapac-7.0.0/src/chips/stm32f070cb" "/LIBPATH:C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\cortex-m-rt-2ebccca765b4c1e1\\out" "/LIBPATH:C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\deps\\libstm32_metapac-9912149c59a1d024.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\deps\\libcortex_m-d2eb502326c64cda.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\deps\\libembedded_hal-1f47a0238fb4ac28.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\deps\\libvoid-6b3aa605112187c1.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\deps\\libnb-38e8662f8b5aab55.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\deps\\libnb-d90d895c5489634b.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\deps\\libvolatile_register-52a8f9c9d1491acf.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\deps\\libvcell-061b6a584b814dc5.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\deps\\libbare_metal-eafd81ca5e1206e6.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\deps\\libcortex_m_rt-4faad5b4cc4830e8.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\deps\\libquote-1c5a5b99f2b01435.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\deps\\libproc_macro2-224ef92cf7a8e297.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\deps\\libunicode_ident-fb44f0087c2a31dc.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libproc_macro-9e71230232747fa7.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-f06e7c156c07babf.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-66d3788cb65295c2.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_demangle-15be6ae923696459.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd_detect-ccd246deb449e005.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libhashbrown-434e22ac2d88ab17.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_alloc-591ae27697943a49.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libminiz_oxide-9633500de6d1ff03.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libadler-a3b7bf1c07db541f.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-07e6fc7575a725e2.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcfg_if-5f5b866d8ed0bc9a.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-3983930a0c9e59c9.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-8b5016f268855328.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_core-69892fa511d5a698.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-798bc7c2d986ac97.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-fe5d904068e00acb.rlib" "kernel32.lib" "advapi32.lib" "bcrypt.lib" "kernel32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "kernel32.lib" "msvcrt.lib" "/NXCOMPAT" "/LIBPATH:C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "/OUT:C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\build\\embassy-stm32-58942b6ee258a7a6\\build_script_build-58942b6ee258a7a6.exe" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:C:\\Users\\Me\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libstd.natvis" = note: libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol WWDG libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol RTC libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol FLASH libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol RCC libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol EXTI0_1 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol EXTI2_3 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol EXTI4_15 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol DMA1_CHANNEL1 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol DMA1_CHANNEL2_3 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol DMA1_CHANNEL4_5 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol ADC1 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM1_BRK_UP_TRG_COM libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM1_CC libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM3 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM6 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM7 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM14 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM15 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM16 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol TIM17 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol I2C1 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol I2C2 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol SPI1 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol SPI2 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol USART1 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol USART2 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol USART3_4 libstm32_metapac-9912149c59a1d024.rlib(stm32_metapac-9912149c59a1d024.stm32_metapac.2823805c8cf4806d-cgu.4.rcgu.o) : error LNK2001: unresolved external symbol USB libcortex_m_rt-4faad5b4cc4830e8.rlib(cortex_m_rt-4faad5b4cc4830e8.cortex_m_rt.85cf949c9bb5a779-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol Reset libcortex_m_rt-4faad5b4cc4830e8.rlib(cortex_m_rt-4faad5b4cc4830e8.cortex_m_rt.85cf949c9bb5a779-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol NonMaskableInt libcortex_m_rt-4faad5b4cc4830e8.rlib(cortex_m_rt-4faad5b4cc4830e8.cortex_m_rt.85cf949c9bb5a779-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol HardFaultTrampoline libcortex_m_rt-4faad5b4cc4830e8.rlib(cortex_m_rt-4faad5b4cc4830e8.cortex_m_rt.85cf949c9bb5a779-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol MemoryManagement libcortex_m_rt-4faad5b4cc4830e8.rlib(cortex_m_rt-4faad5b4cc4830e8.cortex_m_rt.85cf949c9bb5a779-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol BusFault libcortex_m_rt-4faad5b4cc4830e8.rlib(cortex_m_rt-4faad5b4cc4830e8.cortex_m_rt.85cf949c9bb5a779-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol UsageFault libcortex_m_rt-4faad5b4cc4830e8.rlib(cortex_m_rt-4faad5b4cc4830e8.cortex_m_rt.85cf949c9bb5a779-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol SVCall libcortex_m_rt-4faad5b4cc4830e8.rlib(cortex_m_rt-4faad5b4cc4830e8.cortex_m_rt.85cf949c9bb5a779-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol DebugMonitor libcortex_m_rt-4faad5b4cc4830e8.rlib(cortex_m_rt-4faad5b4cc4830e8.cortex_m_rt.85cf949c9bb5a779-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol PendSV libcortex_m_rt-4faad5b4cc4830e8.rlib(cortex_m_rt-4faad5b4cc4830e8.cortex_m_rt.85cf949c9bb5a779-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol SysTick C:\Users\Me\Documents\embed-rust\app\target\debug\build\embassy-stm32-58942b6ee258a7a6\build_script_build-58942b6ee258a7a6.exe : fatal error LNK1120: 38 unresolved externals error: could not compile `embassy-stm32` (build script) due to previous error ```
alexshirley commented 1 year ago

I updated

[package]
...
edition = "2021"
...

and that seemed to change something, which seems to indicate that the USB is not getting picked up

Compilation Issues ```bash error[E0433]: failed to resolve: unresolved import --> C:\Users\Me\Documents\embed-rust\app\target\thumbv6m-none-eabi\debug\build\embassy-stm32-fdf8868461f25813\out/_generated.rs:1:28806 | 1 | ...: usart :: CtsPin , USART4 , PB7 , 4u8) ; pin_trait_impl ! (crate :: usb :: DmPin , USB , PA11 , 0u8) ; pin_trait_impl ! (crate :: usb :: DpPin , USB , PA12 , 0u8) ; dma_trait_impl ! (crate :... | ^^^ | | | unresolved import | help: a similar path exists: `stm32_metapac::usb` error[E0433]: failed to resolve: unresolved import --> C:\Users\Me\Documents\embed-rust\app\target\thumbv6m-none-eabi\debug\build\embassy-stm32-fdf8868461f25813\out/_generated.rs:1:28868 | 1 | ...ate :: usb :: DmPin , USB , PA11 , 0u8) ; pin_trait_impl ! (crate :: usb :: DpPin , USB , PA12 , 0u8) ; dma_trait_impl ! (crate :: i2c :: TxDma , I2C1 , { channel : DMA1_CH2 } , ()) ; dma_tra... | ^^^ | | | unresolved import | help: a similar path exists: `stm32_metapac::usb` For more information about this error, try `rustc --explain E0433`. error: could not compile `embassy-stm32` (lib) due to 2 previous errors ```
alexshirley commented 1 year ago

I completely removed the edition section, and that seems to have done something

trace ```rust error[E0425]: cannot find function `__basepri_r` in module `crate::asm::inline` --> C:\Users\Me\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cortex-m-0.7.7\src\register\basepri.rs:6:15 | 6 | call_asm!(__basepri_r() -> u8) | ^^^^^^^^^^^ not found in `crate::asm::inline` error[E0425]: cannot find function `__basepri_w` in module `crate::asm::inline` --> C:\Users\Me\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cortex-m-0.7.7\src\register\basepri.rs:22:19 | 22 | call_asm!(__basepri_w(basepri: u8)); | ^^^^^^^^^^^ not found in `crate::asm::inline` error[E0425]: cannot find function `__basepri_max` in module `crate::asm::inline` --> C:\Users\Me\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cortex-m-0.7.7\src\register\basepri_max.rs:19:19 | 19 | call_asm!(__basepri_max(basepri: u8)); | ^^^^^^^^^^^^^ not found in `crate::asm::inline` error[E0425]: cannot find function `__faultmask_r` in module `crate::asm::inline` --> C:\Users\Me\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cortex-m-0.7.7\src\register\faultmask.rs:29:28 | 29 | let r: u32 = call_asm!(__faultmask_r() -> u32); | ^^^^^^^^^^^^^ not found in `crate::asm::inline` error: invalid register `r0`: unknown register --> C:\Users\Me\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cortex-m-0.7.7\src\..\asm\inline.rs:197:24 | 197 | asm!("bkpt #0xab", inout("r0") nr, in("r1") arg, options(nomem, nostack, preserves_flags)); | ^^^^^^^^^^^^^^ error: invalid register `r1`: unknown register --> C:\Users\Me\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cortex-m-0.7.7\src\..\asm\inline.rs:197:40 | 197 | asm!("bkpt #0xab", inout("r0") nr, in("r1") arg, options(nomem, nostack, preserves_flags)); | ```
Dirbaio commented 1 year ago

you need edition=2021 because it defaults to resolver=2. Otherwise it's merging dependency features across deps and build-deps. For example, invalid register r0: unknown register fails because it's trying to build ARM ASM for x86, and x86 has no r0.

First, make sure you're using exactly the Rust nightly version that's supported by Embassy. Put this file at the root of your project.

Second, if that still doesn't fix it: Can you change it to back when you were getting the USB-related error? and then please paste

alexshirley commented 1 year ago

Ok, I did put the rust-toolchain at the project root, and re-added the edition=2021, so now I'm back to the USB error

cargo.toml [package] authors = ["Alex Shirley"] edition = "2021" readme = "README.md" name = "app" version = "0.1.0" [dependencies] cortex-m = { version = "=0.7.6", features = ["inline-asm"] } stm32-metapac = "7.0.0" cortex-m-rt = "0.7.0" defmt = "0.3" defmt-rtt = "0.4" panic-probe = "0.3" cortex-m-semihosting = "0.3.3" embassy-executor = {version = "0.2.0", path = "../embassy/embassy-executor", features = ["defmt", "integrated-timers"] } embassy-time = {version = "0.1.0", path = "../embassy/embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } embassy-usb = {version = "0.1.0", path = "../embassy/embassy-usb", features = ["defmt"]} embassy-stm32 = {version = "0.1.0", path = "../embassy/embassy-stm32", features = ["defmt","stm32f070cb"]} # this lets you use `cargo fix`! [[bin]] name = "app" test = false bench = false [profile.release] codegen-units = 1 # better optimizations debug = true # symbols are nice and they don't increase the size on Flash lto = true # better optimizations
.cargo/config.toml [target.thumbv6m-none-eabi] # uncomment this to make `cargo run` execute programs on QEMU # runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" runner = 'probe-rs-cli run --chip STM32F070CBT6' [target.'cfg(all(target_arch = "arm", target_os = "none"))'] # uncomment ONE of these three option to make `cargo run` start a GDB session # which option to pick depends on your system runner = "arm-none-eabi-gdb -q -x openocd.gdb" # runner = "gdb-multiarch -q -x openocd.gdb" # runner = "gdb -q -x openocd.gdb" rustflags = [ # Previously, the linker arguments --nmagic and -Tlink.x were set here. # They are now set by build.rs instead. The linker argument can still # only be set here, if a custom linker is needed. # By default, the LLD linker is used, which is shipped with the Rust # toolchain. If you run into problems with LLD, you can switch to the # GNU linker by uncommenting this line: # "-C", "linker=arm-none-eabi-ld", # If you need to link to pre-compiled C libraries provided by a C toolchain # use GCC as the linker by uncommenting the three lines below: # "-C", "linker=arm-none-eabi-gcc", # "-C", "link-arg=-Wl,-Tlink.x", # "-C", "link-arg=-nostartfiles", ] [build] # Pick ONE of these default compilation targets target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ # target = "thumbv7m-none-eabi" # Cortex-M3 # target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU) # target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU) # target = "thumbv8m.base-none-eabi" # Cortex-M23 # target = "thumbv8m.main-none-eabi" # Cortex-M33 (no FPU) # target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU)

cargo tree --format {p}{f}:

app v0.1.0 (C:\Users\Me\Documents\embed-rust\app) ├── cortex-m v0.7.6 inline-asm │ ├── bare-metal v0.2.5 const-fn │ │ [build-dependencies] │ │ └── rustc_version v0.2.3 │ │ └── semver v0.9.0 default │ │ └── semver-parser v0.7.0 │ ├── bitfield v0.13.2 │ ├── embedded-hal v0.2.7 unproven │ │ ├── nb v0.1.3 unstable │ │ │ └── nb v1.1.0 │ │ └── void v1.0.2 │ └── volatile-register v0.2.1 │ └── vcell v0.1.3 ├── cortex-m-rt v0.7.3 device │ └── cortex-m-rt-macros v0.7.0 (proc-macro) │ ├── proc-macro2 v1.0.58 default,proc-macro │ │ └── unicode-ident v1.0.8 │ ├── quote v1.0.27 default,proc-macro │ │ └── proc-macro2 v1.0.58 default,proc-macro () │ └── syn v1.0.109 clone-impls,default,derive,extra-traits,full,parsing,printing,proc-macro,quote,visit │ ├── proc-macro2 v1.0.58 default,proc-macro () │ ├── quote v1.0.27 default,proc-macro () │ └── unicode-ident v1.0.8 ├── cortex-m-semihosting v0.3.7 │ └── cortex-m v0.7.6 inline-asm () ├── defmt v0.3.4 │ ├── bitflags v1.3.2 default │ └── defmt-macros v0.3.5 (proc-macro) │ ├── defmt-parser v0.3.3 unstable │ │ └── thiserror v1.0.40 │ │ └── thiserror-impl v1.0.40 (proc-macro) │ │ ├── proc-macro2 v1.0.58 default,proc-macro ()
│ │ ├── quote v1.0.27 default,proc-macro (
) │ │ └── syn v2.0.16 clone-impls,default,derive,full,parsing,printing,proc-macro,quote │ │ ├── proc-macro2 v1.0.58 default,proc-macro () │ │ ├── quote v1.0.27 default,proc-macro ()
│ │ └── unicode-ident v1.0.8 │ ├── proc-macro-error v1.0.4 default,syn,syn-error │ │ ├── proc-macro-error-attr v1.0.4 (proc-macro) │ │ │ ├── proc-macro2 v1.0.58 default,proc-macro ()
│ │ │ └── quote v1.0.27 default,proc-macro (
) │ │ │ [build-dependencies] │ │ │ └── version_check v0.9.4 │ │ ├── proc-macro2 v1.0.58 default,proc-macro () │ │ ├── quote v1.0.27 default,proc-macro () │ │ └── syn v1.0.109 clone-impls,default,derive,extra-traits,full,parsing,printing,proc-macro,quote,visit () │ │ [build-dependencies] │ │ └── version_check v0.9.4 │ ├── proc-macro2 v1.0.58 default,proc-macro () │ ├── quote v1.0.27 default,proc-macro () │ └── syn v1.0.109 clone-impls,default,derive,extra-traits,full,parsing,printing,proc-macro,quote,visit () ├── defmt-rtt v0.4.0 │ ├── critical-section v1.1.1 │ └── defmt v0.3.4 () ├── embassy-executor v0.2.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-executor) defmt,integrated-timers │ ├── atomic-polyfill v1.0.2 │ │ └── critical-section v1.1.1 │ ├── critical-section v1.1.1 │ ├── defmt v0.3.4 () │ ├── embassy-macros v0.2.0 (proc-macro) (C:\Users\Me\Documents\embed-rust\embassy\embassy-macros) │ │ ├── darling v0.13.4 default,suggestions │ │ │ ├── darling_core v0.13.4 strsim,suggestions │ │ │ │ ├── fnv v1.0.7 default,std │ │ │ │ ├── ident_case v1.0.1 │ │ │ │ ├── proc-macro2 v1.0.58 default,proc-macro ()
│ │ │ │ ├── quote v1.0.27 default,proc-macro (
) │ │ │ │ ├── strsim v0.10.0 │ │ │ │ └── syn v1.0.109 clone-impls,default,derive,extra-traits,full,parsing,printing,proc-macro,quote,visit () │ │ │ └── darling_macro v0.13.4 (proc-macro) │ │ │ ├── darling_core v0.13.4 strsim,suggestions ()
│ │ │ ├── quote v1.0.27 default,proc-macro () │ │ │ └── syn v1.0.109 clone-impls,default,derive,extra-traits,full,parsing,printing,proc-macro,quote,visit () │ │ ├── proc-macro2 v1.0.58 default,proc-macro () │ │ ├── quote v1.0.27 default,proc-macro () │ │ └── syn v1.0.109 clone-impls,default,derive,extra-traits,full,parsing,printing,proc-macro,quote,visit () │ ├── embassy-time v0.1.1 (C:\Users\Me\Documents\embed-rust\embassy\embassy-time) defmt,defmt-timestamp-uptime │ │ ├── atomic-polyfill v1.0.2 () │ │ ├── cfg-if v1.0.0 │ │ ├── critical-section v1.1.1 │ │ ├── defmt v0.3.4 () │ │ ├── embedded-hal v0.2.7 unproven () │ │ ├── futures-util v0.3.28 async-await,async-await-macro,futures-macro,futures-sink,sink │ │ │ ├── futures-core v0.3.28 │ │ │ ├── futures-macro v0.3.28 (proc-macro) │ │ │ │ ├── proc-macro2 v1.0.58 default,proc-macro ()
│ │ │ │ ├── quote v1.0.27 default,proc-macro (
) │ │ │ │ └── syn v2.0.16 clone-impls,default,derive,full,parsing,printing,proc-macro,quote () │ │ │ ├── futures-sink v0.3.28 │ │ │ ├── futures-task v0.3.28 │ │ │ ├── pin-project-lite v0.2.9 │ │ │ └── pin-utils v0.1.0 │ │ └── heapless v0.7.16 atomic-polyfill,cas,default │ │ ├── atomic-polyfill v0.1.11 │ │ │ └── critical-section v1.1.1 │ │ ├── hash32 v0.2.1 │ │ │ └── byteorder v1.4.3 │ │ └── stable_deref_trait v1.2.0 │ │ [build-dependencies] │ │ └── rustc_version v0.4.0 │ │ └── semver v1.0.17 default,std │ ├── futures-util v0.3.28 async-await,async-await-macro,futures-macro,futures-sink,sink () │ └── static_cell v1.0.0 │ └── atomic-polyfill v1.0.2 () ├── embassy-stm32 v0.1.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-stm32) default,defmt,stm32f070cb │ ├── atomic-polyfill v1.0.2 () │ ├── bit_field v0.10.2 │ ├── bxcan v0.7.0 defmt,unstable-defmt │ │ ├── bitflags v1.3.2 default │ │ ├── defmt v0.3.4 () │ │ ├── embedded-hal v0.2.7 unproven () │ │ ├── nb v1.1.0 │ │ └── vcell v0.1.3 │ ├── cfg-if v1.0.0 │ ├── cortex-m v0.7.6 inline-asm () │ ├── cortex-m-rt v0.7.3 device () │ ├── critical-section v1.1.1 │ ├── defmt v0.3.4 () │ ├── embassy-cortex-m v0.1.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-cortex-m) default,prio-bits-4 │ │ ├── atomic-polyfill v1.0.2 () │ │ ├── cfg-if v1.0.0 │ │ ├── cortex-m v0.7.6 inline-asm () │ │ ├── critical-section v1.1.1 │ │ ├── embassy-executor v0.2.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-executor) defmt,integrated-timers () │ │ ├── embassy-hal-common v0.1.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-hal-common) defmt │ │ │ ├── defmt v0.3.4 () │ │ │ └── num-traits v0.2.15 │ │ │ [build-dependencies] │ │ │ └── autocfg v1.1.0 │ │ ├── embassy-macros v0.2.0 (proc-macro) (C:\Users\Me\Documents\embed-rust\embassy\embassy-macros) () │ │ └── embassy-sync v0.2.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-sync) defmt │ │ ├── cfg-if v1.0.0 │ │ ├── critical-section v1.1.1 │ │ ├── defmt v0.3.4 () │ │ ├── embedded-io v0.4.0 │ │ ├── futures-util v0.3.28 async-await,async-await-macro,futures-macro,futures-sink,sink () │ │ └── heapless v0.7.16 atomic-polyfill,cas,default ()
│ ├── embassy-embedded-hal v0.1.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-embedded-hal) defmt │ │ ├── defmt v0.3.4 (
) │ │ ├── embassy-sync v0.2.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-sync) defmt () │ │ ├── embedded-hal v0.2.7 unproven () │ │ ├── embedded-hal v1.0.0-alpha.10 │ │ ├── embedded-storage v0.3.0 │ │ └── nb v1.1.0 │ ├── embassy-executor v0.2.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-executor) defmt,integrated-timers () │ ├── embassy-futures v0.1.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-futures) │ ├── embassy-hal-common v0.1.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-hal-common) defmt () │ ├── embassy-net-driver v0.1.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-net-driver) defmt │ │ └── defmt v0.3.4 () │ ├── embassy-sync v0.2.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-sync) defmt () │ ├── embedded-hal v0.2.7 unproven () │ ├── embedded-storage v0.3.0 │ ├── futures v0.3.28 async-await │ │ ├── futures-channel v0.3.28 futures-sink,sink │ │ │ ├── futures-core v0.3.28 │ │ │ └── futures-sink v0.3.28 │ │ ├── futures-core v0.3.28 │ │ ├── futures-io v0.3.28 │ │ ├── futures-sink v0.3.28 │ │ ├── futures-task v0.3.28 │ │ └── futures-util v0.3.28 async-await,async-await-macro,futures-macro,futures-sink,sink () │ ├── nb v1.1.0 │ ├── rand_core v0.6.4 │ ├── sdio-host v0.5.0 │ ├── seq-macro v0.3.3 (proc-macro) │ ├── stm32-fmc v0.2.4 default,sdram │ │ └── embedded-hal v0.2.7 unproven () │ ├── stm32-metapac v7.0.0 cortex-m-rt,default,pac,rt,stm32f070cb
│ │ ├── cortex-m v0.7.6 inline-asm (
) │ │ └── cortex-m-rt v0.7.3 device () │ └── vcell v0.1.3 │ [build-dependencies] │ ├── proc-macro2 v1.0.58 default,proc-macro () │ ├── quote v1.0.27 default,proc-macro () │ └── stm32-metapac v7.0.0 cortex-m-rt,metadata,rt,stm32f070cb
│ ├── cortex-m v0.7.6 │ │ ├── bare-metal v0.2.5 const-fn │ │ │ [build-dependencies] │ │ │ └── rustc_version v0.2.3 (
) │ │ ├── bitfield v0.13.2 │ │ ├── embedded-hal v0.2.7 │ │ │ ├── nb v0.1.3 │ │ │ │ └── nb v1.1.0 │ │ │ └── void v1.0.2 │ │ └── volatile-register v0.2.1 │ │ └── vcell v0.1.3 │ └── cortex-m-rt v0.7.3 device │ └── cortex-m-rt-macros v0.7.0 (proc-macro) () ├── embassy-time v0.1.1 (C:\Users\Me\Documents\embed-rust\embassy\embassy-time) defmt,defmt-timestamp-uptime () ├── embassy-usb v0.1.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-usb) default,defmt,usbd-hid │ ├── defmt v0.3.4 () │ ├── embassy-futures v0.1.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-futures) │ ├── embassy-net-driver-channel v0.1.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-net-driver-channel) │ │ ├── embassy-futures v0.1.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-futures) │ │ ├── embassy-net-driver v0.1.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-net-driver) defmt () │ │ └── embassy-sync v0.2.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-sync) defmt () │ ├── embassy-sync v0.2.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-sync) defmt () │ ├── embassy-usb-driver v0.1.0 (C:\Users\Me\Documents\embed-rust\embassy\embassy-usb-driver) defmt │ │ └── defmt v0.3.4 () │ ├── heapless v0.7.16 atomic-polyfill,cas,default () │ ├── ssmarshal v1.0.0 │ │ ├── encode_unicode v0.3.6 │ │ └── serde v1.0.163 │ └── usbd-hid v0.6.1 │ ├── serde v1.0.163 │ ├── ssmarshal v1.0.0 () │ ├── usb-device v0.2.9 │ └── usbd-hid-macros v0.6.0 (proc-macro) │ ├── byteorder v1.4.3 │ ├── proc-macro2 v1.0.58 default,proc-macro () │ ├── quote v1.0.27 default,proc-macro () │ ├── serde v1.0.163 │ ├── syn v1.0.109 clone-impls,default,derive,extra-traits,full,parsing,printing,proc-macro,quote,visit () │ └── usbd-hid-descriptors v0.1.2 │ └── bitfield v0.13.2 ├── panic-probe v0.3.1 │ └── cortex-m v0.7.6 inline-asm () ├── static_cell v1.0.0 () └── stm32-metapac v7.0.0 cortex-m-rt,default,pac,rt,stm32f070cb (*)

rustc --version rustc 1.71.0-nightly (7908a1d65 2023-04-17)
cargo --version cargo 1.71.0-nightly (d0a4cbcee 2023-04-16)
cargo --version cargo 1.71.0-nightly (d0a4cbcee 2023-04-16)
rustup show Default host: x86_64-pc-windows-msvc rustup home: C:\Users\Me\.rustup installed toolchains -------------------- stable-x86_64-pc-windows-msvc nightly-2023-04-18-x86_64-pc-windows-msvc nightly-x86_64-pc-windows-msvc (default) installed targets for active toolchain -------------------------------------- riscv32imac-unknown-none-elf thumbv6m-none-eabi thumbv7em-none-eabi thumbv7em-none-eabihf thumbv7m-none-eabi thumbv8m.main-none-eabihf wasm32-unknown-unknown x86_64-pc-windows-msvc active toolchain ---------------- nightly-2023-04-18-x86_64-pc-windows-msvc (overridden by 'C:\Users\Me\Documents\embed-rust\app\rust-toolchain.toml') rustc 1.71.0-nightly (7908a1d65 2023-04-17)

Updated to remove some comments from the cargo.toml

Dirbaio commented 1 year ago

Thanks for the detailed report! #1467 fixes it.

alexshirley commented 1 year ago

Oh.... you're not going to believe this:

so I git pulled the changes to master ( #1467 )

and now I get some really strange stuff

Error log ```bash Compiling app v0.1.0 (C:\Users\Me\Documents\embed-rust\app) warning: unused import: `embassy_executor::Spawner` --> src\main.rs:7:5 | 7 | use embassy_executor::Spawner; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: unused import: `embassy_stm32 as stm32` --> src\main.rs:8:5 | 8 | use embassy_stm32 as stm32; | ^^^^^^^^^^^^^^^^^^^^^^ error: linking with `rust-lld` failed: exit code: 1 | = note: "rust-lld" "-flavor" "gnu" "C:\\Users\\Me\\AppData\\Local\\Temp\\rustcZPlr1e\\symbols.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\app-d8edf52da0de2fc2.2tnkvuq8pqvz30q9.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\app-d8edf52da0de2fc2.2xeu7trzphn5pujx.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\app-d8edf52da0de2fc2.4zxatr14vrga0afj.rcgu.o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\app-d8edf52da0de2fc2.5g5mqcwha8pw992w.rcgu.o" "--as-needed" "-L" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps" "-L" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\debug\\deps" "-L" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\build\\app-8760c3e60e98fd68\\out" "-L" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\build\\cortex-m-2a2c1cf939415100\\out" "-L" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\build\\cortex-m-rt-28b49e65b2596476\\out" "-L" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\build\\cortex-m-semihosting-b682f0ff348d29b8\\out" "-L" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\build\\defmt-8af0000efb59e6aa\\out" "-L" "C:\\Users\\Me\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\stm32-metapac-7.0.0/src/chips/stm32f070cb" "-L" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-2023-04-18-x86_64-pc-windows-msvc\\lib\\rustlib\\thumbv6m-none-eabi\\lib" "-Bstatic" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libpanic_probe-c6df554a64873c57.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libembassy_stm32-ea6753ea160ccbf8.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libfutures-9428502ca2abc55e.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libembassy_futures-0a0d15d9932503ef.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libembedded_storage-213280e2fa07a940.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libembassy_embedded_hal-f6af4498d8867005.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libembedded_hal-66ba30afb3c348a4.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libstm32_metapac-751fde3e6cb74d9a.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libembassy_sync-54a8ae41eebb490a.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libheapless-88c14b24539c091d.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libstable_deref_trait-d54310192f76bc06.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libatomic_polyfill-54484fb83421d978.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libhash32-f7b226c63c61ad1f.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libbyteorder-9c6528e151555ef1.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libembassy_cortex_m-e0858a265c528920.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libembassy_hal_common-eda9a73457b15546.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libnum_traits-45dbc6f3ffdcc840.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libembassy_executor-68422b19606b884a.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libstatic_cell-13c32f9fbde85c9f.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libembassy_time-cce134b172b18234.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libdefmt-2d92ec9d74de4867.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libbitflags-a1dbec0c0a73ce9f.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libfutures_util-449120aa96e26f14.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libpin_project_lite-d4e4fc15f4524910.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libfutures_sink-24ef459451752031.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libfutures_task-fcfd650c7a8a6894.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libpin_utils-74f630b161a4f90e.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libfutures_core-c76ba74369d967ae.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libatomic_polyfill-c8d03d23c85fc39e.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libcritical_section-f3db3f09cb4f9ddd.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libcortex_m_semihosting-47b9f602613e6c4d.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libcortex_m-63865844f5fd470f.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libembedded_hal-35d09b69ac89b361.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libvoid-8fe00f65b8c7fed3.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libnb-3b209198be5d6d94.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libnb-1feb345a6911011f.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libvolatile_register-26f85a2f5fc0141a.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libvcell-b6b545d00ae52e86.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libbare_metal-4a7ddc36faddfbe5.rlib" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\libcortex_m_rt-647cf281d313b4c5.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-2023-04-18-x86_64-pc-windows-msvc\\lib\\rustlib\\thumbv6m-none-eabi\\lib\\librustc_std_workspace_core-ccb7dfa5e4c7fdc1.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-2023-04-18-x86_64-pc-windows-msvc\\lib\\rustlib\\thumbv6m-none-eabi\\lib\\libcore-afe3b1261452b8cb.rlib" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-2023-04-18-x86_64-pc-windows-msvc\\lib\\rustlib\\thumbv6m-none-eabi\\lib\\libcompiler_builtins-16148e05660078dd.rlib" "-Bdynamic" "--eh-frame-hdr" "-z" "noexecstack" "-L" "C:\\Users\\Me\\.rustup\\toolchains\\nightly-2023-04-18-x86_64-pc-windows-msvc\\lib\\rustlib\\thumbv6m-none-eabi\\lib" "-o" "C:\\Users\\Me\\Documents\\embed-rust\\app\\target\\thumbv6m-none-eabi\\debug\\deps\\app-d8edf52da0de2fc2" "--gc-sections" "--nmagic" "-Tlink.x" = note: rust-lld: warning: section type mismatch for .got >>> :(.got): SHT_PROGBITS >>> output section .got: SHT_NOBITS rust-lld: warning: section type mismatch for .got.plt >>> :(.got.plt): SHT_PROGBITS >>> output section .got: SHT_NOBITS rust-lld: warning: section type mismatch for .got >>> :(.got): SHT_PROGBITS >>> output section .got: SHT_NOBITS rust-lld: error: undefined symbol: _critical_section_1_0_acquire >>> referenced by lib.rs:180 (C:\Users\Me\.cargo\registry\src\index.crates.io-6f17d22bba15001f\critical-section-1.1.1\src\lib.rs:180) >>> embassy_sync-54a8ae41eebb490a.24aj22h0jmd9ayn4.rcgu.o:(critical_section::with::h21e6a56423d3ae40) in archive C:\Users\Me\Documents\embed-rust\app\target\thumbv6m-none-eabi\debug\deps\libembassy_sync-54a8ae41eebb490a.rlib >>> referenced by lib.rs:180 (C:\Users\Me\.cargo\registry\src\index.crates.io-6f17d22bba15001f\critical-section-1.1.1\src\lib.rs:180) >>> atomic_polyfill-c8d03d23c85fc39e.atomic_polyfill.27d7baf0-cgu.1.rcgu.o:(critical_section::with::h96f89c70c139d747) in archive C:\Users\Me\Documents\embed-rust\app\target\thumbv6m-none-eabi\debug\deps\libatomic_polyfill-c8d03d23c85fc39e.rlib rust-lld: error: undefined symbol: _critical_section_1_0_release >>> referenced by lib.rs:197 (C:\Users\Me\.cargo\registry\src\index.crates.io-6f17d22bba15001f\critical-section-1.1.1\src\lib.rs:197) >>> atomic_polyfill-54484fb83421d978.atomic_polyfill.db25adb6-cgu.0.rcgu.o:(core::ptr::drop_in_place$LT$critical_section..with..Guard$GT$::h51053d2d9edda3d0) in archive C:\Users\Me\Documents\embed-rust\app\target\thumbv6m-none-eabi\debug\deps\libatomic_polyfill-54484fb83421d978.rlib >>> referenced by lib.rs:197 (C:\Users\Me\.cargo\registry\src\index.crates.io-6f17d22bba15001f\critical-section-1.1.1\src\lib.rs:197) >>> atomic_polyfill-c8d03d23c85fc39e.atomic_polyfill.27d7baf0-cgu.0.rcgu.o:(core::ptr::drop_in_place$LT$critical_section..with..Guard$GT$::h104296ca1181c667) in archive C:\Users\Me\Documents\embed-rust\app\target\thumbv6m-none-eabi\debug\deps\libatomic_polyfill-c8d03d23c85fc39e.rlib ```
alexshirley commented 1 year ago

Disregard. Solution was to add

"critical-section-single-core"
[dependencies]
cortex-m = { version = "=0.7.6", features = ["inline-asm","critical-section-single-core"] }