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
f_ has quit [Read error: Connection reset by peer]
jcea has quit [Ping timeout: 246 seconds]
f_ has joined ##raspberrypi-internals
Ad0 has quit [Ping timeout: 245 seconds]
bob_x2 has quit [Excess Flood]
Ad0 has joined ##raspberrypi-internals
bob_x2 has joined ##raspberrypi-internals
f_[xmpp] has joined ##raspberrypi-internals
grndslm has quit [Read error: Connection reset by peer]
<f_> test
<f_ridge> <f​_[mtrx]/Matrix> Ah ok. Thought the bot died.
<f_> clever: Nice!
f_[xmpp] has quit [Ping timeout: 256 seconds]
jcea has joined ##raspberrypi-internals
<clever> f_: you happen to know anything about making good looking datasheets in pdfs?
<clever> f_: basically, i want to create something like page 33: https://datasheets.raspberrypi.com/rp1/rp1-peripherals.pdf
<sys64738> there's probably a LaTeX package for this out there somewhere
<clever> sys64738: i threw together a quick sample latex file, and it fails on the very first statement
<clever> > ! Undefined control sequence.
<clever> > l.1 \begin
<sys64738> ... have you ever used LaTeX before?
<clever> years ago
<clever> i cant find those old scripts
<sys64738> yeah, thing is that documents first need to start withwhat's called a "preamble" which starts with "\documentclass[<stuff here>]{<more stuff here>}" and then a bunch of other commands
<clever> i initially had that too
<clever> it complained about it the same way
<sys64738> weird
<sys64738> what latex distribution, compiler, editor, ... are you using?
<clever> > ! Undefined control sequence.
<clever> > l.1 \documentclass
<clever> > {article}
<clever> just running pdftex on it, from the texliveFull package
<clever> undocumented> This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022/nixos.org) (preloaded format=pdftex)
<sys64738> ah, nixos. wouldn't be surprised if there's some weird specific way to configure it in order for it to actually work, then. (which i dont know about because i dont use nixos)
<clever> how would it normally load the documentclass stuff?
<sys64738> also uh wait. you're running *pdftex* on it?
<clever> yeah
<clever> trying to turn latex into a pdf
<sys64738> can you uh. try *pdflatex* instead?
<clever> now i get a pdf, with the example text
<sys64738> ah, there you go
<clever> ah, but pkgs.texliveMinimal lacks that binary
<sys64738> (\documentclass and friends are from LaTeX packages, which is a bunch of TeX source code that gives you the actually useful commands to do document typesetting. pdflatex loads these packages by default, pdftex doesn't)
<clever> texliveBasic does still have it
<clever> ahhh
<clever> so minimal is just tex, without la
<sys64738> also make sure to have latexmk
<sys64738> (the binary)
<clever> its in the full, medium, and BookPub packages
<sys64738> LaTeX is "fun" in the way that cross-refs, citations etc. need multiple runs to be done and rendered correctly, so the number of times to run pdflatex (and sometimes other tools like biber) varies between runsdepending on what you have and what has been added. latexmk automates this
<sys64738> (latexmk can also put all the .aux .out .log etc crud to a separate folder)
<clever> i was just looking for a -o flag, heh
<clever> 6bf535pp0phvv62fa23cf8b1d69znzxb-undocumented.aux 6bf535pp0phvv62fa23cf8b1d69znzxb-undocumented.log 6bf535pp0phvv62fa23cf8b1d69znzxb-undocumented.pdf
<clever> unpredictable names will make scripting harder
<sys64738> for "simple" documents, calling pdflatex directly is fine, but if you want "see table <number>", then, yeah
<clever> to start with, i just want a list of registers
<f_> clever: Should be doable
<clever> 0xf0000000 & TODO & TODO & PIO (M3 private) \\
<clever> sys64738: and here is the first fun thing, i want an 2 addresses (start and end), and a size...
<f_> In markdown on the website, even
<clever> > (0xf0000000 + 0x4000 - 1).toString(16)
<clever> 'f0003fff'
<clever> an example in JS, start is 0xf0000000, end is 0xf0003fff, size is 0x4000 or 16kb
<clever> can latex auto-compute that from just start&size?
<clever> f_: and can markdown do the same math?
<f_> hehe
<sys64738> markdown can't, LaTeX probably can
<sys64738> first answer uses laulatex though
<sys64738> generating such things from some data table purely in LaTeX is pretty "hardcore" though
<clever> a sample of what i have so far
<f_> clever: I can prob. have the generator do the math
<sys64738> so it might be a better idea to write the info tables in some machine-readable format, then use some other scripting language to generate LaTeX
<sys64738> (which is what lots of people probably already do anyway)
<clever> yeah
<clever> that would also enable auto-generating .h files that can be consumed by the compiler
<clever> i think it was svd, that i'm thinking of?
<clever> ../pico/pico-sdk/src/rp2040/hardware_regs/rp2040.svd
<f_> clever: Now that f_ridge is here it's a good time to abuse matrix again for file uploads!!!
<sys64738> SVD is like that yet
<sys64738> yes*
<clever> f_: yep!
<clever> so in theory, i could just write svd, and then auto-convert that to latex, and then pdf
<f_ridge> <f​_[mtrx]/Matrix> what a fridge
<clever> another complication, is the multiple layers of address translation going on
<sys64738> yeah. though idk if there's an svd2latex script already out there
<clever> https://datasheets.raspberrypi.com/rp1/rp1-peripherals.pdf do you see the address translator in the top-right-ish on page 6?
<clever> the cortex-M3's are operating in a 32bit address space
<clever> some address ranges go to the sram and rom at the top
<clever> some go out the bottom ports, and hit a custom splitter
<clever> 0xf0000000 and 0xf0004000 (both 16k windows) then peel off and go to the right, into pio and rio
<clever> everything else goes thru the address translator, and maps into a 40bit addr space
<clever> so the M3 thinks uart0 is at 0x4003_0000
<clever> but the 40bit bus, says that uart0 is at 0xc0_4003_0000
<clever> and then linux says that uart0 is at 0x1f_0003_0000 within the arm physical space
<clever> sys64738: how would you best represent this in svd and pdf?
<sys64738> this depends, there's multiple options, and idk if there's a single "best" one
<clever> the 32bit space is best if your running code on the M3
<clever> the linux view is best if your writing linux drivers
<clever> the 40bit space, i think linux handles automatically, via dma-ranges and device-tree
<sys64738> for SVD, you typically want to use the autogenerated code to be used on the chip, and SVDs are typically used for microcontrollers (as opposed to device trees)
<clever> and cortex-m3 is basically an MCU
<sys64738> for the PDF, well, that's more of a concern about what would be the best *explanation*
<clever> i'm thinking the svd should be from the M3's point of view, since thats where most of the auto-generated code would run?
<clever> and then the pdf can explain the exact differences
<sys64738> yeah
<sys64738> you could pick one address space and then have a part of the chapter on the memory map explain the different address spaces & what convention is used in the PDF, or you could use multiple addresses everywhere
<clever> one more thing...
<sys64738> or have a memory map table with all the different address spaces (down to the bus level, probably, unless you want the table to be huge), and then have tables for each bus with peripheral lists (that just use some base/offset) etc
<clever> this shows how the various addresses map around
<clever> could latex generate a similar image, or am i better off just going into gimp?
<sys64738> I'd use either inkscape or LaTeX TikZ
<sys64738> TikZ is known for being more annoying though, but inkscape could be more "fiddly" to have a result with a uniform layout
<sys64738> but id def use inkscape instead of gimp
<sys64738> (vector drawings just make much more sense for this)
<clever> now to write some svd, and see what pops out of svd2latex.....
<sys64738> errrrrrr.
<sys64738> 18:16 <sys64738> yeah. though idk if there's an svd2latex script already out there
<sys64738> you found one?
<clever> i just assumed it exists, lol
<clever> i can always write one if it doesnt
<clever> xml->latex seems simple enough
<sys64738> yeah id just quickly hack something together in python
<clever> even with that tool missing, svd sounds like the best option
<sys64738> yeah probs
<clever> any gui tools for svd viewing?
<clever> also just to validate the syntax
<sys64738> there's several command-line tools that can be used for checking/linting, but idk about visualizers
<clever> i did see a cool rp2040 gui, that would let you navigate the entire register space as a tree, with docs
<clever> and it tied into openocd, to give r/w access to the real register
<clever> including decoding the value, according to svd
<sys64738> https://github.com/WRansohoff/SVD_visualizer is a thing apparently?
<clever> probably
<sys64738> never heard of the tool you're referring to
<clever> hmmm, or not
<clever> let me search
<clever> cant find the right search terms
<clever> pkgs/development/python-modules/cmsis-svd/default.nix: pythonImportsCheck = [ "cmsis_svd" ];
<clever> looks to already be packaged
<clever> [clever@amd-nixos:~/apps/rpi/undocumented]$ NIXPKGS_ALLOW_INSECURE=1 nix-build '<nixpkgs>' -A pythonPackages.cmsis-svd -o root2
<clever> (it depends on python2, and nixpkgs doesnt like 2)
<f_ridge> <c​leverca22/Matrix> undocumented.svd
<clever> f_ridge: gg
<clever> sys64738: as a start, i added just pio, proc_rio, and uart0, now i want to see how it looks....
<f_> clever having issues?
<clever> f_: where is the download link on the above file?
<f_ridge> <f​_[mtrx]/Matrix> Weird.
<f_ridge> <f​_[mtrx]/Matrix> Send it again?
<f_ridge> <c​leverca22/Matrix> undocumented.svd
<f_ridge> <f​_[mtrx]/Matrix> hmm try appending .zip ?
<f_ridge> <f​_[mtrx]/Matrix> Or .pdf or whatever
<f_ridge> <f​_[mtrx]/Matrix> hmmmmm
<f_ridge> <f​_[mtrx]/Matrix> I'll report that
<f_ridge> <f​_[mtrx]/Matrix> to the matterbridge folks
Riku_V_ has joined ##raspberrypi-internals
<f_> Such a flawless bridge
Riku_V has quit [Ping timeout: 268 seconds]
<f_> Anyway I reported it
Riku_V_ is now known as Riku_V
<clever> f_: oh, interesting, the zip was attached in discord as a regular discord file, but the svd was text as before
<clever> but from discord, the issue doesnt exist
<f_> hmmm
<f_> Forwarded to #matterbridge
<clever> so if matrix sends a file, irc gets a link, and discord gets a file (assuming it doesnt bug)
<clever> if discord sends a file, both irc and matrix get a link
<clever> even when its working, its not working the same way in both directions
<f_> yeah.
<f_> That one might be known already.
Herc has quit [Remote host closed the connection]
Herc has joined ##raspberrypi-internals
<clever> sys64738: i think the next big question then, latex include statements?
<sys64738> wdym? like C #include?
<clever> yeah
<clever> thinking i would auto-generate parts of the latex, and then #include them into the main file
<sys64738> yeah, there's \input{filename} and \include{filename}. one is for verbatim inclusion, C-style, the other is for a more "document with subfiles" approach which also inserts page breaks and stuff. i always confuse the two
<sys64738> looks like \input is C #include
<sys64738> i did my master's thesis with a bunch of \include{}s for the separate chapters, then \input{} whenever needed (eg source code listings in the appendix)
<clever> how do pagebreaks behave differently between the 2?
<f_ridge> <s​ys64738/Matrix> suppose you have a `main.tex`:
<f_ridge> <s​ys64738/Matrix> ```tex
<f_ridge> <s​ys64738/Matrix> hello
<f_ridge> <s​ys64738/Matrix>
<f_ridge> <s​ys64738/Matrix> \include{sub1}
<f_ridge> <s​ys64738/Matrix>
<f_ridge> <s​ys64738/Matrix> world
<f_ridge> <s​ys64738/Matrix>
<f_ridge> <s​ys64738/Matrix> \input{sub2}
<f_ridge> <s​ys64738/Matrix>
<f_ridge> <s​ys64738/Matrix> end of document
<f_ridge> <s​ys64738/Matrix> ```
<f_ridge> <s​ys64738/Matrix>
<f_ridge> <s​ys64738/Matrix> `sub1.tex` says `hello from sub1`, `sub2.tex` says `hello from sub2` the final result you get is:
<f_ridge> <s​ys64738/Matrix>
<f_ridge> <s​ys64738/Matrix> ```
<f_ridge> <s​ys64738/Matrix> hello
<f_ridge> <s​ys64738/Matrix>
<f_ridge> <s​ys64738/Matrix> --- new page starts here ---
<f_ridge> <s​ys64738/Matrix>
<f_ridge> <s​ys64738/Matrix> hello from sub1
<f_ridge> <s​ys64738/Matrix>
<f_ridge> <s​ys64738/Matrix> --- new page starts here ---
<f_ridge> <s​ys64738/Matrix>
<f_ridge> <s​ys64738/Matrix> world
<f_ridge> <s​ys64738/Matrix>
<f_ridge> <s​ys64738/Matrix> hello from sub2
<f_ridge> <s​ys64738/Matrix>
<f_ridge> <s​ys64738/Matrix> end of document
<f_ridge> <s​ys64738/Matrix> ```
<sys64738> wow that's slow on the IRC side
<f_ridge> <c​leverca22/Matrix> ah i see, so input include would force the imported file onto its own page
<f_ridge> <c​leverca22/Matrix> and thats better for chapters
<f_ridge> <c​leverca22/Matrix> while input just shoves it inline, and pagebreaks happen whenever you overflow?
<sys64738> yeah
<clever> sys64738: hows that look?
<sys64738> that's indeed a table?
<sys64738> or what am i supposed to see?
<clever> yeah, thats all it is for now
<clever> but thats generated from svd
<clever> so i can now fill the svd out more...
<f_> sys64738: just keep in mind that the bridge limits multiline messages to 30 lines.
<f_> I can have it be higher, e.g. 60 lines but that won't be for today
<f_> (f_ridge is my bot)
<sys64738> ah
<sys64738> (and yeah, figured that it's yours)
<f_ridge> <c​leverca22/Matrix> ```
<f_ridge> <c​leverca22/Matrix> ```
<f_ridge> <c​leverca22/Matrix> undocumented> ! Missing $ inserted.
<f_ridge> <c​leverca22/Matrix> undocumented> <inserted text>
<f_ridge> <c​leverca22/Matrix> undocumented> $
<f_ridge> <c​leverca22/Matrix> undocumented> l.10 UARTLCR_
<f_ridge> <c​leverca22/Matrix> undocumented> H\\
<f_ridge> <c​leverca22/Matrix> undocumented> ?
<f_ridge> <c​leverca22/Matrix> undocumented> ! Emergency stop.
<f_ridge> <c​leverca22/Matrix> ```
<f_ridge> <c​leverca22/Matrix> sys64738: what could be causing this error?
<sys64738> _ is special syntax for subscripts *in math mode*
<sys64738> if you want to have a displayed underscore, you have to write \_
<sys64738> so UARTLCR\_H
<f_ridge> <c​leverca22/Matrix> ah
<f_ridge> <c​leverca22/Matrix> fun, the bridge ate the backslash
<sys64738> ("$UARTLCR_H$" would display "UARTLCRₕ")
<sys64738> ah bruh
<sys64738> `UARTLCR\\_H` does this work?
<sys64738> no *now* it does display backslashes correctly >__>
<sys64738> `TEST_123` TEST\_123
<sys64738> ok good
<clever> f_: all kinds of fun things to iron out!
<f_> clever: It's a matrix issue, not really a bridge issue
<clever> ah
<f_> matrix messages get sent as markdown...thus eats the bashslash :)
<f_> I could have it send in plain text if you wish..but again, tomorrow :)
<f_> sys64738: and also, the bridge is setup to send one message every 2 sec, might change that as well.
* f_ afk...
<clever> sys64738: let me add some more examples, commit what i have, and then i can ask you for details on how to make it not as fugly, lol
<sys64738> what exactly do you want me to look at?
<sys64738> the python script? the latex file? the latex build system?
<clever> sys64738: bits of all, how would i avoid putting latex into the python? how would i make it more pretty?
<sys64738> jinja templating maybe??
<sys64738> usually my python scripts are this ugly
<clever> what about a latex function, that has the template for each chunk?
<clever> and then i can just call that, and pass in a list of strings
<sys64738> that's pain
<clever> and then the bulk of the code is in the .tex file
<sys64738> i mean, sure, if you want to do that
<sys64738> but i wouldnt
<clever> more wanting to avoid the mess of \\\\ in the python
f_[xmpp] has joined ##raspberrypi-internals
<clever> i'll have a look....
f_[xmpp] has quit [Ping timeout: 260 seconds]