emerent has quit [Remote host closed the connection]
emerent has joined #rust-embedded
<re_irc>
<@jamesmunns:matrix.org> U007D: AFAICT from the schematic, on page 5, it looks like `PWM0_{1-4}` are ONLY connected to the RGB LED and LED D12 (over on the right side of the page)
<re_irc>
<@jamesmunns:matrix.org> It seems the pin names are: C9, A8, C8, F9
<re_irc>
<@jamesmunns:matrix.org> I *think* the only PWM pin brought out to a header is `PWM1_0`, package pin E10, is brought out to header J8 as pin 5. PWM0_x is all used for LEDs, PWM1_1 is N/C, and PWM1_3 and PWM1_4 is used to control the on-board fans
<re_irc>
<@disasm-ewg:matrix.org> U007D: I invited you to the pac repo a few days ago, please check your inbox
fabic has quit [Ping timeout: 268 seconds]
fabic has joined #rust-embedded
fabic has quit [Ping timeout: 252 seconds]
<re_irc>
<@wcpannell:matrix.org> managed to work around my const fn and --emit asm vs. actual binary woes. For some reason, the --emit asm was able to optimize out the try_into call, but the actual binary did not inline the divison part of it and couldn't see through to the end.
<re_irc>
<@wcpannell:matrix.org> replacing the 16_u32MHz().try_into() with just 16_000_000_u32.Hz() made it happy. Now my binary loads a numeric literal into the peripheral just like it should 🎉
<re_irc>
<@wcpannell:matrix.org> Moral of the story is that --emit asm is lying liar that lies and I should just use objdump -drS, it has prettier output anyway.
<re_irc>
<@wcpannell:matrix.org> thanks for the recommendations!
<re_irc>
<@9names:matrix.org> you can also use Ghidra, it's nice if you want a GUI
<re_irc>
<@wcpannell:matrix.org> frustratingly, I can get the output binary to match the "--emit asm" .s file by setting codegen-units = 1 with the try_into present
<re_irc>
<@wcpannell:matrix.org> 9names: I saw that in a blog post while i was digging into this yesterday and gave it a try. pretty neat.
<re_irc>
<@wcpannell:matrix.org> The most useful part of it was the little arrows on the side that show the execution path as it loops and branches around
<re_irc>
<@wcpannell:matrix.org> that reminds me I need to update ghidra, it's been a few years since I installed it.
<re_irc>
<@korken89:matrix.org> Does anyone know of an CanOpen crate for embedded? I mean to make/receive frames and generate the Dictionary?
<re_irc>
<@9names:matrix.org> curious if we'll see anyone else try to use the newlib + posix emulation interface now that esp-idf is in std
<re_irc>
<@9names:matrix.org> probably a good fit for the likes of nuttx
<re_irc>
<@lachlansneff:matrix.org> Interesting that the espresso riscv chips lack atomics
<re_irc>
<@adamgreig:matrix.org> shame to not use rv32imac i guess, but sounds like their default platform has an illegal instruction hook that emulates atomics using a critical section?
<re_irc>
<@adamgreig:matrix.org> I guess it's just like atomic-polyfill lol
<re_irc>
<@lachlansneff:matrix.org> Since there’s only one hart, I can’t imagine that real atomics would’ve taken up much silicon
starblue2 has quit [Quit: WeeChat 2.3]
<re_irc>
<@dkhayes117:matrix.org> At first, I was like whoa what are the riscv espresso chips only to realize youmean espressif 🤣
<re_irc>
<@lachlansneff:matrix.org> Oops lmao
<re_irc>
<@dkhayes117:matrix.org> I think the bl602 chips are shown as imafc but atomic instructions causes an exception. Even the MISA register has the A extension.
fabic has quit [Ping timeout: 245 seconds]
<re_irc>
<@dkhayes117:matrix.org> A little off topic, but have you seen the company that is 3d printing rockets called relativity?
<re_irc>
<@u007d:matrix.org> jamesmunns: Hi, James! Hope all is well with you! Thanks, that's how it looks to me too, despite what page 2 says--I'm happy that someone with more experience can confirm this.
<re_irc>
<@u007d:matrix.org> jamesmunns: Very cool. I found a pinout diagram for the FE310, but haven't been able to find one for the FU740--this is good to know, thank you.
<re_irc>
<@u007d:matrix.org> disasm: I found it--it went directly to my spam folder and has expired. I'm updating my filters; if you'll try again, it should work this time.
<re_irc>
<@firefrommoonlight:matrix.org> Question on RF approach - I'm designing a simple device - 2 parts: IR sensor magnetically mounted above a stove burner, and a separate unit to read out the temp. Everything but RF is done, and I have a prototype above my stove now. However, due to battery and size issues, I've determined this isn't a...
<re_irc>
... viable product, and I'd like to split into a sensor unit (Sensor, BT xmitter, and coin cell), and base unit, with display and config buttons. I figured I'd use BT since it's popular. Is this the right approach, or is there something simpler I can use?
<re_irc>
<@firefrommoonlight:matrix.org> Of note: I don't need to pair to arbitrary devices, and I'm sending tiny amounts of information. Mainly a 4-byte float once a second or so, and only when the stove is hot
<re_irc>
<@firefrommoonlight:matrix.org> And... if anyone has any learning bluetooth resources you've liked, I'm all ears
<re_irc>
<@firefrommoonlight:matrix.org> (The prototype is plug-in, and couples the display location with burner, which isn't desirable)
<re_irc>
<@firefrommoonlight:matrix.org> For example, for BT, would I start with the BT LE spec? A course? A document? NRF softdevice docs/examples? Host Controller Interface?
<re_irc>
<@firefrommoonlight:matrix.org> Goal is send some bytes over the Aether, vice a deep understanding
<re_irc>
<@firefrommoonlight:matrix.org> (Maybe for STM32WB, but not NRF, since HCI is built into softdevice? Maybe also built into WB core2?
<re_irc>
<@firefrommoonlight:matrix.org> Maybe use bluetooth GAP only: Eg send all the data in an advertising packet, since data only needs to flow one-way?
<re_irc>
<@firefrommoonlight:matrix.org> And then you could view the temp on your phone too or something?
<re_irc>
<@adamgreig:matrix.org> bluetooth seems way overkill for sending a few bytes between two custom devices that are close together
<re_irc>
<@adamgreig:matrix.org> maybe you can replace the entire base unit with a phone app, and then bluetooth is a good option
<re_irc>
<@firefrommoonlight:matrix.org> This begs the question: what alternative is there?
<re_irc>
<@adamgreig:matrix.org> i would probably consider using something like stm32wl, nrf52, or a separate radio IC like sx1261 or si4463 or whatever that can just send short radio packets over something like lora, direct g/m/fsk modulation, that sort of thing, which present various levels of easy/custom/control
<re_irc>
<@firefrommoonlight:matrix.org> (Also, would prefer a base station so you don't have to have your phone with you/unlocked/awake)
<re_irc>
<@adamgreig:matrix.org> there's a lot of sub-ghz and 2.4ghz options that are non-bluetooth and thus are much much simpler, in terms of packet overhead and software complexity
<re_irc>
<@firefrommoonlight:matrix.org> So, LoRa would be easier, in theory? I jumped on that one due to familiarity with Stm
<re_irc>
<@adamgreig:matrix.org> I guess if you already have a working bluetooth stack then whatever, perhaps that's quickest to get going with
<re_irc>
<@adamgreig:matrix.org> lora would be easier and simpler _for me_... maybe it would be worth getting some dev boards and having a play around with it
<re_irc>
<@firefrommoonlight:matrix.org> Figured that was more for long range, but honestly whatever is easier is what I need, since I'm getting nowhere so far
<re_irc>
<@adamgreig:matrix.org> personally i wouldn't even bother with lora for something like this (or indeed anything, I have philosophical objections to lora but it's not relevant)
<re_irc>
<@firefrommoonlight:matrix.org> Ooh.... Now I'm curious, as probably are at least 2 others here...)
<re_irc>
<@adamgreig:matrix.org> just the boring sub-ghz modes will transmit a string of bytes out one end and receive on the other, but there's a bunch of caveats around stuff you then have to manage yourself like error detection, preambles, bla bla, which perhaps a bluetooth stack takes care of for you
<re_irc>
<@adamgreig:matrix.org> I think the nrf devices have some stuff to take care of a lot of this for you? perhaps the stm32wl do too, I've not used them... really you probably want opinions from people who've used either of those, all I can suggest is that bluetooth seems overkill between two nearby devices that are both made by you, and...
<re_irc>
... simpler solutions should exist
<re_irc>
<@newam:matrix.org> The one disadvantage of LoRa is that when it goes wrong it can be hard to decode because the modulation scheme is proprietary, you have to rely on 3rd party information or your own reverse engineering to decode it.
<re_irc>
<@newam:matrix.org> Apart from that it is pretty good, lives up to most of the marketing.
<re_irc>
<@newam:matrix.org> Yeah the STM32WL takes care of preamble/crc and most of the boilerplate
<re_irc>
<@newam:matrix.org> It's pretty much 0-255 bytes in (note: not 256) 0-255 bytes out.
<re_irc>
<@adamgreig:matrix.org> gotta say I wish the stm32wl existed back when I was using an Si1062 8051+sub-GHz radio, it was so gross
<re_irc>
<@adamgreig:matrix.org> as far as I can tell without an x-ray, they literally glued an si4462 SPI radio IC and an 8051 core to the same carrier, then bond wired four SPI lines between them
<re_irc>
<@adamgreig:matrix.org> documentation couldn't even be bothered to tell you which SPI peripheral was connected
<re_irc>
<@firefrommoonlight:matrix.org> Maybe the answer is the other thing you proposed: an i2c etc rf module that perhaps has a serial-like RF interface?
<re_irc>
<@adamgreig:matrix.org> half the package pins were for the radio, half for the 8051, including separate power
<re_irc>
<@firefrommoonlight:matrix.org> Search on Digikey for "2.4ghz radio module" etx
<re_irc>
<@adamgreig:matrix.org> it probably would be spi rather than i2c, that's an option but probably more expensive than doing it yourself
<re_irc>
<@adamgreig:matrix.org> zigbee was a very popular option for this sort of thing in the past
<re_irc>
<@adamgreig:matrix.org> buy a cute xbee module for each end, can treat it as a uart serial link
<re_irc>
<@adamgreig:matrix.org> I still have like 20 xbees kicking around somewhere
<re_irc>
<@adamgreig:matrix.org> stm32wl would be way cheaper in hardware cost I expect
<re_irc>
<@newam:matrix.org> adamgreig: If you can find anywhere to buy the chips right now that is
<re_irc>
<@firefrommoonlight:matrix.org> Oooo. That sounds great.
<re_irc>
<@adamgreig:matrix.org> hah, yea, well, that applies to everything I guess
<re_irc>
<@firefrommoonlight:matrix.org> Could pair that with a stmL4, since that's what I originally designed it for
<re_irc>
<@adamgreig:matrix.org> well thought out software and APIs and hardware
<re_irc>
<@firefrommoonlight:matrix.org> newam : you've done a lot of work on WL in rust; would I be able to use an example you have etc to send bytes in this way?
<re_irc>
<@adamgreig:matrix.org> complexity controllable from "pretend to be a long UART wire" through to "set up a mesh network with routers and forward these encrypted signed packets around"
<re_irc>
<@firefrommoonlight:matrix.org> I still need to do some bugfixes on WL support on stm32-hal, but should be easy
<re_irc>
<@firefrommoonlight:matrix.org> Your first complexity description is perfect
<re_irc>
<@firefrommoonlight:matrix.org> Dude, I may just buy those Xbee modules and try it with dev boards. You may have solved this
<re_irc>
<@adamgreig:matrix.org> the new xbee 3 does 802.15.4, zigbee, and also BLE
<re_irc>
<@adamgreig:matrix.org> so you could still BLE to a phone, I guess
<re_irc>
<@adamgreig:matrix.org> (I think they can use the BLE to phone to let you do setup too, cute)
<re_irc>
<@adamgreig:matrix.org> looks like they run micropython now too
<re_irc>
<@firefrommoonlight:matrix.org> Awesome. Going to have at the RM
<re_irc>
<@newam:matrix.org> firefrommoonlight: Yes though xbee would be less effort in this case if part cost doesn't matter.
<re_irc>
<@firefrommoonlight:matrix.org> Part cost does... Hmm
<re_irc>
<@firefrommoonlight:matrix.org> Prices aren't displayed on Xbee site... Rule of thumb means I can't afford it :/
<re_irc>
<@firefrommoonlight:matrix.org> It looks like the examples in stm32wl-hal don't include RF
<re_irc>
<@firefrommoonlight:matrix.org> Ok, found on Digikey. Looks like $40/module, which is far too expensive
<re_irc>
<@adamgreig:matrix.org> presumably cheaper in moderate qty
<re_irc>
<@firefrommoonlight:matrix.org> Hmm. Certified nRF or STM32W* modules are ~$10 each in qtys of 100, so was hoping to get aroudn that range
<re_irc>
<@firefrommoonlight:matrix.org> I don't think it would be a viable product with much more than that, given I need 2
<re_irc>
<@firefrommoonlight:matrix.org> (AND the MCU would still need to be on top of those)
<re_irc>
<@firefrommoonlight:matrix.org> So this may rule that brand out on price
<re_irc>
<@firefrommoonlight:matrix.org> Eg $15 (maybe cheaper?) + $5 x 2 is $40 for the mcu+RF alone
<re_irc>
<@firefrommoonlight:matrix.org> Which is MUCH higher than the nRF and STM solutions, and would make the product too expensive
<re_irc>
<@adamgreig:matrix.org> yea, might be
<re_irc>
<@adamgreig:matrix.org> you can possibly run your code on the xbee and so not need an mcu at all, and the mcu option still needs the RF passives and antenna etc, but I'm sure it's much cheaper than an xbee
<re_irc>
<@firefrommoonlight:matrix.org> dirbaio: apparnetly gets nRF modules at $5 USD each, but don't know what QTY that's at
<re_irc>
<@adamgreig:matrix.org> modules or ICs?
<re_irc>
<@firefrommoonlight:matrix.org> nRF is messier since their modules are 3rd party, but pricing appears similar
<re_irc>
<@firefrommoonlight:matrix.org> Oh wait that can do zigbee... Maybe answer is STM32WB with zigbee instead of BT?
<re_irc>
<@firefrommoonlight:matrix.org> I haven't looked down that road yet. Maybe simpler? Probably still uses their mailbox systme I haven't yet grokked
<re_irc>
<@firefrommoonlight:matrix.org> nRF serial over BLE sounds... perfect?
<re_irc>
<@dirbaio:matrix.org> firefrommoonlight: When did I say that lol
<re_irc>
<@firefrommoonlight:matrix.org> We were comparing stm and nrf and you said the stm was expensive
<re_irc>
<@newam:matrix.org> firefrommoonlight: Yeah none yet, but there are on-target tests for FSK and LoRa ping-pong
<re_irc>
<@dirbaio:matrix.org> Maybe I did :p
<re_irc>
<@dirbaio:matrix.org> It may or may not be in quantities of 200, it might be 5eur instead of 5usd
<re_irc>
<@firefrommoonlight:matrix.org> Hah
<re_irc>
<@firefrommoonlight:matrix.org> It seems they're pretty even, at least for modules
<re_irc>
<@dirbaio:matrix.org> Custom quote, not off the shelf
<re_irc>
<@firefrommoonlight:matrix.org> That makes sense
<re_irc>
<@firefrommoonlight:matrix.org> I'm not at those volumes :(
starblue has joined #rust-embedded
<re_irc>
<@dkhayes117:matrix.org> I'm messing around with some APIs for `pmpaddrx.rs` in the riscv crate. I'm getting a `parameter E is never used` error on line 3, and I'm not sure what I am doing wrong. Any insight?