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
<i509vcb[m]> (The C110x really is going to be a pain to work with)
<i509vcb[m]> Although the dev board for it was quite cheap ($7) so why not lol
<i509vcb[m]> (The L2228 has 32k ram and 128k flash, far more spacious)
<i509vcb[m]> [probe-rs/src/flashing/flash_algorithm.rs:318:13] ram_for_data = 432
<i509vcb[m]> [probe-rs/src/flashing/flash_algorithm.rs:318:13] stack_size = 512
<i509vcb[m]> hmm stripping debug symbols got me under
<i509vcb[m]> ah right that seems to break defmt
<JamesMunns[m]> debug symbols aren't flashed to the chip
<JamesMunns[m]> they only live in the elf
<jduck[m]> Still release mode optimizations help a ton with code size
<i509vcb[m]> Setting the buffer size any smaller doesn't change anything
<jduck[m]> Debug mode maintains thin abstractions that bloat code
<jduck[m]> When I had this problem, I added strip option to a toml iirc
<JamesMunns[m]> there's a difference between debug mode and debug symbols
<jduck[m]> How are you flashing/programming the device?
<JamesMunns[m]> they are unrelated
<JamesMunns[m]> and debug symbols are not flashed to the device.
<JamesMunns[m]> and do not affect code size or performance at all.
<i509vcb[m]> jduck[m]: probe-rs, built from source because the target isn't upstream yet
<i509vcb[m]> although there seems to be an overflow bug in probe-rs as well that I found
<jduck[m]> Def report
M9names[m] has joined #rust-embedded
<M9names[m]> You don't need to build from source to use a new target, you can use the chip-definition-file flag (in case you suspect a bug in probe-rs git)
<jduck[m]> What is your final code size? Is it just too big for this environment?
<i509vcb[m]> yeah chip-definition-path gives a different error
<i509vcb[m]> Failed to configure a stack for the flash algorithm.
<JamesMunns[m]> probe rs flash algorithms work by loading code into ram on the device, and using that to program the flash
<JamesMunns[m]> it's possible the algorithm isn't correctly configured, or is too large for the 1k of ram you have
<JamesMunns[m]> or, overflows the stack while running
<jduck[m]> For 1k of RAM you will need XIP or something. Just my guess
<jduck[m]> 1k is very small
<jduck[m]> Do you have external RAM available?
<i509vcb[m]> no external ram, this is literally a sub $1 microcontroller lol
<i509vcb[m]> that's unless the flash algorithm from TI is broken?
<JamesMunns[m]> Not sure! I've not had the pleasure of debugging flash algos before :D
<i509vcb[m]> This is what target-gen popped out: https://gist.github.com/i509VCB/fe4ea129bb56a42304eea8f6214e0fae
<jduck[m]> It's possible TI never tried these with 1k of RAM
<i509vcb[m]> Well the C110x the only ram size is 1K
<i509vcb[m]> (there is a 8k version vs the 16k version I have for the sadist in us as well)
<i509vcb[m]> * a 8k flash version vs
<jduck[m]> I think that's a very challenging mark to meet for Rust. You could try to reduce your own code size to basically nothing by removing everything and just putting one inline assembly instruction. Maybe you can manage a 1k stack manually lol
<jduck[m]> But still probe-rs might not work
<jduck[m]> Rust prefers to put objects on the stack and use RAII, so it naturally has bigger stack frames.
<i509vcb[m]> I assume there is a way to make rtt work under openocd just to see if the problem might be in probe-rs?
<i509vcb[m]> There is a patch set to make these work in openocd
<i509vcb[m]> From the git build of probe-rs I just hardcoded FLASH_ALGO_STACK_SIZE and it works lmao
<i509vcb[m]> The stuff generated from the pack file doesn't seem to contain a stack_size
<i509vcb[m]> * The stuff generated from the pack file doesn't seem to contain a stack_size variable and therefore uses the default
<i509vcb[m]> * From the git build of probe-rs I just hardcoded FLASH_ALGO_STACK_SIZE to 256 and it works lmao
<i509vcb[m]> Does cargo bloat give a binary size that's accurate enough?
<i509vcb[m]> iirc there was a tool which lets you analyze memory usage better? I think cargo bloat just does some stuff with symbols?
<JamesMunns[m]> cargo bloat, cargo size, or cargo nm, will all show you the static memory usage accurately
<JamesMunns[m]> cargo-call-stack is used for determinining runtime stack size
<JamesMunns[m]> or rather, it does static analysis to determine the worst-case runtime stack usage
<i509vcb[m]> So 144 bytes?
<i509vcb[m]> Although some flash does get used
<i509vcb[m]> * 144 bytes of ram?
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 246 seconds]
starblue has quit [Ping timeout: 252 seconds]
starblue has joined #rust-embedded
<M9names[m]> <i509vcb[m]> "From the git build of probe-rs I..." <- you can set it in the yaml these days, FYI.
<i509vcb[m]> M9names[m]: > <@9names:matrix.org> you can set it in the yaml these days, FYI.
<i509vcb[m]> yeah the yaml needs it, but still a bug that it underflowed
<M9names[m]> but yeah it's really rough building flash algos with so little space. i basically had to evict all error handling to get mine to work (can't remember if this was a 1K or 2K RAM part)
sugoi has joined #rust-embedded
<M9names[m]> haha guess i commented it
<M9names[m]> > // 1KB RAM is not enough room for error handling. this algo ignores all failures.
sugoi has quit [Ping timeout: 260 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 260 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
cr1901 has quit [Read error: Connection reset by peer]
cr1901 has joined #rust-embedded
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 246 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 264 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 265 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 276 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 260 seconds]
juliand[m] has quit [Quit: Idle timeout reached: 172800s]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 260 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 248 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 265 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 246 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 260 seconds]
sugoi has joined #rust-embedded
starblue has quit [Ping timeout: 260 seconds]
sugoi has quit [Ping timeout: 260 seconds]
M0xada3[m] has quit [Quit: Idle timeout reached: 172800s]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 265 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 246 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 276 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 260 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 260 seconds]
starblue has joined #rust-embedded
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 265 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 255 seconds]
starblue has quit [Ping timeout: 260 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 260 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
RobertJrdens[m] has quit [Quit: Idle timeout reached: 172800s]
sugoi has joined #rust-embedded
ello has quit [Ping timeout: 252 seconds]
sugoi has quit [Ping timeout: 244 seconds]
ello has joined #rust-embedded
sugoi has joined #rust-embedded
justacec[m] has quit [Quit: Idle timeout reached: 172800s]
sugoi has quit [Ping timeout: 246 seconds]
MurrayToddWillia has quit [Quit: Idle timeout reached: 172800s]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 264 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 260 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 265 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 246 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 260 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 260 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 248 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 260 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 276 seconds]
<thejpster[m]1> The Neotron BMC runs RTIC in 32K Flash and 4K RAM and does quite a bit.
<thejpster[m]1> I don’t think I’d enjoy programming a 2K part.
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
sugoi has joined #rust-embedded
starblue has joined #rust-embedded
sugoi has quit [Ping timeout: 260 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
aliceryhl[m] has joined #rust-embedded
<aliceryhl[m]> <ivmarkov> "> <@aliceryhl:matrix.org> So..." <- Std has a bunch of other dependencies (e.g. hashbrown), whereas core/alloc don't have extra deps.
<aliceryhl[m]> aliceryhl[m]: (Sorry for the late reply, I am unused to matrix.)
sugoi has joined #rust-embedded
AtleoS has quit [Ping timeout: 252 seconds]
AtleoS has joined #rust-embedded
sugoi has quit [Ping timeout: 265 seconds]
sugoi has joined #rust-embedded
sugoi has quit [Remote host closed the connection]
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 265 seconds]
sugoi has joined #rust-embedded