{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-embedded/cortex-m/issues/125","repository_url":"https://api.github.com/repos/rust-embedded/cortex-m","labels_url":"https://api.github.com/repos/rust-embedded/cortex-m/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/rust-embedded/cortex-m/issues/125/comments","events_url":"https://api.github.com/repos/rust-embedded/cortex-m/issues/125/events","html_url":"https://github.com/rust-embedded/cortex-m/issues/125","id":388546992,"node_id":"MDU6SXNzdWUzODg1NDY5OTI=","number":125,"title":"cortex_m::asm::delay() doesn't seem to work on thumbv6m","user":{"login":"therealprof","id":3321888,"node_id":"MDQ6VXNlcjMzMjE4ODg=","avatar_url":"https://avatars2.githubusercontent.com/u/3321888?v=4","gravatar_id":"","url":"https://api.github.com/users/therealprof","html_url":"https://github.com/therealprof","followers_url":"https://api.github.com/users/therealprof/followers","following_url":"https://api.github.com/users/therealprof/following{/other_user}","gists_url":"https://api.github.com/users/therealprof/gists{/gist_id}","starred_url":"https://api.github.com/users/therealprof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therealprof/subscriptions","organizations_url":"https://api.github.com/users/therealprof/orgs","repos_url":"https://api.github.com/users/therealprof/repos","events_url":"https://api.github.com/users/therealprof/events{/privacy}","received_events_url":"https://api.github.com/users/therealprof/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-07T08:09:58Z","updated_at":"2018-12-07T08:09:58Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"While attempting to create an example for https://github.com/rust-embedded/wg/issues/259 to blink an LED using `cortex_m::asm::delay` I'm greeted with this interesting error:\r\n```\r\n#![no_main]\r\n#![no_std]\r\n\r\nextern crate cortex_m;\r\nextern crate cortex_m_rt;\r\nextern crate panic_halt;\r\n\r\nextern crate stm32f042_hal as hal;\r\n\r\nuse hal::prelude::*;\r\nuse hal::stm32;\r\n\r\nuse cortex_m::asm::delay;\r\nuse cortex_m_rt::entry;\r\n\r\n#[entry]\r\nfn main() -> ! {\r\n    let p = stm32::Peripherals::take().unwrap();\r\n    let gpioa = p.GPIOA.split();\r\n    let mut led = gpioa.pa1.into_push_pull_output();\r\n\r\n    loop {\r\n        led.set_high();\r\n        delay(8_000_000);\r\n\r\n        led.set_low();\r\n        delay(8_000_000);\r\n    }\r\n}\r\n```\r\n\r\n```\r\nerror: linking with `rust-lld` failed: exit code: 1\r\n  |\r\n  = note: \"rust-lld\" \"-flavor\" \"gnu\" \"-L\" \"/Users/egger/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/thumbv6m-none-eabi/lib\" \"/Users/egger/OSS/stm32f042-hal/target/thumbv6m-none-eabi/release/examples/blinky-b437c53f5b36f500.blinky.60cthedq-cgu.1.rcgu.o\" \"-o\" \"/Users/egger/OSS/stm32f042-hal/target/thumbv6m-none-eabi/release/examples/blinky-b437c53f5b36f500\" \"--gc-sections\" \"-L\" \"/Users/egger/OSS/stm32f042-hal/target/thumbv6m-none-eabi/release/deps\" \"-L\" \"/Users/egger/OSS/stm32f042-hal/target/release/deps\" \"-L\" \"/Users/egger/OSS/stm32f042-hal/target/thumbv6m-none-eabi/release/build/cortex-m-563ed60a5fde6333/out\" \"-L\" \"/Users/egger/OSS/stm32f042-hal/target/thumbv6m-none-eabi/release/build/cortex-m-rt-414ccd4438657f1e/out\" \"-L\" \"/Users/egger/OSS/stm32f042-hal/target/thumbv6m-none-eabi/release/build/stm32f0-f3baf49fdf34c49d/out\" \"-L\" \"/Users/egger/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/thumbv6m-none-eabi/lib\" \"--start-group\" \"-Bstatic\" \"/var/folders/8f/ch8vbtq93ldfc4vksdp5cw540000gn/T/rustcjqym5j/libcortex_m_rt-f3ac26fff634eea2.rlib\" \"/var/folders/8f/ch8vbtq93ldfc4vksdp5cw540000gn/T/rustcjqym5j/libcortex_m-945aa0e87bd515a7.rlib\" \"--end-group\" \"/Users/egger/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/thumbv6m-none-eabi/lib/libcompiler_builtins-962f36023deecec7.rlib\" \"-Tlink.x\" \"-Bdynamic\"\r\n  = note: rust-lld: error: /var/folders/8f/ch8vbtq93ldfc4vksdp5cw540000gn/T/rustcjqym5j/libcortex_m-945aa0e87bd515a7.rlib(cortex-m.o):(.text.__delay+0x4): unrecognized reloc 103\r\n```"}}
{"actor":{"display_login":"therealprof"}}