<re_irc> <@adamgreig:matrix.org> Huh. What's in memory.x and are you using flip-link?
<re_irc> <@adamgreig:matrix.org> Can you check the first word of the vector table? If you use objdump to binary it'll be the first four bytes
cr1901_ is now known as cr1901
rardiol has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
rardiol has joined #rust-embedded
rardiol has quit [Client Quit]
rardiol has joined #rust-embedded
cr1901 has quit [Remote host closed the connection]
cr1901 has joined #rust-embedded
starblue has quit [Ping timeout: 240 seconds]
starblue has joined #rust-embedded
rardiol has quit [Ping timeout: 256 seconds]
ni_ is now known as ni
<re_irc> <@ubik:matrix.org> Default memory.x from rp-hal and using flip-link. But not using it results also in a mess.
tokomak has joined #rust-embedded
<re_irc> <@monacoprinsen:matrix.org> Hey guys,
<re_irc> <@monacoprinsen:matrix.org> What gives a faster output to console:
<re_irc> <@monacoprinsen:matrix.org> Used Hprintln before but I feel it updates slow
<re_irc> <@monacoprinsen:matrix.org> Hprintln from semihosting or Iprintline from ITM dump?
<re_irc> <@9names:matrix.org> ITM should be way faster
rardiol has joined #rust-embedded
<re_irc> <@ubik:matrix.org> adamgreig: first word of `.vector_table` is `0xc8f60320`
<Lumpio-> Semihosting is pretty much the slowest option out of the commonly used ones.
<re_irc> <@adamgreig:matrix.org> monacoprinsen:matrix.org: I'd try rprintln from rtt-target, it goes over the debugger like semihosting so is convenient (while iprintln requires swo), but is almost as fast and low-overhead as iprintln
<re_irc> <@adamgreig:matrix.org> ubik:matrix.org: Is that little endian or just the first four bytes in order? Perhaps it's 2003f6c8 which sounds like quite a reasonable initial stack pointer
<re_irc> <@ubik:matrix.org> that's the way object-dump outputs it
<re_irc> <@ubik:matrix.org> but yeah, probably that
<Lumpio-> Which chip is it?
<Lumpio-> Oh, RP3040 huh
<re_irc> <@ubik:matrix.org> RP2040
<Lumpio-> RP2040 even
<Lumpio-> Alright
<re_irc> <@monacoprinsen:matrix.org> adamgreig: Tnx!
<Lumpio-> I forgot how the boot process even works on that heh, it has like a built-in bootloader of sorts doesn't it
<re_irc> <@9names:matrix.org> yeah, there's a bootloader in ROM
<re_irc> <@9names:matrix.org> plus there's a 2nd stage bootloader that configures the flash controller to work with the particular spi flash that is connected
Shell has quit [Quit: ZNC 1.8.2 - https://znc.in]
Shell has joined #rust-embedded
Shell has quit [Remote host closed the connection]
Shell has joined #rust-embedded
<re_irc> <@yruama_lairba:matrix.org> hello, i'd like to know how to profile code when using rust embed ?
<re_irc> <@k900:0upti.me> That's a tricky one
<re_irc> <@k900:0upti.me> The real answer is "use your chip's sampling feature if it has one, log timings if it doesnt'"
<re_irc> <@yruama_lairba:matrix.org> K900: it's seems your talking about benchmarking
<re_irc> <@k900:0upti.me> No, I'm not
<re_irc> <@yruama_lairba:matrix.org> ok, while i never did profiling before, i understand profiling is a way to know on wich part of the code most of the time is spend
<re_irc> <@k900:0upti.me> Yes, that's what it is
<re_irc> <@yruama_lairba:matrix.org> maybe there is a tutorial about how to do it ?
<re_irc> <@k900:0upti.me> There is no universal way to do it
<re_irc> <@k900:0upti.me> Most higher end ARM based SoCs have a built-in sampling feature that you can use with something like OpenOCD
<re_irc> <@k900:0upti.me> For other things it's probably easiest to just manually time the slow bits
<re_irc> <@adamgreig:matrix.org> many cortex-m will have the ITM that can emit timing information, profile the PC, etc
<re_irc> <@adamgreig:matrix.org> but it's a bit fiddly to set up and use, and I don't think there's very much open source tooling for it atm
<re_irc> <@k900:0upti.me> https://github.com/japaric/itm-tools
<re_irc> <@k900:0upti.me> Old-ish but should still be usable
<re_irc> <@yruama_lairba:matrix.org> ok, looks complicated,
<re_irc> <@yruama_lairba:matrix.org> and profiling functions seems to not worth the effort, benchmarking should be enought
Amadiro has joined #rust-embedded
Amadiro has quit [Remote host closed the connection]
cr1901 has quit [Remote host closed the connection]
cr1901 has joined #rust-embedded
Amadiro has joined #rust-embedded
<re_irc> <@monacoprinsen:matrix.org> Does itm-decode work the same way as itm?
<re_irc> <@monacoprinsen:matrix.org> Since itm is deprecated
<re_irc> <@k900:0upti.me> I'm not sure what you mean by "itm" here
<re_irc> <@adamgreig:matrix.org> yea, it's basically the same
<Lumpio-> Benchmarking = running different versions of the same thing, or the same thing on multiple platforms, or both, and seeing how long it takes
<Lumpio-> Profiling = running one version of your thing, and seeing how much time the different parts of it take
<Lumpio-> essentially
<Lumpio-> (Replace time with memory or power or whatever other thing you're interested in)
<Lumpio-> Both can be done with logging, doing profiling with just logging can take more work, but sometimes it also gives you more easily interpretable resluts.
tokomak has quit [Ping timeout: 240 seconds]
rardiol has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
rardiol has joined #rust-embedded
<re_irc> <@lkostka:matrix.org> Hi. I've been wondering is there any more elegant way then hardcoding / macro programming way of getting individual GPIO pins ?
<re_irc> <@newam:matrix.org> For that you can the traits from embedded-hal. Those GPIO structures implement the embedded-hal traits to make it generic. For example
<re_irc> <@newam:matrix.org> pub fn example<P, E>(pin: &mut P) -> Result<(), E>
<re_irc> <@newam:matrix.org> where
<re_irc> <@newam:matrix.org> ```rs
<re_irc> <@newam:matrix.org> Whoops wrong chat
starblue has quit [Quit: WeeChat 3.0]
starblue has joined #rust-embedded