ChanServ changed the topic of #rust-embedded to: Welcome to the Rust Embedded IRC channel! Bridged to #rust-embedded:matrix.org and logged at https://libera.irclog.whitequark.org/rust-embedded, code of conduct at https://www.rust-lang.org/conduct.html
dc740 has quit [Remote host closed the connection]
starblue has quit [Ping timeout: 276 seconds]
starblue has joined #rust-embedded
fabic has joined #rust-embedded
fabic has quit [*.net *.split]
jcroisant has quit [*.net *.split]
WSalmon has quit [*.net *.split]
cr1901 has quit [*.net *.split]
emerent has quit [*.net *.split]
sigmaris has quit [*.net *.split]
a2800276_ has quit [*.net *.split]
Shell has quit [*.net *.split]
inara` has quit [*.net *.split]
rektide has quit [*.net *.split]
wose has quit [*.net *.split]
agg has quit [*.net *.split]
xnor has quit [*.net *.split]
Abhishek_ has quit [*.net *.split]
sauce has quit [*.net *.split]
jsolano has quit [*.net *.split]
mightypork has quit [*.net *.split]
Socke has quit [*.net *.split]
richardeoin has quit [*.net *.split]
Foxyloxy has quit [*.net *.split]
genpaku has quit [*.net *.split]
tafa has quit [*.net *.split]
re_irc has quit [*.net *.split]
dnm has quit [*.net *.split]
dne has quit [*.net *.split]
Rahix has quit [*.net *.split]
cosj[m] has quit [*.net *.split]
Darius has quit [*.net *.split]
m5zs7k has quit [*.net *.split]
dequbed has quit [*.net *.split]
hifi has quit [*.net *.split]
SanchayanMaity has quit [*.net *.split]
corecode has quit [*.net *.split]
nohit has quit [*.net *.split]
jasperw has quit [*.net *.split]
x56_ has quit [*.net *.split]
crabbedhaloablut has quit [*.net *.split]
agg has joined #rust-embedded
fabic has joined #rust-embedded
emerent has joined #rust-embedded
mightypork has joined #rust-embedded
dne has joined #rust-embedded
Socke has joined #rust-embedded
crabbedhaloablut has joined #rust-embedded
jcroisant has joined #rust-embedded
richardeoin has joined #rust-embedded
sigmaris has joined #rust-embedded
corecode has joined #rust-embedded
Rahix has joined #rust-embedded
WSalmon has joined #rust-embedded
cr1901 has joined #rust-embedded
Foxyloxy has joined #rust-embedded
a2800276_ has joined #rust-embedded
Darius has joined #rust-embedded
Shell has joined #rust-embedded
xnor has joined #rust-embedded
wose has joined #rust-embedded
m5zs7k has joined #rust-embedded
rektide has joined #rust-embedded
inara` has joined #rust-embedded
cosj[m] has joined #rust-embedded
re_irc has joined #rust-embedded
genpaku has joined #rust-embedded
jasperw has joined #rust-embedded
tafa has joined #rust-embedded
Abhishek_ has joined #rust-embedded
sauce has joined #rust-embedded
jsolano has joined #rust-embedded
dnm has joined #rust-embedded
nohit has joined #rust-embedded
dequbed has joined #rust-embedded
hifi has joined #rust-embedded
x56_ has joined #rust-embedded
SanchayanMaity has joined #rust-embedded
dreamcat4 has quit [Ping timeout: 260 seconds]
dreamcat4 has joined #rust-embedded
crabbedhaloablut has quit [*.net *.split]
crabbedhaloablut has joined #rust-embedded
jasperw has quit [*.net *.split]
x56_ has quit [*.net *.split]
corecode has quit [*.net *.split]
nohit has quit [*.net *.split]
crabbedhaloablut has quit [Max SendQ exceeded]
jasperw has joined #rust-embedded
x56_ has joined #rust-embedded
corecode has joined #rust-embedded
nohit has joined #rust-embedded
crabbedhaloablut has joined #rust-embedded
SanchayanMaity has quit [*.net *.split]
Darius has quit [*.net *.split]
m5zs7k has quit [*.net *.split]
dequbed has quit [*.net *.split]
hifi has quit [*.net *.split]
dne has quit [*.net *.split]
Rahix has quit [*.net *.split]
cosj[m] has quit [*.net *.split]
re_irc has quit [*.net *.split]
dnm has quit [*.net *.split]
agg has quit [*.net *.split]
xnor has quit [*.net *.split]
Abhishek_ has quit [*.net *.split]
sauce has quit [*.net *.split]
jsolano has quit [*.net *.split]
dequbed has joined #rust-embedded
hifi has joined #rust-embedded
SanchayanMaity has joined #rust-embedded
m5zs7k has joined #rust-embedded
Darius has joined #rust-embedded
sigmaris has quit [*.net *.split]
a2800276_ has quit [*.net *.split]
Shell has quit [*.net *.split]
inara` has quit [*.net *.split]
rektide has quit [*.net *.split]
wose has quit [*.net *.split]
Rahix has joined #rust-embedded
cosj[m] has joined #rust-embedded
dne has joined #rust-embedded
m5zs7k has quit [Max SendQ exceeded]
re_irc has joined #rust-embedded
dnm has joined #rust-embedded
dreamcat4 has quit [*.net *.split]
fabic has quit [*.net *.split]
emerent has quit [*.net *.split]
jcroisant has quit [*.net *.split]
WSalmon has quit [*.net *.split]
cr1901 has quit [*.net *.split]
cosj[m] has quit [Ping timeout: 265 seconds]
xnor has joined #rust-embedded
agg has joined #rust-embedded
jsolano has joined #rust-embedded
Abhishek_ has joined #rust-embedded
sauce has joined #rust-embedded
m5zs7k_ has joined #rust-embedded
fabic has joined #rust-embedded
dreamcat4 has joined #rust-embedded
emerent has joined #rust-embedded
jcroisant has joined #rust-embedded
WSalmon has joined #rust-embedded
cr1901 has joined #rust-embedded
dreamcat4 has quit [Max SendQ exceeded]
dreamcat4 has joined #rust-embedded
a2800276_ has joined #rust-embedded
sigmaris has joined #rust-embedded
wose has joined #rust-embedded
Shell has joined #rust-embedded
inara` has joined #rust-embedded
rektide has joined #rust-embedded
m5zs7k_ is now known as m5zs7k
mightypork has quit [*.net *.split]
Socke has quit [*.net *.split]
richardeoin has quit [*.net *.split]
Foxyloxy has quit [*.net *.split]
genpaku has quit [*.net *.split]
tafa has quit [*.net *.split]
mightypork has joined #rust-embedded
Socke has joined #rust-embedded
tafa has joined #rust-embedded
richardeoin has joined #rust-embedded
Foxyloxy has joined #rust-embedded
genpaku has joined #rust-embedded
sigmaris has quit [*.net *.split]
a2800276_ has quit [*.net *.split]
Shell has quit [*.net *.split]
inara` has quit [*.net *.split]
rektide has quit [*.net *.split]
wose has quit [*.net *.split]
a2800276_ has joined #rust-embedded
sigmaris has joined #rust-embedded
Shell has joined #rust-embedded
inara` has joined #rust-embedded
rektide has joined #rust-embedded
wose has joined #rust-embedded
cosj[m] has joined #rust-embedded
<cr1901> Amanieu: Apologies if you're busy. I tagged you on GH for some clarification, please take your time answering. Also pasting the link to the room in case others know: https://github.com/rust-embedded/msp430-rt/issues/20#issuecomment-1465098007
fabic has quit [Ping timeout: 248 seconds]
fabic has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
dc740 has joined #rust-embedded
<re_irc> <@korken89:matrix.org> What's the easiest way to get libs that use "defmt" to also be testable? If one simply has "defmt" and runs "cargo test" one gets errors on the from of missing symbols to "_defmt_acquire", "_defmt_release", "_defmt_write", "_defmt_timestamp" - and I think I'm not the first to run into this :)
<re_irc> <@diondokter:matrix.org> : I mean to pick this back up, but don't think I'll have time: https://github.com/knurling-rs/defmt/issues/730
<re_irc> <@datdenkikniet:matrix.org> If you don't care about the logs: "DEFMT_LOG=off" should get rid of the symbol errors
<re_irc> <@datdenkikniet:matrix.org> +and allow you to run them, at least
<re_irc> <@diondokter:matrix.org> Really? Didn't know that!
<re_irc> <@korken89:matrix.org> That was one easy fix :D
<re_irc> <@datdenkikniet:matrix.org> Uhh, I hope so now, but I'm fairly certain of it
<re_irc> <@datdenkikniet:matrix.org> * so,
<re_irc> <@korken89:matrix.org> Worked a charm
<re_irc> <@datdenkikniet:matrix.org> 💯
<re_irc> <@korken89:matrix.org> Thanks!
<re_irc> <@dirbaio:matrix.org> : with this you can make the macros go to either "defmt" or "log"
<re_irc> so on std tests or binaries you can use regular "log"
<re_irc> <@korken89:matrix.org> : That was also a nice feature 👍
emerent has quit [Ping timeout: 248 seconds]
emerent has joined #rust-embedded
fabic has quit [Ping timeout: 256 seconds]
<re_irc> <@jamesmunns:beeper.com> (I don't think aarch64 cores actually use the nvic? Tho some of the side cores which are -m profiles certainly do)
<re_irc> <@2:0x2c.org> how do you typically integrate bindgen in a crate if you don't auto-generate bindings on build? xtask?
<re_irc> <@2:0x2c.org> plain shell script?
<re_irc> <@jamesmunns:beeper.com> You have three main choices imo:
<re_irc> - If the bindings/config don't change often, better to build them and check them in, maybe have bash or xtask for regenerating when needed
<re_irc> - If you don't mind having bindgen installed, you can "shell out" from the build rs, which saves a lot of time building bindgen itself
<re_irc> - Then the typical "bindgen as a lib import in your build rs"
<re_irc> <@jamesmunns:beeper.com> I basically prefer them in that order, and honestly if I'm doing choice one I just use a bash script, but if you have xtask or just or whatever already, any of those work too.
<re_irc> <@2:0x2c.org> thanks!
<re_irc> <@jamesmunns:beeper.com> Bindgen publishes release binaries on GH I think, so you can always grab them in CI as well instead of "cargo install bindgen", which saves an absolute ton of CI time, and serves to pin your bindgen version
<re_irc> <@jamesmunns:beeper.com> (works for both option 1 + 2)
re_irc has quit [*.net *.split]
dnm has quit [*.net *.split]
re_irc has joined #rust-embedded
dnm_ has joined #rust-embedded
<re_irc> <@2:0x2c.org> i'm not at CI yet
<re_irc> <@jamesmunns:beeper.com> Gotcha! But yeah, even just having the bash script (or whatever) serves as good documentation on how to rebuild things next time.
<re_irc> <@2:0x2c.org> now i need to figure out what it means by "error: requires "start" lang_item"
<re_irc> <@jamesmunns:beeper.com> What are you building? That usually means you are building a binary without an rt crate like cortex-m-rt
<re_irc> <@jamesmunns:beeper.com> Or, if you meant to build a staticlib, you have a bin crate instead of a staticlib crate
<re_irc> <@jamesmunns:beeper.com> tldr, it means you are trying to build a binary with no defined entry point
<re_irc> <@jamesmunns:beeper.com> Or honestly just get a full mask instead lol
lehmrob has joined #rust-embedded
lehmrob has quit [Client Quit]
limpkin has quit [Quit: limpkin]
limpkin has joined #rust-embedded
<re_irc> <@2:0x2c.org> yea, i'm building a cortex-m system using silicon labs gecko sdk
<re_irc> <@2:0x2c.org> so i'm using their startup and libc crt
<re_irc> <@jamesmunns:beeper.com> What gets booted into after the crt? Rust or C?
<re_irc> <@jamesmunns:beeper.com> If C, you probably want to change your crate type to staticlib instead of bin.
<re_irc> <@jamesmunns:beeper.com> If Rust, you might want to consider switching to cortex-m-rt instead, or you'll need to strategically copy some of the things it does, specifically defining a start/entry point.
<re_irc> <@2:0x2c.org> yea i just made a pub extern "C" fn main
<re_irc> <@jamesmunns:beeper.com> Yeah, theres a bit more life before main you need to make happen.
<re_irc> <@2:0x2c.org> i'm still deciding how to arrange things
<re_irc> <@jamesmunns:beeper.com> Usually start calls main
<re_irc> <@2:0x2c.org> oh yea that all comes from my library crate
<re_irc> <@2:0x2c.org> well, startup and then libc crt takes over
<re_irc> <@jamesmunns:beeper.com> : You also probably need no_mangle
<re_irc> <@adamgreig:matrix.org> have you got "#![no_main]" and what target are you building for?
<re_irc> <@2:0x2c.org> : yea i copied the macro "#[export_name = "main"]"
<re_irc> <@2:0x2c.org> it's linking now
<re_irc> <@jamesmunns:beeper.com> : Oh that's a good call too, forgot that
<re_irc> <@2:0x2c.org> 200KB... lots of vendor stuff
<re_irc> <@jamesmunns:beeper.com> (these bits aren't needed if you are making a staticlib crate and calling into it from C/ASM)
<re_irc> <@2:0x2c.org> yea i'm using the bin crate to link the binary
<re_irc> <@2:0x2c.org> that way i can have several different bin crates for different binaries
<re_irc> <@jamesmunns:beeper.com> When mixing C and Rust, it's a pretty good idea to make a clear decision of which lang is the "host" and which is the "guest".
<re_irc> <@2:0x2c.org> i'm making a C/rust/C sandwich
<re_irc> <@jamesmunns:beeper.com> So if Rust is the host, use cmrt and have a rust main that calls c, if C is the host, make a C main that calls into rust as a lib
<re_irc> <@jamesmunns:beeper.com> : _in general_, I'd advise not-this, but ymmv, and you know your details better than I do :)
<re_irc> <@2:0x2c.org> is there something i need to call to initialized core or alloc?
<re_irc> <@2:0x2c.org> * initialize
<re_irc> <@jamesmunns:beeper.com> Nope, just make sure bss is zeroed and .data is initialized
<re_irc> <@2:0x2c.org> : I'd prefer not to use the enormous vendor SDK, but it's so much code, and they do lots of codegen, and they do some RTOS shenanigans
<re_irc> <@jamesmunns:beeper.com> This comes mostly from the fact that every time you cross the lang boundary, you have to be an expert at C and Rust to debug when things go wrong, and write a fair bit of unsafe code in Rust, which is harder to get right
<re_irc> <@jamesmunns:beeper.com> So the less you do that (in general), the better. But I totally understand real world details change the equation.
<re_irc> <@2:0x2c.org> it's already a bit of a gamble to use rust instead of C/C++
<re_irc> <@jamesmunns:beeper.com> Yeah, sometimes I would even lean on "use less rust", and limit it to a well segmented application layer, like a full rtos task, or "black box" business logic library/component
<re_irc> <@2:0x2c.org> that's my goal
<re_irc> <@2:0x2c.org> i'm just using a rust main to see what's up
<re_irc> <@2:0x2c.org> and i'm not sure how i can do a bin crate with C code
<re_irc> <@2:0x2c.org> now i can do cargo build and get a binary
<re_irc> <@jamesmunns:beeper.com> With a staticlib, you'd use C's build system (make, cmake, whatever the SDK provides) and use cargo to build a .a file to link in.
<re_irc> <@2:0x2c.org> yea, i didn't want that
<re_irc> <@2:0x2c.org> seems cargo doesn't set "CARGO_BIN_NAME" for build.rs
<re_irc> <@2:0x2c.org> i tried to place a map file next to the binary in the target directory, but i can't figure out how to get to that path
<re_irc> <@2:0x2c.org> ah yes exactly what i thought would happen is happening - the vendor code cannot be linked as a static library because sections/symbols are being dropped
<re_irc> <@2:0x2c.org> i need to use some --whole-archive thing from build.rs
<re_irc> <@jamesmunns:beeper.com> What linker script are you trying cargo to use?
<re_irc> <@jamesmunns:beeper.com> * telling
<re_irc> <@jamesmunns:beeper.com> Cortex m rt provides a base linker script, but it may not be retaining symbols from your SDK, especially if you are not interacting with them.
<re_irc> <@2:0x2c.org> yea, i'm using the linker script from the sdk
<re_irc> <@2:0x2c.org> bummer, can't use bundled libraries and link:+whole-archive in stable
<re_irc> <@2:0x2c.org> ok i guess i need to completely change how i do this build
<re_irc> <@2:0x2c.org> or find a way to force the linker script to use all objects
<re_irc> <@2:0x2c.org> oh cool, i managed to do it
<re_irc> <@2:0x2c.org> you need to output something like: "cargo:rustc-link-lib=static:+whole-archive,-bundle=efr32bg22-sys"
<re_irc> <@2:0x2c.org> the "-bundle" is the key
<re_irc> <@2:0x2c.org> now i have a stack and everything is running
dc740 has quit [Remote host closed the connection]
vancz has quit []
vancz has joined #rust-embedded