Sunday, 2020-01-26

*** tpb has joined #tomu00:00
*** alexhw has quit IRC02:07
*** alexhw has joined #tomu02:19
*** whatnick_ has quit IRC04:14
* daurnimator waves06:52
daurnimatortrying to get the messible server working06:52
xobsHey!06:53
xobsNot working?06:53
daurnimatornope. but likely me being stupid.... trying to get gdb working now06:54
xobsBoth should work at the same time, but you might need the latest wishbone-tool to fix a contentio issue.06:57
daurnimatorDo I need the riscv32 specific gdb?06:58
xobsI imagine.  Or a multiarch gdb, such as the one in the Fomu toolchain package, or from sifive.06:58
daurnimatorI'm currently trying with the riscv64 gdb..... the description on it says works for riscv3207:01
daurnimatorWhen I try and use it I get: `localhost:1234: Connection timed out.`07:01
xobsTry `localhost:3333`07:02
daurnimatorhuh07:03
daurnimator`INFO [wishbone_tool::server] accepting connections on 127.0.0.1:1234` <-- so this port was a lie?07:03
xobsThat might be a bug.  Let me check07:03
daurnimatorthe backtrace just shows: 0x00000ddc in ?? ()07:05
xobsYes, that was a lie.  I'll submit a patch and release v0.6.4!07:05
daurnimatorIn addition, I "paused" in the debugger, but the light is still pulsing.07:06
xobsThe light is controlled by hardware, so even though the CPU is paused, the harware blink engine is still running.07:07
daurnimatorso I'm a little confused: the file I pass to gdb... that's just used for symbol lookup right?07:08
xobsOkay, I pushed v0.6.4 which should fix that issue.07:09
xobsThe file you pass to gdb tells gdb what kind of CPU it is (for example, riscv32i), in addition to providing symbol data.07:09
daurnimatorwhat does your debugging flow look like? is it: => 1. compile program as both .elf and .bin. 2. reboot via wishbone; 3. run dfu-util to upload. 4. (re)start wishbone -s gdb 5. start gdb07:10
xobsHmm... it's designed to let it continue to work across reboots.  I wonder.  Can you leave gdb running, and run another copy of "wishbone-tool" to reset it?07:15
daurnimatorno. it complains about connection reset and a protocol error07:15
xobsMaybe we neeed to add "load" support to wishbone-tool.07:17
xobsUp until now, most major stuff I've been working on has been with an EVT board.07:18
daurnimatoris red-pulsing some error condition?09:22
daurnimatorI'm now failing to even run my old demo program09:24
xobsYes, that's an error condition.09:38
xobsThe bootloader sets the LED to blink red before it jumps to your code.  If you don't change it to something else, then it will continue to blink red even if the CPU has crashed.09:39
daurnimatoroh interesting........... if I compile in "release" mode then it works09:46
daurnimatorhmmm... what does it do if the file size is too large?09:46
daurnimatorShould `wishbone-tool 0xe0008000 0x12` make things come out of `wishbone-tool -s messible` running in another terminal?09:55
daurnimators/0x12/0x0a/09:55
daurnimatorxobs: ^09:57
xobsYou might try "0x40", since it's printable.09:59
xobsInstead of "0x0a".09:59
xobsAlso, you can try running "mon explain" inside gdb.10:00
daurnimatorI still haven't managed to get gdb working10:00
xobsIf it crashed due to a trap, that'll tell you where it crashed.10:00
xobsTry running `wishbone-tool -s gdb -s messible`10:00
daurnimatorand then?10:00
xobsThen you should be able to connect.  You can try omitting the elf file just to see if it works: `riscv64-unknown-elf-gdb -ex 'set architecture riscv:rv32' -ex 'tar rem :3333'`10:03
*** im-tomu has left #tomu10:03
daurnimatoroh cool; I have gdb working now I think :)10:03
*** im-tomu has joined #tomu10:03
daurnimatorbut not messible...10:04
daurnimator>>> bt10:04
daurnimator#0  main () at main.zig:8010:04
xobsIn gdb, try running: `set *((int *)0xe0008000)=0x41`10:04
daurnimator^ seems like a good first step in gdb. however _start is missing from the trace...10:05
xobsThat will manually write 0x41 to the Messible, which should get printed out in wishbone-tool.10:06
daurnimatornot that I can see10:06
xobsWhich version of wishbone-tool are you  running?10:07
xobsBecause 0.6.2 and earlier had some contention issues with Messible.10:08
xobsIt's all very new.10:09
daurnimatorit reports itself as 0.6.0. however it should be the 0.6.1 release...10:09
daurnimatorah okay. I'll update to 0.6.210:09
xobsUpdate to 0.6.4.10:10
daurnimatorah lol10:10
daurnimatorif you haven't already you should update the version reported in --help10:10
xobsYeah, I forgot to bump the version number with 0.6.1.  Sorry!10:11
xobsThough I see a bug where Ctrl-C doesn't work.  Oh well.  "killall wishbone-tool" should work.10:13
daurnimatorFYI: wishbone-utils W: Unused shared library '/usr/lib/libm.so.6' by file ('usr/bin/wishbone-tool')10:14
*** xkapastel has joined #tomu10:28
xobsThere must be some dependent crate that links it, I'm guessing...10:45
daurnimatorxobs: updated to new wishbone.... same issue(s)11:25
xobs`wishbone-tool -V` shows 0.6.4?11:29
daurnimatoryep11:29
xobsWhat if you do `wishbone-tool 0xe0008000 0x41; wishbone-tool 0xe0008000 0x42; wishbone-tool 0xe0008000`?11:30
xobsThat should show `0x00000041`11:30
daurnimatorValue at e0008000: 0000000011:31
xobsAre you running wishbone-tool in another window?11:31
daurnimatorone min; need to restart irc bouncer11:32
*** daurnimator has quit IRC11:33
*** daurnimator has joined #tomu11:36
daurnimatorxobs:what do you mean "another window"?11:36
*** im-tomu has left #tomu11:36
*** im-tomu has joined #tomu11:36
xobsMy fault, the last command should be `wishbone-tool 0xe0008004`11:38
daurnimatoralso 011:38
xobsThen that means something is draining the Messible, since the first two commands should be placing "0x41" and "0x42" into the FIFO, and the third command should be removing bytes from the FIFO.11:39
xobsSo something is reading from 0xe0008004.  If you have a copy of `wishbone-tool` ruunning somewhere, that could be draining it.  Or perhaps there is a program running that is reading from that address.11:40
daurnimatorAt the moment I'm not even running a program on it.... its freshly rebooted11:41
*** rohitksingh has joined #tomu11:41
xobsIt's running foboot-2.0.3, right?11:41
daurnimatorEasiest way to check?11:42
xobs`dfu-util -l`11:42
daurnimatorFound DFU: [1209:5bf0] ver=0101, devnum=65, cfg=1, intf=0, path="1-2", alt=0, name="Fomu PVT running DFU Bootloader v1.9.1", serial="UNKNOWN"11:42
xobsAh.  There's the problem.11:43
xobsInstall https://github.com/im-tomu/foboot/releases/download/v2.0.3/pvt-updater-v2.0.3.dfu to update to 2.0.3.  Things should get better :)11:43
daurnimatorInstall how?11:43
xobs`dfu-util -D pvt-updater-v2.0.3.dfu`11:44
daurnimatork, updating now11:44
daurnimatornow it works :D11:46
xobsYay11:49
daurnimatorwoo! and my actual code works now too11:52
daurnimatorxobs: the wishbone server seems to be setting some funky terminal modes11:53
xobsIt sets raw mode with https://github.com/crossterm-rs/crossterm/blob/master/src/terminal/sys/unix.rs#L46-L63 and then enables mouse capture.11:58
tpbTitle: crossterm/unix.rs at master · crossterm-rs/crossterm · GitHub (at github.com)11:58
*** TheJJ has quit IRC11:58
xobsThe funky terminal modes are probably the mouse capture.11:58
*** rohitksingh has quit IRC11:58
daurnimatorah that also explains why I couldn't easily select in that terminal11:59
daurnimatorwhy do you do that?12:00
daurnimatorit essentially means that I would need to have terminfo knowledge on the FOMU to print...12:00
xobsThe hope was that it would work with litex and linux.12:00
xobsI'll gate that behind a feature flag.12:01
daurnimatorstill having the weird issue where my program only works in "release" mode12:04
xobsIt crashes with the red flashing light in debug mode?12:05
daurnimatoryep12:06
xobsWhat if you attach gdb and run `mon explain`?12:06
daurnimatorCurrent trap is: Supervisor external interrupt at 0x0000139012:08
xobsAnd `disassemble 0x1390`?12:08
daurnimatorNo function contains specified address.12:09
*** rohitksingh has joined #tomu12:22
daurnimatorxobs: I'm about to head to bed. Anything else to try tonight?12:22
*** xkapastel has quit IRC12:38
*** TheJJ has joined #tomu12:39
xobsYou could try "mon reset" followed by "stepi"12:40
xobsThat'll let you trace where execution flows.12:40
xobsdaurnimator: there, I added the `--terminal-mouse` argument so it doesn't capture the mouse by default anymore.12:49
daurnimatorxobs: not only the mouse, but I'm questioning why raw at all12:57
daurnimatormeans that e.g. \n isn't enough for a new line (you need \r\n).12:58
xobsIt's meant to be like a serial port, where that's already the case.  It's the same mechanism that the crossover UART works for litex.13:04
*** rohitksingh has quit IRC17:43
*** rohitksingh has joined #tomu17:49
*** st-gourichon-f has quit IRC18:27
*** st-gourichon-fid has joined #tomu18:43
*** rohitksingh has quit IRC19:54
*** techman83 has quit IRC22:01
*** techman83 has joined #tomu22:02

Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!