<[itchyjunk]>
Hi I have a noob question. What exactly is openocd? I am browsing through the website and i am not quite sure
<urja>
it's used to communicate with microcontrollers/processors/stuff with an On-Chip Debug interface (JTAG/SWD/etc)
<urja>
(or well, directly with the JTAG (or other) hardware adapter)
<urja>
and usually gdb then talks to openocd to do the actual debug session
<[itchyjunk]>
hmm, i was wanting to do a "hello world" in riscv and the tutorial installs all sorts of stuff including OpenOCD. but i am not sure if i need it right away. (currently having to `make` qemu for riscv)
rue_shop2 has quit [Ping timeout: 250 seconds]
tsal has quit [Ping timeout: 268 seconds]
tsal has joined #openocd
boru` has joined #openocd
boru has quit [Killed (NickServ (GHOST command used by boru`))]
boru` is now known as boru
thinkfat_ has joined #openocd
thinkfat has quit [Ping timeout: 265 seconds]
[itchyjunk] has quit [Quit: Leaving]
Hawk777 has joined #openocd
cp- has joined #openocd
nerozero has joined #openocd
zjason` is now known as zjason
Hawk777 has quit [Quit: Leaving.]
thinkfat has joined #openocd
thinkfat_ has quit [Ping timeout: 268 seconds]
thinkfat has quit [Ping timeout: 265 seconds]
thinkfat has joined #openocd
<antto>
"Keil.STM32L4xx_DFP.2.6.1/Keil.STM32L4xx_DFP.2.6.1/Drivers/STM32L4xx_HAL_Driver/Inc/stm32l496xx.h" is this a legit device header?
<antto>
because all timers in it are defined as TIM_TypeDef, which is a single structure, yet in the reference manual, from first look, it seems there are really N different variants of timers
[itchyjunk] has joined #openocd
<antto>
[itchyjunk], openocd normally sits between your hardware debugger device and GDB
<[itchyjunk]>
ah, i see
<[itchyjunk]>
I am in over my head with all of this ^^
<antto>
so it goes like this: [IDE/UI for GDB] > GDB > openocd > hardware debugger > target MCU
<[itchyjunk]>
Hadware debugger is something that would come with the hardware?
<antto>
no
<antto>
it's a dev tool
<[itchyjunk]>
ah. so many layers of abstractions going on
<antto>
some debuggers are uber expensive, others are cheap, and there are DIY/opensource ones which can be cheap
<antto>
there are also cheap PRO ones but may be locked to certain vendor only
<[itchyjunk]>
ahhh
<antto>
have you used GDB to debug a normal "computer program" ?
<[itchyjunk]>
I have not. I'm having to learn some java and i've used the debugger in eclipse for it but that's my only experience
<antto>
not sure about that, afaik java is a virtual machine thing so things would be simpler there
<[itchyjunk]>
ah
<[itchyjunk]>
so someone made an open source chip debugger? nice of them
<[itchyjunk]>
Trying to learn about stuff close to the hardware has made me realize it's all actual magic
<antto>
well, there are different kinds of MCUs with a bunch of different debugging interfaces and thus you get a whole pile of hardware debuggers
<[itchyjunk]>
ah
<antto>
JTAG is a popular interface
<[itchyjunk]>
So i would imagine regular programmers would not be using such things much, would they?
<antto>
regular programmers?
<[itchyjunk]>
hmmm like someone coding in some language X
<antto>
you mean folks who write "computer programs" ?
<[itchyjunk]>
yes
<antto>
yeah, they won't
<antto>
they would use GDB at worst ;P~
<antto>
or remote GDB
<[itchyjunk]>
I have heard about "formal proofs" being used at hardware level. like coq or agda type proof assistant thing. do you happen to know anything about that?
<[itchyjunk]>
Curious if that stuff is somehow related to debuggers like this in some way
<antto>
https://i.imgur.com/vVDARTA.jpg here's a hardware device with an MCU, attached to it is a cheap debugger (stuffed in a ziplock bag), connected via USB, and then openocd deals with it, while also creating a GDB-server, and then actual GDB is connected to that server, and to the IDE
<antto>
i think this would fall more into the IC/processor designers, not so much the normal devs using their chips
<[itchyjunk]>
i.. didn't realize you connected a actual physical thing :o
<[itchyjunk]>
i was picturing softwares only..
<antto>
we here are supposed to be normal devs, using fancy chips to make LEDs blink, and sometimes they don't blink properly so we gotta find out why and that's where debugging comes
<antto>
the hardware debugger is a physical device
<[itchyjunk]>
is there a reason to put it in a bag?
<antto>
the actual MCU is that square black thing in the middle of the board
<antto>
yes, it's a bare PCB with metal everywhere, if it touches something that conducts it may happen to make a short-circuit and something might fry
<antto>
i said it's cheap, it comes with no case.. it's bare
<[itchyjunk]>
ah! wow this is the true hardware level stuff. that's cool
<[itchyjunk]>
what would the whole thing be called ? mcu + the board. single board computer?
<antto>
no
<antto>
it's just an.. electronic device, i'd say
<antto>
"single board computer" is used for things which you can run an OS on
<[itchyjunk]>
ah
<antto>
the device in the picture doesn't run an OS at all, it's what's called "bare metal" programming
<[itchyjunk]>
arduino would be electronic device but raspberry pi would be a single board computer?
<antto>
yes, arduino isn't a SBC
<antto>
it's bare-metal normally
<antto>
raspberry pi is an SBC and normally you'd run linux on it
<[itchyjunk]>
would these types of debugging also be done for FPGAs? I was really interested in what FPGAs were at some point
<antto>
not sure
<antto>
afaik you can make an FPGA do almost anything
<[itchyjunk]>
ah
<antto>
from blinking an LED to emulating a CPU which then runs <some program>
<antto>
not sure what you're gonna be debugging on an FPGA.. you design how the gates (or however they are called) will be connected using some fancy software, then the result from that is typically flashed onto a memory near the FPGA chip, then when you power it up - something takes that data and configures all those gates as the data says, and then boom - your "design" is now running
<[itchyjunk]>
so its like a real life virtual machine
<antto>
if it's not running how it should - you should probably look at the fancy software where you put the "program" together, not the physical chip
<antto>
i don't know, but i wouldn't call it that
<antto>
its name is perhaps very accurate "field programmable gate array"
<antto>
that means you have a chip containing an array (many.. so many) logic gates, which can be configured what operation to do, and what to be connected to, and this whole configuration can be programmed "in the field" (aka in the last moment, if you will)
<[itchyjunk]>
hmm so everything that's not connected isn't used and sounds wasted
<antto>
yes
<antto>
just like how you can have a $500 GPU in your computer which isn't used unless you play games or dig coins
<antto>
it's fine
<[itchyjunk]>
ah true
<antto>
the unused gates in an FPGA would be turned off, to not waste power
<[itchyjunk]>
that would make sense
<antto>
the point is, with the same fpga chip you could blink an LED or emulate a whole pic18f or emulate a whole atmega16, or design your own MCU and emulate it, by just changing the "configuration" data
<antto>
(assuming that fpga chip is big enough for those jobs)
<antto>
but i shouldn't talk so much about things i'm unfamiliar with
<antto>
i don't think openocd has much to do with actual FPGAs
<antto>
it's more about CPUs and MCUs
<karlp>
this gerrit "credentials expired" popup is dumb as hell.
<karlp>
you have NO OPTION other than to refresh credentials
<karlp>
someone thought they were very clever. they were so wrong.
<PaulFertser>
In my experience Gerrit project accepts patches
<karlp>
theres zero chance of me chasing that sortr of behavioru change upstream, let alone patching a web app
<PaulFertser>
:)
<karlp>
whatever happened to everythign just working but you can't submit tthings until you're logged in again,
<karlp>
standard across ~everything
<karlp>
gerrit's just blocking the entire page until you click the corner to refresh, or reload manually.
<karlp>
like someone heard of graceful fallback and decided to just ignore every concept of it.
<PaulFertser>
That sucks :/
<PaulFertser>
I hoped new gerrit is all around better but apparently something about PolyGerrit is not exactly nice.
<karlp>
it's definitely more "modern"
<karlp>
usual blend of improvements and backwrds steps :)
<PaulFertser>
Hm, I guess I should check my patch status.
emeb has joined #openocd
Hawk777 has joined #openocd
[itchyjunk] has quit [Remote host closed the connection]
emeb has quit [Ping timeout: 252 seconds]
emeb has joined #openocd
nerozero has quit [Ping timeout: 268 seconds]
thinkfat has quit [Read error: Connection reset by peer]
thinkfat has joined #openocd
thinkfat has quit [Remote host closed the connection]
thinkfat has joined #openocd
[itchyjunk] has joined #openocd
[_] has joined #openocd
[_] has quit [Remote host closed the connection]
[itchyjunk] has quit [Remote host closed the connection]
[itchyjunk] has joined #openocd
sbach has quit [Read error: Connection reset by peer]