*** tpb has joined #tomu | 00:00 | |
*** alexhw has quit IRC | 02:07 | |
*** alexhw has joined #tomu | 02:19 | |
*** whatnick_ has quit IRC | 04:14 | |
* daurnimator waves | 06:52 | |
daurnimator | trying to get the messible server working | 06:52 |
---|---|---|
xobs | Hey! | 06:53 |
xobs | Not working? | 06:53 |
daurnimator | nope. but likely me being stupid.... trying to get gdb working now | 06:54 |
xobs | Both should work at the same time, but you might need the latest wishbone-tool to fix a contentio issue. | 06:57 |
daurnimator | Do I need the riscv32 specific gdb? | 06:58 |
xobs | I imagine. Or a multiarch gdb, such as the one in the Fomu toolchain package, or from sifive. | 06:58 |
daurnimator | I'm currently trying with the riscv64 gdb..... the description on it says works for riscv32 | 07:01 |
daurnimator | When I try and use it I get: `localhost:1234: Connection timed out.` | 07:01 |
xobs | Try `localhost:3333` | 07:02 |
daurnimator | huh | 07:03 |
daurnimator | `INFO [wishbone_tool::server] accepting connections on 127.0.0.1:1234` <-- so this port was a lie? | 07:03 |
xobs | That might be a bug. Let me check | 07:03 |
daurnimator | the backtrace just shows: 0x00000ddc in ?? () | 07:05 |
xobs | Yes, that was a lie. I'll submit a patch and release v0.6.4! | 07:05 |
daurnimator | In addition, I "paused" in the debugger, but the light is still pulsing. | 07:06 |
xobs | The light is controlled by hardware, so even though the CPU is paused, the harware blink engine is still running. | 07:07 |
daurnimator | so I'm a little confused: the file I pass to gdb... that's just used for symbol lookup right? | 07:08 |
xobs | Okay, I pushed v0.6.4 which should fix that issue. | 07:09 |
xobs | The file you pass to gdb tells gdb what kind of CPU it is (for example, riscv32i), in addition to providing symbol data. | 07:09 |
daurnimator | what 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 gdb | 07:10 |
xobs | Hmm... 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 |
daurnimator | no. it complains about connection reset and a protocol error | 07:15 |
xobs | Maybe we neeed to add "load" support to wishbone-tool. | 07:17 |
xobs | Up until now, most major stuff I've been working on has been with an EVT board. | 07:18 |
daurnimator | is red-pulsing some error condition? | 09:22 |
daurnimator | I'm now failing to even run my old demo program | 09:24 |
xobs | Yes, that's an error condition. | 09:38 |
xobs | The 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 |
daurnimator | oh interesting........... if I compile in "release" mode then it works | 09:46 |
daurnimator | hmmm... what does it do if the file size is too large? | 09:46 |
daurnimator | Should `wishbone-tool 0xe0008000 0x12` make things come out of `wishbone-tool -s messible` running in another terminal? | 09:55 |
daurnimator | s/0x12/0x0a/ | 09:55 |
daurnimator | xobs: ^ | 09:57 |
xobs | You might try "0x40", since it's printable. | 09:59 |
xobs | Instead of "0x0a". | 09:59 |
xobs | Also, you can try running "mon explain" inside gdb. | 10:00 |
daurnimator | I still haven't managed to get gdb working | 10:00 |
xobs | If it crashed due to a trap, that'll tell you where it crashed. | 10:00 |
xobs | Try running `wishbone-tool -s gdb -s messible` | 10:00 |
daurnimator | and then? | 10:00 |
xobs | Then 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 #tomu | 10:03 | |
daurnimator | oh cool; I have gdb working now I think :) | 10:03 |
*** im-tomu has joined #tomu | 10:03 | |
daurnimator | but not messible... | 10:04 |
daurnimator | >>> bt | 10:04 |
daurnimator | #0 main () at main.zig:80 | 10:04 |
xobs | In 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 |
xobs | That will manually write 0x41 to the Messible, which should get printed out in wishbone-tool. | 10:06 |
daurnimator | not that I can see | 10:06 |
xobs | Which version of wishbone-tool are you running? | 10:07 |
xobs | Because 0.6.2 and earlier had some contention issues with Messible. | 10:08 |
xobs | It's all very new. | 10:09 |
daurnimator | it reports itself as 0.6.0. however it should be the 0.6.1 release... | 10:09 |
daurnimator | ah okay. I'll update to 0.6.2 | 10:09 |
xobs | Update to 0.6.4. | 10:10 |
daurnimator | ah lol | 10:10 |
daurnimator | if you haven't already you should update the version reported in --help | 10:10 |
xobs | Yeah, I forgot to bump the version number with 0.6.1. Sorry! | 10:11 |
xobs | Though I see a bug where Ctrl-C doesn't work. Oh well. "killall wishbone-tool" should work. | 10:13 |
daurnimator | FYI: wishbone-utils W: Unused shared library '/usr/lib/libm.so.6' by file ('usr/bin/wishbone-tool') | 10:14 |
*** xkapastel has joined #tomu | 10:28 | |
xobs | There must be some dependent crate that links it, I'm guessing... | 10:45 |
daurnimator | xobs: updated to new wishbone.... same issue(s) | 11:25 |
xobs | `wishbone-tool -V` shows 0.6.4? | 11:29 |
daurnimator | yep | 11:29 |
xobs | What if you do `wishbone-tool 0xe0008000 0x41; wishbone-tool 0xe0008000 0x42; wishbone-tool 0xe0008000`? | 11:30 |
xobs | That should show `0x00000041` | 11:30 |
daurnimator | Value at e0008000: 00000000 | 11:31 |
xobs | Are you running wishbone-tool in another window? | 11:31 |
daurnimator | one min; need to restart irc bouncer | 11:32 |
*** daurnimator has quit IRC | 11:33 | |
*** daurnimator has joined #tomu | 11:36 | |
daurnimator | xobs:what do you mean "another window"? | 11:36 |
*** im-tomu has left #tomu | 11:36 | |
*** im-tomu has joined #tomu | 11:36 | |
xobs | My fault, the last command should be `wishbone-tool 0xe0008004` | 11:38 |
daurnimator | also 0 | 11:38 |
xobs | Then 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 |
xobs | So 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 |
daurnimator | At the moment I'm not even running a program on it.... its freshly rebooted | 11:41 |
*** rohitksingh has joined #tomu | 11:41 | |
xobs | It's running foboot-2.0.3, right? | 11:41 |
daurnimator | Easiest way to check? | 11:42 |
xobs | `dfu-util -l` | 11:42 |
daurnimator | Found 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 |
xobs | Ah. There's the problem. | 11:43 |
xobs | Install 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 |
daurnimator | Install how? | 11:43 |
xobs | `dfu-util -D pvt-updater-v2.0.3.dfu` | 11:44 |
daurnimator | k, updating now | 11:44 |
daurnimator | now it works :D | 11:46 |
xobs | Yay | 11:49 |
daurnimator | woo! and my actual code works now too | 11:52 |
daurnimator | xobs: the wishbone server seems to be setting some funky terminal modes | 11:53 |
xobs | It 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 |
tpb | Title: crossterm/unix.rs at master · crossterm-rs/crossterm · GitHub (at github.com) | 11:58 |
*** TheJJ has quit IRC | 11:58 | |
xobs | The funky terminal modes are probably the mouse capture. | 11:58 |
*** rohitksingh has quit IRC | 11:58 | |
daurnimator | ah that also explains why I couldn't easily select in that terminal | 11:59 |
daurnimator | why do you do that? | 12:00 |
daurnimator | it essentially means that I would need to have terminfo knowledge on the FOMU to print... | 12:00 |
xobs | The hope was that it would work with litex and linux. | 12:00 |
xobs | I'll gate that behind a feature flag. | 12:01 |
daurnimator | still having the weird issue where my program only works in "release" mode | 12:04 |
xobs | It crashes with the red flashing light in debug mode? | 12:05 |
daurnimator | yep | 12:06 |
xobs | What if you attach gdb and run `mon explain`? | 12:06 |
daurnimator | Current trap is: Supervisor external interrupt at 0x00001390 | 12:08 |
xobs | And `disassemble 0x1390`? | 12:08 |
daurnimator | No function contains specified address. | 12:09 |
*** rohitksingh has joined #tomu | 12:22 | |
daurnimator | xobs: I'm about to head to bed. Anything else to try tonight? | 12:22 |
*** xkapastel has quit IRC | 12:38 | |
*** TheJJ has joined #tomu | 12:39 | |
xobs | You could try "mon reset" followed by "stepi" | 12:40 |
xobs | That'll let you trace where execution flows. | 12:40 |
xobs | daurnimator: there, I added the `--terminal-mouse` argument so it doesn't capture the mouse by default anymore. | 12:49 |
daurnimator | xobs: not only the mouse, but I'm questioning why raw at all | 12:57 |
daurnimator | means that e.g. \n isn't enough for a new line (you need \r\n). | 12:58 |
xobs | It'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 IRC | 17:43 | |
*** rohitksingh has joined #tomu | 17:49 | |
*** st-gourichon-f has quit IRC | 18:27 | |
*** st-gourichon-fid has joined #tomu | 18:43 | |
*** rohitksingh has quit IRC | 19:54 | |
*** techman83 has quit IRC | 22:01 | |
*** techman83 has joined #tomu | 22:02 |
Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!