!zbjndUiYJDvhDRkPGw:matrix.org

rp-rs

403 Members
Rust on the Raspberry Pi Microcontrollers/Pico https://github.com/rp-rs 48 Servers

Load older messages


SenderMessageTime
30 May 2023
@schmeckinger:matrix.orgschmeckingerbtw is there a good way to start the sm at a specific adress, or should I just do exec instruction with a jmp?16:02:04
@schmeckinger:matrix.orgschmeckingerimage.png
Download image.png
16:05:15
@schmeckinger:matrix.orgschmeckingerthe c sdk has a initial pc16:07:30
@ithinuel:matrix.orgithinuel I'll take note of that for my pio update. 16:15:28
31 May 2023
@schmeckinger:matrix.orgschmeckingerIm pretty torn rn, I have 2 different pio programs both doing the same thing for a library. One of them has 10 instructions instead of 9, but the one with 9 needs some accommodations. 09:18:47
@schmeckinger:matrix.orgschmeckingerThe one with 9 needs to start at an offset and I need to run a check on every second push so if the first pushes 0 I need to add 8 to the second09:19:54
@schmeckinger:matrix.orgschmeckingerIdk if it is worth it ovdr saving thst one instruction09:20:11
@schmeckinger:matrix.orgschmeckingerover*09:20:34
@schmeckinger:matrix.orgschmeckingerhttps://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b0eb1ff050592c60a9a9ae52daaf22d209:24:20
@schmeckinger:matrix.orgschmeckingerAlso idk if here is the right place to ask such question or if I should go the pico discord and ask in the pio channel 09:26:05
@9names:matrix.org9namesyou're welcome to ask such things here, but I think you're more likely to get a good answer on the discord10:27:01
@ithinuel:matrix.orgithinuelI'd say it mostly depends on how much you value the PIO instruction slots. There's only 32 of them, so 1 instruction is already more than 3% of the available space. But overall for your firmware, if it makes it use an extra 10k (I'm exagerating on purpose) of Flash or if your firmware runs twice as slow, it may be worth using an extra slot of PIO 🤷11:53:50
@schmeckinger:matrix.orgschmeckinger
In reply to @ithinuel:matrix.org
I'd say it mostly depends on how much you value the PIO instruction slots.
There's only 32 of them, so 1 instruction is already more than 3% of the available space.
But overall for your firmware, if it makes it use an extra 10k (I'm exagerating on purpose) of Flash or if your firmware runs twice as slow, it may be worth using an extra slot of PIO 🤷
fn move_map(mov: Movement) -> IntoIter<u32, 2> {
    [mov.0, mov.1].into_iter()
}

fn move_map(mov: Movement) -> IntoIter<u32, 2> {
    match mov {
        Movement(0, delay) => [0, delay.saturating_add(8)],
        Movement(steps, delay) => [steps, delay],
    }
    .into_iter()
}
12:00:42
@schmeckinger:matrix.orgschmeckingerbasically the difference is that I would need to put the bottom one in the flat map12:01:21
@ithinuel:matrix.orgithinuelIt doesn't look like a huge impact on the firmware, so it might be worth saving a pio instr 🙂 But someone else may thing differently 🙂 12:02:44
@jannic:matrix.orgjannicIt also depends on what else you expect to do with the pio. If you don't plan to install any other pio program in parallel, saving an instruction doesn't help at all.12:23:26
@schmeckinger:matrix.orgschmeckinger
In reply to @jannic:matrix.org
It also depends on what else you expect to do with the pio. If you don't plan to install any other pio program in parallel, saving an instruction doesn't help at all.
its a library, so someone could install something in parallel
12:27:12
@schmeckinger:matrix.orgschmeckinger ithinuel: I found a problem: pio::Instruction does not implement Copy and StateMachine::exec_instruction takes Instruction and not &Instruction 12:28:43
@schmeckinger:matrix.orgschmeckingeralso has no Clone12:29:21
@schmeckinger:matrix.orgschmeckinger
let op = InstructionOperands::JMP { condition: JmpCondition::Always, address: prog.addr };
sm.exec_instruction(Instruction::decode(op.encode(), prog.side_set).unwrap());
12:37:40
@schmeckinger:matrix.orgschmeckingerRedacted or Malformed Event12:38:00
@schmeckinger:matrix.orgschmeckinger * pub struct TmcProgram<P: PIOExt> { prog: InstalledProgram<P>, addr: u8, side_set: SideSet, }12:38:28
@schmeckinger:matrix.orgschmeckinger

where prog is

pub struct TmcProgram<P: PIOExt> {
    prog: InstalledProgram<P>,
    addr: u8,
    side_set: SideSet,
}
12:39:02
@schmeckinger:matrix.orgschmeckingerHaving to carry the address and SideSet around with me to create the Instruction feels hacky12:42:32
@schmeckinger:matrix.orgschmeckingerI just created a issue in the pio git, since implementing Clone would pretty much remove my problem. 13:10:29
@jannic:matrix.orgjannicIt should be fine to derive both Copy and Clone. https://github.com/rp-rs/pio-rs/pull/4513:39:21
1 Jun 2023
@animus27:matrix.organimus27is there a way to write to the flash to store program values across reboots?05:57:51
@9names:matrix.org9nameshttps://github.com/jannic/rp2040-flash/blob/master/examples/flash_example.rs06:06:38
@9names:matrix.org9namesif you're using embassy, https://github.com/embassy-rs/embassy/blob/main/examples/rp/src/bin/flash.rs06:09:17
@animus27:matrix.organimus27
In reply to @9names:matrix.org
https://github.com/jannic/rp2040-flash/blob/master/examples/flash_example.rs
Thanks
06:41:14

There are no newer messages yet.


Back to Room ListRoom Version: 6