f_ changed the topic of ##raspberrypi-internals to: The inner workings of the Raspberry Pi (Low level VPU/HW) -- for general queries please visit #raspberrypi -- open firmware: https://librerpi.github.io/ -- VC4 VPU Programmers Manual: https://github.com/hermanhermitage/videocoreiv/wiki -- chat logs: https://libera.irclog.whitequark.org/~h~raspberrypi-internals -- bridged to matrix and discord
bonda_000__ has joined ##raspberrypi-internals
bonda_000__ has quit [Client Quit]
bonda_000_ has quit [Ping timeout: 245 seconds]
jcea has quit [Ping timeout: 268 seconds]
KimK has quit [Read error: Connection reset by peer]
KimK has joined ##raspberrypi-internals
bonda_000 has joined ##raspberrypi-internals
<bonda_000> Yo
bonda_000 has quit [Read error: Connection reset by peer]
A_Dragon has quit [Quit: ZNC - https://znc.in]
A_Dragon has joined ##raspberrypi-internals
sys64738 has quit [Ping timeout: 255 seconds]
dolphinana has joined ##raspberrypi-internals
bonda_000 has joined ##raspberrypi-internals
<bonda_000> clever u here?
<clever> bonda_000: just on my way to the shower, and getting groceries after that
<bonda_000> I got the aarch64 linux going although windows is down lol
<clever> nice
<bonda_000> ready to work with lk-overlay
<clever> down with windows! :D
<bonda_000> huh no I still need it for msp432
<clever> is the vc4 toolchain all built?
<bonda_000> yes I just need to know what to "make"
<bonda_000> for the OS
<clever> 2024-04-28 15:07:51 < clever> `make PROJECT=rpi3-bootcode`
<bonda_000> okay
<clever> 2024-04-28 15:28:39 < clever> [nix-shell:~/apps/rpi/lk-overlay]$ ls -lhs build-rpi3-bootcode/lk.bin
<clever> 2024-04-28 15:28:39 < clever> 45K -rwxr-xr-x 1 clever users 53K Apr 28 15:28 build-rpi3-bootcode/lk.bin
<clever> when its done, you should have this file
<bonda_000> oh yeah
<bonda_000> so
<bonda_000> the nix shell do I close it ?
<clever> just exit
<clever> its baiscally just the same as running bash
<clever> nix-shell just sets up $PATH so the vc4 gcc can be found
<bonda_000> says its missing GPIO
<clever> bonda_000: what is the exact error message?
<bonda_000> make[1]: vc4-elf-gcc: No such file or directory
<bonda_000> make[1]: *** [make/compile.mk:61: build-rpi3-bootcode/platform/bcm28xx/gpio.c.o] Error 127
<bonda_000> make[1]: Leaving directory '/home/bimbom/Desktop/lk-overlay'
<clever> that says that your missing vc4-elf-gcc
<bonda_000> ah yes
<bonda_000> I cloned it but apparently something was missing
<bonda_000> in the deps
<clever> yeah, thats what nix automates, dealing with all of that for you, but i havent gotten that part working on aarch64
<bonda_000> okay binutils are now compiling
<clever> +1
<clever> i'll be in the shower while that builds
<bonda_000> ok
<clever> bonda_000: back
<bonda_000> it's still compiling stuff but I think it
<bonda_000> s almost done with binutils
<bonda_000> so do I have to build gcc also when I get on the lk?
<bonda_000> to build programs natively
<bonda_000> that would speed up things so much I can't wait to get working on it
<clever> bonda_000: you need to build both binutils and gcc
<clever> once both are build, you can just compile normal c programs
<clever> lk itself lacks a compiler
<clever> i generally add code to lk, rebuild it, then reboot the pi
<bonda_000> because what I've been doing is build a binary, put it on a spare SD card, reboot pi, switch cards again, destroyed a USB slot already this way on my PC
<bonda_000> if we port gcc to lk thats heavenly
<clever> thats why i use network boot most of the time
<clever> ypu just drop bootcode.bin on a tftp server, and reset the pi3, with no sd card in it
<clever> it will load bootcode.bin over ethernet
<bonda_000> I dont have that currently but I can handle writing it once to the SD card and then developing programs on it natively
<clever> porting gcc to lk would be a massive ordeal
<clever> it currently lacks a userland
<bonda_000> so what would it take to have a compiler running there
<clever> imagine running gcc on an arduino :P
<bonda_000> well
<clever> but i was looking at porting circuitpython and micropython earlier, and lua has been ported
<bonda_000> I mean maybe not gcc but some sort of compiler
<bonda_000> so that we can speed up hacking and testing all these undocumented peripherals with the code we slowly pull from Ghidra
<clever> just having the command prompt in lk helps a lot
<clever> youll see, once you have that example binary build
<bonda_000> so you basically implemented all the OS stuff like tasks switching in round robin fashion correct?
<bonda_000> CPU allocating it execution time etc right?
<clever> i got that for free, little-kernel already had it
<bonda_000> so what do you mean by it lacks 'userland' then where is command prompt operating?
<clever> the command is running in kernel mode
<clever> there is no isolation between the kernel and the commands being ran, and no binary loading
<clever> its just a dumb loop, where if it finds "foo" in the input buffer, it runs foo()
<bonda_000> what is 'no binary loading'
<clever> you cant load an executable from disk
<clever> you can only run code that was in the kernel when it got compiled
<bonda_000> ok
<bonda_000> so at this point you cannot write an application to run on it
<clever> you can, it just has to be written as part of LK
<bonda_000> does it have a file system?
<clever> filesystem is optional
<clever> i have working usb and ext4 drivers
<clever> this is an example of a video player application
<clever> lines 444-447 define a usb hook, and on bootup, bad_apple_usb_init() gets ran
<clever> each time a usb storage device is plugged in, it will run bad_aple_msd_probed()
<clever> and line 440 will fire up a thread to play the video file on that drive
<clever> 395 mounts the usb drive
<clever> 400/401 opens the audio and video files
<clever> 405 creates a thread to play audio
<clever> and 408 plays the entire video
<bonda_000> brb
f_ has joined ##raspberrypi-internals
<bonda_000> This will give you a vc4-targeted toolchain in $(pwd)/prefix/bin
<bonda_000> It still doesn't recognize it
<clever> bonda_000: did you add that path to $PATH?
<bonda_000> not yet
<clever> then make wont be able to find it
<bonda_000> so
<bonda_000> export "PATH=$(pwd)/prefix/bin:$PATH"
<bonda_000> is what I must do correct?
<clever> yep, that should work
<bonda_000> it's done
<bonda_000> what should I use for the UART to USB dongle on this Linux
<clever> which part is done?
<bonda_000> the lk is built
<clever> 115200 baud, same pins as usual, 14/15
<bonda_000> to be able to talk to the lk shell
<bonda_000> I mean on the Linux side
<clever> i like using `minicom -D /dev/ttyACM0 -b 115200 -o`
<bonda_000> I had putty on windows
<bonda_000> oh alright
<bonda_000> aalso
<bonda_000> so you are saying booting by ftp or sd card correct?
<clever> bonda_000: yeah, either will work, but i gotta run now, grocery time!
<bonda_000> yeah same
bonda_000 has quit [Ping timeout: 272 seconds]
bonda_000 has joined ##raspberrypi-internals
<bonda_000> i'm back
<bonda_000> okay it's all built so let me set up the ftp and try it out
<clever> bonda_000: last i checked, the dhcp server and tftp server have to be on the same machine
<clever> so you either need control of your router, or you need to plug the rpi3 into a laptop
<clever> beb
<clever> brb
<bonda_000> my rpi is plugged into the router at the moment
<bonda_000> by the Ethernet cable
sys64738 has joined ##raspberrypi-internals
f_ has quit [Ping timeout: 260 seconds]
_whitelogger has joined ##raspberrypi-internals
<clever> line 2 shows my dhcp server running, and lines 4-13 are the important parts of the dhcp server config
<clever> lines 4 and 12 are critical
<clever> the rest is just bog-standard dhcp server stuff
<clever> 16 is xinetd running, and 18-38 is the xinetd config
<clever> lines 26-38 tell xinetd to listen on the tftp port, and to run in.tftpd every time a connection comes in
<clever> and to tell in.tftpd to use /tftproot
<clever> and within that directory, is a bootcode.bin
<bonda_000> so on my router there is a "Host site" setting which says Virtual server settings
<bonda_000> do I do that or have my Linux machine as a "server"
<clever> your router is too dumb, it cant do what you need
<clever> so your only option is to plug the rpi into a laptop, and run the dhcp and tftp there
<bonda_000> so what is the Pi doing on the Ethernet boot
<clever> it will do a dhcp request
<clever> and its expecting that special "Raspberry Pi Boot " to come back from the dhcp server
<clever> if its missing, then game over
<bonda_000> Okay I can connect PC and RPi via Ethernet no problem
bonda_000 has quit [Ping timeout: 252 seconds]
bonda_000_ has joined ##raspberrypi-internals
<bonda_000_> whoops must have hit something
<bonda_000_> the pc turned off but the Ethernet cable is now in both sides
<bonda_000_> the window "Connection failed" keeps popping up
<clever> did you start a dhcp server, and configure it similarly to my example?
<bonda_000_> just installed dhcpd
<bonda_000_> "router" is your host machine right? Where the bootcode.bin is held
<clever> yeah
<bonda_000_> xinet I have a xinetd
<bonda_000_> dhcpd, xinetd, tftpd-hpa
<bonda_000_> these three I installed
<clever> sounds right
<bonda_000_> ps aux | grep dhcpd is what
<bonda_000_> I get something wrong on this one
<bonda_000_> well I haven't configured anything yet so no surprise
dolphinana_ has joined ##raspberrypi-internals
<bonda_000_> okay let me read this page on how to do this on my Linux distro
<bonda_000_> this is in the bootrom correct: https://wiki.debian.org/DHCP_Client
<clever> yes
<clever> if you run wireshark, and listen to the port where the pi is connected, you should see the dhcp requests
dolphinana has quit [Ping timeout: 260 seconds]
<clever> bonda_000_: but you can always start with an sd card first as usual, to confirm the LK build is working, and see how it works in general
<bonda_000_> okay I am copying your dhcp config
<bonda_000_> with Raspberry Pi Boot and 3 spaces
<bonda_000_> so that's all your dhcp config 10 lines?
<clever> bonda_000_: thats the important parts, i removed things like the static ip for each mac, and unrelated ipxe junk
<bonda_000_> mine stock one has a lot uncommented but a few they left like ddns-update-style-none
<bonda_000_> I will just uncomment these then
<bonda_000_> comment*
<bonda_000_> and then I have
<bonda_000_> /etc/xinetd.conf
<bonda_000_> and
<bonda_000_> /etc/xinetd.d folder
<dolphinana_> are you doing netboot or something?
<bonda_000_> well balena etcher is broken on this Linux for some reason although I got the official repo
<bonda_000_> so yeah and that will be useful for future
<clever> bonda_000_: anything mentioning tftp in either the .conf or the .d ?
<bonda_000_> I have a /etc/default/tftpd-hpa
<clever> yep, that sounds good
<bonda_000_> which I already edited and put TFTP_DIRECTORY as a folder on my Desktop, TFTP_ADDRESS="0.0.0.0:69"
<clever> and in there, what are the server_args ?
<bonda_000_> TFTP_OPTIONS="--secure" thats it
<clever> that might work
<clever> and then just restart both dhcpcd and xinetd
<bonda_000_> my xinetd.conf is all defaults
<bonda_000_> includedir /etc/xinetd.d at the end
<bonda_000_> body is empty
<bonda_000_> let me fill that up
<clever> yep, thats the classic way of doing it
<clever> that lets things like the tftp package add to the config with /etc/xinetd.d/something_tftp
<bonda_000_> and then server is the folder with bootcode.bin right?
<clever> yeah
<bonda_000_> what's server args
<clever> the arguments passed to the server when launching it
<bonda_000_> nix/store/2n9w9484wizr7nfnn227j3v844rpvs1j-netkit-tftp-0.17/sbin/in.tftpd
<clever> thats the server
<bonda_000_> is your server value
<bonda_000_> what is it a directory?
<clever> on your system, it would just be /sbin/in.tftpd
<clever> nixos just installs everything to a unique directory
<bonda_000_> found it
<bonda_000_> so in the root / I create a tftproot directory
<bonda_000_> and put bootcode.bin in there
<bonda_000_> since ls says ls: cannot access '/tftproot/': No such file or directory
<clever> thats just where my tftp server happens to be looking
<clever> you want to match your own config, or change the config to that dir
<bonda_000_> sudo cp ~/Desktop/lk-overlay/build-rpi3-bootcode/lk.bin /tftproot
bonda_000_ has quit [Remote host closed the connection]
bonda_000_ has joined ##raspberrypi-internals
<bonda_000_> I just want to get this done and get back to VC4 coding :D I mean its my first day on real Linux
<bonda_000_> brb
<bonda_000_> Apr 29 22:51:17 max systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
<clever> bonda_000_: the true error is a few lines above thatr
juri_ has quit [Ping timeout: 252 seconds]
<bonda_000_> Process: 4928 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)
<clever> there should be more in the logs
<bonda_000_> do you have something like /etc/default/isc-dhcp-server
<bonda_000_> there are more configs like INTERFACESv4="eth0"
<clever> nope, that doesnt exist on nixos
<clever> is the rpi plugged into eth0 on the machine?
<bonda_000_> they are connected by ethernet cable I'm not sure if thats eth0 or eth0
<clever> what does `ifconfig -a` report?
<bonda_000_> command not found
<clever> `ip addr`
<bonda_000_> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
<bonda_000_> valid_lft forever preferred_lft forever
<bonda_000_> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
<bonda_000_> inet 127.0.0.1/8 scope host lo
<bonda_000_> inet6 ::1/128 scope host noprefixroute
<bonda_000_> valid_lft forever preferred_lft forever
<bonda_000_> 2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
<bonda_000_> link/ether f4:39:09:33:f3:f2 brd ff:ff:ff:ff:ff:ff
<bonda_000_> 3: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
<clever> so the answer, is that you dont even have an eth0
<bonda_000_> link/ether 28:3a:4d:07:74:95 brd ff:ff:ff:ff:ff:ff
<bonda_000_> inet 192.168.0.27/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp1s0
<bonda_000_> valid_lft 82340sec preferred_lft 82340sec
<clever> so any attempt to use eth0 will just fail
<bonda_000_> inet6 fe80::726a:e725:b9b4:e5b6/64 scope link noprefixroute
<bonda_000_> valid_lft forever preferred_lft forever
<bonda_000_> i see its enp
<clever> yeah, change the dhcp server config to enp2s0
<clever> and also assign a static ip to enp2s0, that matches the dhcp server config, and it must differ from 192.168.0
<clever> for example, make enp2s0 10.0.0.1, with a mask of 255.255.255.0
<bonda_000_> how do I do that
<dolphinana_> what are you two doing?
<clever> dolphinana_: setting up network boot on the rpi
<bonda_000_> setting me up for vc4 coding
<clever> bonda_000_: not sure, i havent used debian before
<clever> and its been years since i used ubuntu
<bonda_000_> says I still have configuration file errors
<bonda_000_> maybe its IPv6 that I need to use?
<clever> no, the pi3 doesnt support v6
<clever> does it say which file the problem is in?
<bonda_000_> will try to look at the log
<bonda_000_> maybe it doesn't understand "option rpiboot code 43 = text;"?
<bonda_000_> as well as option rpiboot "Raspberry Pi Boot "
<clever> can you pastebin your entire config file?
<clever> and the exact error that it gave
<dolphinana_> clever, bonda_000_ I see, good luck you too ^^
<bonda_000_> there is also /etc/default/udhcpd.conf that says
<bonda_000_> # Comment the following line to enable
<bonda_000_> DHCPD_ENABLED="no"
<bonda_000_> # -S Log to syslog
<bonda_000_> #
<bonda_000_> # Options to pass to busybox' udhcpd.
<bonda_000_> # -f run in foreground
<bonda_000_> DHCPD_OPTS="-S"
<clever> sounds like you never enabled it
<bonda_000_> still configuration file errors
<clever> what is the exact error message it gives?
<bonda_000_> says
<bonda_000_> do journalctl -xeu isc-dhcp-server.service
<bonda_000_> and the journal has no entries
<clever> try just `journalctl -f`
<bonda_000_> Hint: You are currently not seeing messages from other users and the system.
<bonda_000_> Users in groups 'adm', 'systemd-journal' can see all messages.
<bonda_000_> Pass -q to turn off this notice.
<clever> also, run journalctl as root
<bonda_000_> The unit isc-dhcp-server.service has entered the 'failed' state with result 'exit-code'.
<clever> found the problem
<bonda_000_> A start job for unit isc-dhcp-server.service has finished with a failure.
<clever> my config has
<clever> default-lease-time 86400; # 1 day
<clever> yours has
<clever> default-least-time 86400; #1 day
<clever> lease is not spelled correctly
<bonda_000_> dang
<bonda_000_> and its so cluttered
<bonda_000_> with comments
<clever> [root@router:~/ff6fcee94896b57d8ff3e970aaea80d4]# /nix/store/s4cxgsdyypgi942chr559n94p2k9lbfi-dhcp-4.4.3/sbin/dhcpd -t -cf ./gistfile1.txt
<bonda_000_> hard to see
<clever> ./gistfile1.txt line 37: semicolon expected.
<clever> default-least-time 86400;
<clever> you can just run the dhcpd on the file, in test mode
<clever> and it tests the config
<bonda_000_> Apr 29 23:21:21 max isc-dhcp-server[6367]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ... failed!
<bonda_000_> Apr 29 23:21:21 max isc-dhcp-server[6367]: failed!
<bonda_000_> well now at least theres that
<bonda_000_> does it depend on xinetd?
<clever> maybe remove the -S from the config file, so it sends the logs to the journal instead
<clever> nope
<bonda_000_> -S Log to syslog
<bonda_000_> -f run in foreground
<bonda_000_> I'll change it to -f then
<clever> that has to match up with the type in the systemd service
<bonda_000_> maybe the DNS
<bonda_000_> I should supply my own?
<clever> that wouldnt cause it to fail to startup
<bonda_000_> wait is my Pi supposed to be trying to connect at the same time or no?
<clever> that will only work after you have started both dhcpd and xinetd
<clever> no point in turning the pi on until they are both online
<bonda_000_> well
<bonda_000_> there is something going on in the background as my Pi is on and connected to the PC
<bonda_000_> Apr 29 23:31:29 max NetworkManager[658]: <info> [1714422689.0783] dhcp4 (enp2s0): canceled DHCP transaction
<bonda_000_> Apr 29 23:31:29 max NetworkManager[658]: <info> [1714422689.0783] dhcp4 (enp2s0): activation: beginning transaction (timeout in 45 seconds)
<bonda_000_> Apr 29 23:31:29 max NetworkManager[658]: <info> [1714422689.0784] dhcp4 (enp2s0): state changed no lease
<bonda_000_> Apr 29 23:31:29 max NetworkManager[658]: <info> [1714422689.0801] policy: auto-activating connection 'Wired connection 1' (2f1f8b64-b204-4458-bc91-c01456760f5a)
<bonda_000_> Apr 29 23:31:29 max NetworkManager[658]: <info> [1714422689.0809] device (enp2s0): Activation: starting connection 'Wired connection 1' (2f1f8b64-b204-4458-bc91-c01456760f5a)
<bonda_000_> Apr 29 23:31:29 max NetworkManager[658]: <info> [1714422689.0810] device (enp2s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
<bonda_000_> Apr 29 23:31:29 max NetworkManager[658]: <info> [1714422689.0815] device (enp2s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
<bonda_000_> Apr 29 23:31:29 max avahi-daemon[604]: Joining mDNS multicast group on interface enp2s0.IPv6 with address fe80::f639:9ff:fe33:f3f2.
<bonda_000_> Apr 29 23:31:29 max NetworkManager[658]: <info> [1714422689.0823] device (enp2s0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
<bonda_000_> Apr 29 23:31:29 max avahi-daemon[604]: New relevant interface enp2s0.IPv6 for mDNS.
<bonda_000_> Apr 29 23:31:29 max NetworkManager[658]: <info> [1714422689.0830] dhcp4 (enp2s0): activation: beginning transaction (timeout in 45 seconds)
<bonda_000_> Apr 29 23:31:29 max avahi-daemon[604]: Registering new address record for fe80::f639:9ff:fe33:f3f2 on enp2s0.*
<bonda_000_> like my Pi is trying to connect to the PC at the same time
<bonda_000_> Apr 29 23:32:14 max NetworkManager[658]: <info> [1714422734.0783] dhcp4 (enp2s0): canceled DHCP transaction
<bonda_000_> Apr 29 23:32:29 max kernel: r8169 0000:02:00.0 enp2s0: Link is Down
<bonda_000_> Apr 29 23:32:14 max NetworkManager[658]: <info> [1714422734.0784] dhcp4 (enp2s0): activation: beginning transaction (timeout in 45 seconds)
<bonda_000_> Apr 29 23:32:14 max NetworkManager[658]: <info> [1714422734.0784] dhcp4 (enp2s0): state changed no lease
<bonda_000_> Apr 29 23:32:29 max NetworkManager[658]: <info> [1714422749.3194] device (enp2s0): state change: disconnected -> unavailable (reason 'carrier-changed', sys-iface-state: 'managed')
<clever> most of that looks like network manager chatter
<clever> did you go into network manager, and set enp2s0 for a static ip?
<bonda_000_> yeah it says there are dhcp transactions between them
<bonda_000_> and I'm trying to make my own at the same time
<clever> if your sending dhcp requests out on enp2s0 then you didnt configure network manager correctly
<bonda_000_> does it have a gui or I need to invoke it with some command
<bonda_000_> it says its a daemon process
<clever> you can use nmtui to edit it from command line
<bonda_000_> yeah there is a window like raspi-config
<bonda_000_> and Ipv4 configuration
<clever> and then you want to set enp2s0 to a static ip
<clever> 2024-04-29 17:02:45 < clever> for example, make enp2s0 10.0.0.1, with a mask of 255.255.255.0
<bonda_000_> Profile name Wired connection 1
<bonda_000_> Device <no name>
<bonda_000_> so I configure Ipv4 manually put in the address you just said
<clever> yeah
<bonda_000_> mask is the same as gateway
<bonda_000_> DNS server and Search domains are what
<clever> you dont want to set a gateway on that interface
<bonda_000_> I dont see a mask field
<bonda_000_> for some reason
<clever> screenshot?
<bonda_000_> IPv4 configuration <Manual>
<bonda_000_> Addresses
<bonda_000_> Gateway
<bonda_000_> DNS servers
<bonda_000_> Search domains
<bonda_000_> Routing
<clever> a screenshot or pastebin is better, irc doesnt handle lots of text well
<bonda_000_> my bad
<bonda_000_> the latter one
<clever> that may work, try saving and see what happens
<bonda_000_> then I can also "activate" it
<bonda_000_> in the second tab
<bonda_000_> Apr 29 23:48:20 max NetworkManager[658]: <info> [1714423700.3686] device (enp2s0): Activation: successful, device activated.
<bonda_000_> Probably need to keep it activated
<clever> it might be related to the network link going down, i had similar problems
<clever> do you have a spare switch or hub?
<bonda_000_> woah no error messages
<bonda_000_> sudo service isc-dhcp-server start
<bonda_000_> just went thrugh quietly
<bonda_000_> Apr 29 23:50:52 max isc-dhcp-server[7445]: Starting ISC DHCPv4 server: dhcpd.
<bonda_000_> Apr 29 23:50:52 max systemd[1]: Started isc-dhcp-server.service - LSB: DHCP server.
<bonda_000_> brb
<bonda_000_> so now the xinetd part?
<clever> yeah
<clever> or whichever tftp server your using
<bonda_000_> DONE
<bonda_000_> done*
<bonda_000_> so now that I put the bootcode.bin I can simply turn off the Pi, remove the SD card, plug in the Ethernet cable and power it up?
<bonda_000_> and also need to figure out which COM port I am using
<clever> bonda_000_: yep, thats all it is
<bonda_000_> this is Mini UART to talk to the shell correct? Pins 14-15 BCM
<clever> yeah, its always on 14/15
<clever> run `dmesg -w` and then unplug and plug the usb adapter back in
<clever> and it will tell you what the name is
<bonda_000_> got it on ttyUSB0
<bonda_000_> you said earlier minicom -D /dev/ttyACM0 -b 115200 -o
<bonda_000_> do I keep it ACM or put USB0
jcea has joined ##raspberrypi-internals
<clever> change it to USB0
<clever> the value depends on what adapter your using
<bonda_000_> and thats gonna use it as a COM port?
<clever> yeah
<bonda_000_> its a UART-USB dongle with three wires
<bonda_000_> txd rxd and ground
<clever> yep, thats common
<bonda_000_> alright first attempt
<bonda_000_> is minicom supposed to hang open or terminate?
<bonda_000_> Mine just terminated
<bonda_000_> bimbom@max:~$ minicom -D /dev/ttyUSB0 -b 115200 -o
<bonda_000_> bimbom@max:~$
<clever> `ls -lh /dev/ttyUSB0`
<clever> and `id`
<bonda_000_> crw-rw---- 1 root dialout 188, 0 Apr 30 00:14 /dev/ttyUSB0
<clever> and `id` ?
<bonda_000_> uid=1000(bimbom) gid=1000(bimbom) groups=1000(bimbom),27(sudo),100(users)
<clever> your not in the dialout group, so you lack permission to use the uart
<clever> either add yourself to dialout, or run minicom with sudo
<bonda_000_> okay first try
<bonda_000_> nothing on the terminal nor the palette screen
<clever> run wireshark, and set it to sniff the ethernet interface
<clever> you should see dhcp requests coming from the pi
<bonda_000_> so lk.bin is in /tftproot
<clever> you must rename it to bootcode.bin
<clever> the rpi rom only ever looks for bootcode.bin
<bonda_000_> 53936 bytes
<bonda_000_> ah gotcha
<bonda_000_> nothing on the journal
<bonda_000_> Dumpcap can be installed
<bonda_000_> should I get it?
<clever> yes
<bonda_000_> anyway I say yes to everything
<clever> also, is this pi3 setup to boot from usb/network?
<bonda_000_> yes Pi3B year 2015 rev1.2
<clever> bonda_000_: if you boot normal raspi-os and run `vcgencmd otp_dump | grep 17:`, what does it report?
<bonda_000_> one sec
<bonda_000_> 1020000a
<clever> usb is not enabled
<clever> add program_usb_boot_mode=1 to config.txt, reboot, then check vcgen again
<bonda_000_> I'm listening to enp2s0
<bonda_000_> no packets
<bonda_000_> gonna try this config option now
<bonda_000_> its gonna screw up the regular boot won't it?
<clever> SD still has priority
<clever> it just enables booting from usb when SD cant be found
<bonda_000_> what about force_turbo=1?
<clever> doesnt matter
<bonda_000_> start_x=1
<clever> doesnt matter
<bonda_000_> program_usb_boot_mode=1 or usb_boot_mode=1?
<clever> program_usb_boot_mode=1
<clever> thats what the docs say to add
<bonda_000_> no packets but also leds are not lit up on the Ethernet port Pi Side like they were when it was booted in Linux
<clever> did you reboot raspios and rerun vcgencmd?
<bonda_000_> I have raspbian
<clever> 2024-04-29 18:36:27 < clever> add program_usb_boot_mode=1 to config.txt, reboot, then check vcgen again
<bonda_000_> ok
<clever> what does vcgencmd say now?
<bonda_000_> ethernet link is UP
<bonda_000_> sends packets when Linux boots IPv6, ARP, DHCP, MDNS
<bonda_000_> ICMPv6*
<bonda_000_> 3020000a
<bonda_000_> some bit flipped
<clever> yep, that worked
<clever> now you can shutdown, remove the sd card, then apply power again
<bonda_000_> i wonder if it didnt mess things up now the Raspberry driver knocked on the enp2s0
<clever> shouldnt, the dhcp server will just do its job, and give the pi an ip
<bonda_000_> yeah they are talking
<bonda_000_> idk whats going on the LEDS are now on
<clever> i need to get off to bed now, its getting late here
<clever> we can resume tomorrow
<bonda_000_> there are packets
<bonda_000_> dont seem like much data
<bonda_000_> good night
<bonda_000_> 70342.31903026110.0.0.110.0.0.101TFTP61Error Code, Code: File not found, Message: File not found
<clever> that sounds like progress
<clever> the rpi tried to load a file over tftp
<clever> so you just need to configure it to serve the right file
<bonda_000_> 70342.31903026110.0.0.110.0.0.101TFTP61Error Code, Code: File not found, Message: File not found
<bonda_000_> wrong one
<bonda_000_> 68342.18108257410.0.0.10110.0.0.1TFTP63Read Request, File: bootcode.bin, Transfer type: octet
<clever> you probably have it in the wrong directory
<clever> run `ps aux | grep tftp`, what does it return?
<bonda_000_> root 2472 0.0 0.0 4656 284 ? Ss Apr29 0:00 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /home/bimbom/Desktop/srv
<bonda_000_> yeah its the old one I had before in one of the configs
<bonda_000_> gotta fix that
<bonda_000_> just need to recall which one that was
<clever> before you try changing too much, just copy the .bin to that directory
<clever> and reboot the pi again
<clever> once you confirm thats working, its just a matter of cleaning it up, which you can do while i sleep
<bonda_000_> ok
<bonda_000_> OH DUDE
<bonda_000_> it works now
<clever> you got a bunch of logs in minicom?
<bonda_000_> how do I screenshot on Linux
<clever> the printscreen key
<bonda_000_> a window
<clever> on your copy of this file, move the lib/debugcommands line up, so its after autoram, and un-comment it, then rerun `make PROJECT=rpi3-bootcode`
<clever> then copy lk.bin to `/home/bimbom/Desktop/srv/bootcode.bin`, and type `reboot` into the minicom window
<clever> then try `help`, and you should see a `db` command
<clever> yep, that looks normal
<bonda_000_> I can give you the entire log
<bonda_000_> if you need it
<clever> dont need it
<bonda_000_> so I need to change the source file now?
<f_[xmpp]> installing modified lk?
<clever> bonda_000_: yeah, change the project/rpi3-bootcode.mk file
<bonda_000_> yeah no its running on a video processor though
<f_[xmpp]> Debugging, rather..
<clever> f_[xmpp]: just enabling the debug commands in a bootcode.bin build
<clever> after getting network booting going
<f_[xmpp]> cool ^^
<bonda_000_> somehow the vc4 toolchain doest stay on my PATH very long
<bonda_000_> because I accidentally rebooted the PC
<clever> bonda_000_: `export PATH=` only affects the window you run it in
<clever> if you close that window, its gone
<bonda_000_> booted up
<bonda_000_> dont see any debug messages more than it was the first time
<clever> run `help`, do you see the `db` command?
<bonda_000_> i can't type anything in for some reason
<bonda_000_> it seems broken this time
<bonda_000_> let me try again
<bonda_000_> yeah file not found
<clever> `ls /home/bimbom/Desktop/srv`
<clever> ps aux | grep tftp
<bonda_000_> its a new file now 56464 bytes was 53936 bytes
<bonda_000_> root 2472 0.0 0.0 4656 284 ? Ss Apr29 0:00 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /home/bimbom/Desktop/srv
<clever> and what file did it say was not found?
<bonda_000_> ah it looks for bootcig
<bonda_000_> bootsig
<clever> that file can be ignored
<clever> signature checking isnt enabled on the pi3
<bonda_000_> 8411926.14506488610.0.0.10110.0.0.1TFTP62Read Request, File: bootsig.bin, Transfer type: octet
<bonda_000_> console doesnt take any input though and I rushed and didn't check the first time
<bonda_000_> anyway I'm gonna go to the store real fast
<bonda_000_> and then get some sleep
<clever> thats probably hw flow control
<clever> hit ctrl+a and then o, and poke around in the serial port settings
<clever> make sure hw flow control is disabled
<clever> [root@amd-nixos:~]# cat .minirc.dfl
<clever> pu rtscts No
<clever> you can also just directly edit your minicom config, and add this line
<bonda_000_> Serial port setup?
<clever> yes
<bonda_000_> okay its good now
<bonda_000_> help gave me a bunch of commands
<clever> do you see a db command?
<clever> try running `db 0x60000000 0x30`
<bonda_000_> ] db 0x60000000 0x30
<bonda_000_> 0x60000000: 00 b0 00 01 00 b0 00 01 e0 00 00 6d e0 00 00 6d
<bonda_000_> 0x60000010: 1d c0 41 07 1d c0 41 07 00 60 19 e8 00 60 19 e8
<bonda_000_> 0x60000020: 31 68 f9 c0 31 68 f9 c0 1d c0 40 07 1d c0 40 07
<bonda_000_> ]
<clever> now look back at your rom dump
<clever> do those bytes look familiar?
<bonda_000_> I'll have to reboot back to Linux with an sd card to pull that up
<clever> those bytes exactly match my rom dump
<bonda_000_> they should be identical I assume
<clever> 0x60000020: 31 68 f9 c0 01 cf 2d 1f 1d c0 40 07 18 e8 00 80
<clever> actually no, on closer inspection, they dont
<clever> you may have a different revision of it
<bonda_000_> rpi 3B year 2015 rev 1.2
<bonda_000_> says on the pcb
<clever> try otp_pretty_print
<clever> lines 11-16 are the table i just linked
<clever> yep, its a revision 2, from the 3B model
<clever> with the dw command, you can dump words (32bit values), and with mw, you can modify words (write 32bit things to an addr)
<clever> with those 2, you can start poking at the ISP and other registers
<bonda_000_> yeah I need to start with understanding where those tile buffers are and where frame buffer is and how to point ISP at that memory
<bonda_000_> but thats tomorrow, I'm gonna build Ghidra for that on this machine
<clever> as long as the VPU hasnt crashed, you can just type reboot into minicom at any time, and it will reboot, and grab the new bootcode.bin
<bonda_000_> will see if anything will move over because I put some hardware Memory map in there after we spoke
<clever> so you can just recompile to add more things, copy the bin over, and command it to reboot
<clever> you should be able to copy the ghidra project over
<clever> goodnight!
<bonda_000_> that's neat
<bonda_000_> good night to you also
<bonda_000_> i'm out of here
bonda_000_ has quit [Remote host closed the connection]
dolphinana_ has quit [Quit: Leaving]