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
cr1901 has quit [Quit: Leaving]
cr1901 has joined #rust-embedded
kenny has quit [Ping timeout: 244 seconds]
pcs38 has joined #rust-embedded
kenny has joined #rust-embedded
ckrenslehner[m] has quit [Quit: Idle timeout reached: 172800s]
<RobinMueller[m]> * Hello. I have started a project of writing a bare metal Rust App for a Xilinx Zynq7000 based board. I saw https://git.m-labs.hk/M-Labs/zynq-rs and I am now wondering whether there are any Cortex-A(9) support crates out there? I only saw support for Aarch64.
kenny has quit [Ping timeout: 244 seconds]
dne has quit [Remote host closed the connection]
dne has joined #rust-embedded
kenny has joined #rust-embedded
kenny has quit [Ping timeout: 252 seconds]
<RobinMueller[m]> If there isn´t one yet, I assume this could be useful for other people as well, packaging this as open-source crates similar to cortex-m / cortex-m-rt? zynq-rs already provides a lot of useful baseline code, and there is also https://github.com/Xilinx/embeddedsw/tree/master/lib/bsp/standalone/src/arm/cortexa9 which provides C code as a starting point. I am probably undererstimating cost & effort 😁
<RobinMueller[m]> * & effort though 😁
<MrPashaPG[m]> <JamesMunns[m]> "you need to use async delays..." <- I had that embassy_time problem because it wasn't working, otherwise I created a project with embassy on stm32, I know I have to use await.
<MrPashaPG[m]> Because embassy_time wasn't working even in the main loop, I had it cut and used delay inside esp_hal.
<MrPashaPG[m]> Now my main problem is that embassy doesn't apply to my esp32 project at all, embassy_time didn't work, I used delay, now I see that task doesn't work either.
<thejpster[m]> <RobinMueller[m]> "If there isn´t one yet, I assume..." <- I wrote a Cortex-r-rt crate and that probably works for AArch 32 Cortex-A as well. Maybe it needs a different name.
<thejpster[m]> Jorge also has https://github.com/japaric/ultrascale-plus which might be interesting
lulf[m] has quit [Quit: Idle timeout reached: 172800s]
jsolano_ has quit [Remote host closed the connection]
kenny has joined #rust-embedded
jsolano has joined #rust-embedded
<JamesMunns[m]> Counting +1 emojis and not checkboxes isn't something we've done before.
<JamesMunns[m]> It's been a week, so we need 33%, or three approvals. Might want to ping berkus and nchong to confirm.
<adamgreig[m]> yea, if they could tick the boxes or approve the PR rather than just the emoji I think we'd be set
<RobinMueller[m]> <thejpster[m]> "I wrote a Cortex-r-rt crate..." <- Thanks! Where can I find the crate? I also saw the project by japaric, that is an ultrsscale though which has two different CPUs. It might still help though, I would guess that there are similarities between the cortex-a variants
<thejpster[m]> github.com/rust-embedded/cortex-r. There’s a PR for it - the main branch is a very old placeholder.
<RobinMueller[m]> <thejpster[m]> "github.com/rust-embedded/cortex..." <- Thanks. I'll have a look, I already saw that there are common registers like MPIDR, and the rt subcrate also contains code/logic which I could probably adapt for cortex-a9.. (e.g. save stack context, call IRQ, restore context)
Koen[m] has quit [Quit: Idle timeout reached: 172800s]
Kaspar[m] has quit [Quit: Idle timeout reached: 172800s]
bitts[m] has joined #rust-embedded
<bitts[m]> Seeing a bit of a weird problem here that I hope someone can help with, I include an assembly file with global_asm!(include_str!("boot_armv8_asm.S")); . This works just fine when compiling on mac, but on linux it chokes because the S file contains c-style comments ( /* Like this */ ). It throws a bit different depending on where the comment is, but e.g. "Unexpected token at start of statement"
berkus[m] has quit [Quit: Idle timeout reached: 172800s]
<bitts[m]> Does anyone know who is responsible for parsing the asm f.ex.?
berkus[m] has joined #rust-embedded
<berkus[m]> bitts[m]: global asm is parsed by rustc to convert it to llvm-acceptable format and then passed on to llvm
<berkus[m]> (it mostly does argument-related preproc)
<diondokter[m]> berkus[m]: Most importantly, it's parsed in an agnostic way so any compiler backend can emit the right instructions in the way they need
<JamesMunns[m]> I wonder if macos uses LLVM binutils like `as`, while on Linux it uses gnu binutils instead by default?
<berkus[m]> <bitts[m]> "Seeing a bit of a weird problem..." <- that's weird, but it seems like .S files are perhaps treated differently from .s files
<berkus[m]> try renaming it to lowercase
<JamesMunns[m]> Oh no lol
<JamesMunns[m]> Case insensitive file systems strike again?
<berkus[m]> the .S file will go through preproc i think
<berkus[m]> JamesMunns[m]: well, it's case agnostic on mac, but definitely sensitive on linux :)
mabez[m] has quit [Quit: Idle timeout reached: 172800s]
ivmarkov[m] has quit [Quit: Idle timeout reached: 172800s]
<berkus[m]> however, i have .S files and they seem to be cross-building just fine on all 3 systems...
<JamesMunns[m]> berkus[m]: Do they have block comments?
<berkus[m]> JamesMunns[m]: Yup, mix of both block and line comments.
<thejpster[m]> global asm needs {{ and }} in things like stmfd sp! doesn’t it? Because {foo} is an argument to be replaced?
<thejpster[m]> So I wouldn’t pass .S files to global asm. I’d use cc-rs.
<bitts[m]> Ah, we just realized that it is only a problem when using a macro... I guess that is slightly more corner case and less weird
<dirbaio[m]> try global_asm!(include_str!("boot_armv8_asm.S"), options(raw))
<bitts[m]> Renaming from uppercase to lower case S did not help..
<berkus[m]> bitts[m]: Yeah, red herring
<bitts[m]> options(raw) did also not help, but removing the inline comments on macro invocations is acceptable workaround
<bitts[m]> It also choked on lines starting with /* which confused me a bit, but that was just a side effect of the first error
<berkus[m]> bitts[m]: can you show the syntax that choked? you can prolly rename the source parts if it's private
<bitts[m]> Adding a ; or changing to // save all CPU regs both work
<berkus[m]> hmm what's the last line of the macro?
<bitts[m]> .end
<bitts[m]> * .endm
<berkus[m]> okay, one non-empty line before that
<bitts[m]> stp x30, xzr, [\stackPtr, #-16]!
<berkus[m]> innnttttrsting
<RobinMueller[m]> thejpster: Thanks for the hints to the cortex-r crate. I just created a PR with some minimal changes :) . I think renaming might make a lot of sense for the cortex-r crate at least.. The CP15 registers seem to be identical. I will try to get familiar with QEMU.. I think it has both a cortex-A8 versatile base board and a xilinx-zynq-a9 config (https://www.qemu.org/docs/master/system/arm/xlnx-zynq.html)
<RobinMueller[m]> * created a draft PR with
<MrPashaPG[m]> Why does the rust analyzer give a syntax error even though the program is working properly and has no problems? How can I fix this problem?
vollbrecht[m] has joined #rust-embedded
<vollbrecht[m]> MrPashaPG[m]: please dont crosspost questions. Most of the people are subscribed over the same channels.
rainingmessages has quit [Quit: bye]
rainingmessages has joined #rust-embedded
burrbull[m] has joined #rust-embedded
<burrbull[m]> <MrPashaPG[m]> "Why does the rust analyzer..." <- this is not a syntax error.
<burrbull[m]> is this a new project or example on cloned hal repository?
<burrbull[m]> possibly you should write vscode (your editor) config with rust-analyzer settings where list features that should be enabled
<MrPashaPG[m]> <vollbrecht[m]> "please dont crosspost questions...." <- Oh yes, I'm sorry.
<MrPashaPG[m]> <burrbull[m]> "this is not a syntax error...." <- What settings can I make to fix this problem? If you have encountered this problem and fixed it, I would appreciate it if you could guide me on what to do because this [link](https://github.com/esp-rs/esp-hal/issues/3148) states that this problem is for rust-analyzer.
pcs38 has quit [Quit: leaving]
pcs38 has joined #rust-embedded
JamesSizeland[m] has quit [Quit: Idle timeout reached: 172800s]
GrantM11235[m] has quit [Quit: Idle timeout reached: 172800s]
almindor[m] has quit [Quit: Idle timeout reached: 172800s]
pcs38 has quit [Quit: leaving]
danielb[m] has quit [Quit: Idle timeout reached: 172800s]