NishanthMenon changed the topic of #openocd to: this is the place to discuss all things OpenOCD | Logs: https://libera.irclog.whitequark.org/openocd/
emeb has quit [Quit: Leaving.]
Fist0urs has quit [Ping timeout: 268 seconds]
Fist0urs has joined #openocd
Bertl_oO is now known as Bertl_zZ
Steffann has joined #openocd
Steffanx has quit [Read error: Connection reset by peer]
tsal has quit [Ping timeout: 240 seconds]
tsal has joined #openocd
Hawk777 has quit [Ping timeout: 252 seconds]
Hawk777 has joined #openocd
keshav has joined #openocd
nerozero has joined #openocd
<keshav>  Hi karlp, I have multiple STM32 Microcontrollers individually connected in a linear daisy chain. TDI --> TDI1, TDO1 --> TDI2, TDO2--> TDO.
<keshav> I would like to mass flash those microcontrollers in the chain with one Hex file. It would always be STM32 in a chain.
<keshav> If that works, I  will make a PCB which would connect to those multiple Microcontrollers with one connector for the adapter and flash multiple Microcontrollers at a time which would make my work a whole lot easier
<Hawk777> keshav: Does it make sense to construct a config file that uses a TCL loop to define a series of chips, and then defines a TCL proc that contains a loop to flash code to all of them? You could then use a TCL variable to define how many chips there are, which could be set externally by outside tooling. I’m not sure whether you could do that on the command line, but even if not, you could have your external tooling write a tiny conf
<Hawk777> ile that just sets the variable and then includes the main file, and then uses the RPC API to call the function to flash the targets (or even just include a call to that function using -c on the command line).
<keshav> Unfortunately I have been working on OpenOCD only for the past week and I am unsure on how the program works. I have been testing with command line codes with existing Config files and I am able to flash single Microcontrollers through those config files. But regrettably I am starting to learn TCL and how it works.
<keshav> Is there an example cfg file in OpenOCD that could help me understand the loop that you mean?
<Hawk777> Hm, I’m not sure if there are any examples of loops in the shipped config files.
<Hawk777> But TCL is a regular programming language, so there are definitely plenty of options available. There’s some documentation at <http://jim.tcl.tk> that might be useful.
<keshav> Thank you.
keshav has quit [Quit: Client closed]
keshav has joined #openocd
Haohmaru has joined #openocd
Hawk777 has quit [Quit: Leaving.]
keshav has quit [Quit: Client closed]
keshav has joined #openocd
sbach has quit [Read error: Connection reset by peer]
sbach has joined #openocd
wolfshappen has quit [Quit: later]
wolfshappen has joined #openocd
Haohmaru has quit [Ping timeout: 240 seconds]
Haohmaru has joined #openocd
wingsorc has joined #openocd
Bertl_zZ is now known as Bertl
wolfshappen has quit [Ping timeout: 252 seconds]
wolfshappen has joined #openocd
zkrx has quit [Ping timeout: 240 seconds]
<keshav> Hi.
<keshav> Update on the JTAG Olimex STM32 chain flashing.
<keshav> I connected two STM32 CPUs in a daisy chain as mentioned yesterday with TDI --> TDI1, TDO1 --> TDI2, TDO2--> TDO.
<keshav> The command code used is
<keshav> "C:\Program Files\GNU ARM Eclipse\OpenOCD\xpack-openocd-0.11.0-3\bin\openocd.exe"  -f interface\ftdi\olimex-arm-usb-ocd-h.cfg -f target\stm32f3x.cfg -c init -c targets -c "halt" -c "flash  erase_sector 0 0 127" -c "reset halt" -c "flash write_image C:/Users/Buero-1/Desktop/init.hex" -c "verify_image C:/Users/Buero-1/Desktop/init.hex" -c "reset
<keshav> halt" -c shutdown
<keshav> There were no error messages. Two Taps were found. But the last Tap on the chain was flashed. The first one on the chain was not flashed. There was no change in Tap 1. Where could I be doing this wrong? Is there something I am missing in the command code?
<keshav> xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2021-12-07-17:33)
<keshav> Licensed under GNU GPL v2
<keshav> For bug reports, read
<keshav> Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
<keshav> Info : DEPRECATED target event trace-config; use TPIU events {pre,post}-{enable,disable}
<keshav> Info : clock speed 1000 kHz
<keshav> Info : JTAG tap: stm32f3x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd), part: 0xba00, ver: 0x4)
<keshav> Info : JTAG tap: stm32f3x.bs tap/device found: 0x06432041 (mfg: 0x020 (STMicroelectronics), part: 0x6432, ver: 0x0)
<keshav> Info : JTAG tap: auto0.tap tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd), part: 0xba00, ver: 0x4)
<keshav> Info : JTAG tap: auto1.tap tap/device found: 0x06432041 (mfg: 0x020 (STMicroelectronics), part: 0x6432, ver: 0x0)
<keshav> Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -irlen 4 -expected-id 0x4ba00477"
<keshav> Warn : AUTO auto1.tap - use "jtag newtap auto1 tap -irlen 5 -expected-id 0x06432041"
<keshav> Info : stm32f3x.cpu: Cortex-M4 r0p1 processor detected
<keshav> Info : stm32f3x.cpu: target has 6 breakpoints, 4 watchpoints
<keshav> Info : stm32f3x.cpu: external reset detected
<keshav> Info : starting gdb server for stm32f3x.cpu on 3333
<keshav> Info : Listening on port 3333 for gdb connections
<keshav> Info : JTAG tap: auto1.tap tap/device found: 0x06432041 (mfg: 0x020 (STMicroelectronics), part: 0x6432, ver: 0x0)
<keshav> target halted due to debug-request, current mode: Thread
<keshav> xPSR: 0x01000000 pc: 0x080001d4 msp: 0x20008000
<keshav> shutdown command invoked
<keshav> This was the result of the execution
<PaulFertser> keshav: use some pastebin, do not paste to channel!
<PaulFertser> keshav: yes, by default the last target is selected so it gets flashed.
<PaulFertser> keshav: you can select another target with "targets" command.
<keshav> Hi. Sorry about that. Here is the result in Pastebin
<PaulFertser> keshav: so it looks like it does what you're asking it for
<keshav> When I run the targets -c command, it shows only one target and that Target 0 is selected. That should be the last tap in my chain right?
<keshav> TargetName         Type       Endian TapName            State
<keshav> --  ------------------ ---------- ------ ------------------ ------------
<keshav>  0* stm32f3x.cpu       cortex_m   little stm32f3x.cpu       halted
<keshav> Is it showing just one target because both the taps are the same CPUs?
<PaulFertser> keshav: btw, is it olimex on windows 11 or did you install GNU/Linux?
<PaulFertser> Hm, one target, I see you sourced the target config just once, why?
<keshav> It is Olimex on Windows 10. I havent installed Linux yet and I havent tested on Windows 11 so far. I wanted to make this work on Windows 10 so that when this is successful, I will try it on Windows 11.
<PaulFertser> Makes sense
<PaulFertser> keshav: you have one target because you sourced it only once.
<keshav> I am a bit blank on sourcing it twice. I tried it today and the program finds the second one as a command of the first target config.
<keshav> cortex_m reset_config sysresetreq
<keshav> invalid command name "targetstm32f3x.cfg"
<PaulFertser> keshav: show the invocation command line
<keshav> "C:\Program Files\GNU ARM Eclipse\OpenOCD\xpack-openocd-0.11.0-3\bin\openocd.exe"  -f interface\ftdi\olimex-arm-usb-ocd-h.cfg -f target\stm32f3x.cfg -c target\stm32f3x.cfg -c init -c targets -c "halt" -c "flash  erase_sector 0 0 127" -c "reset halt" -c "flash write_image C:/Users/Buero-1/Desktop/init.hex" -c "verify_image
<keshav> C:/Users/Buero-1/Desktop/init.hex" -c "reset halt" -c shutdown
<PaulFertser> keshav: why do you have -c before target there?
<keshav> Should it be -f?
<PaulFertser> keshav: of course. And before that you probably want -c "set CHIPNAME stm32f3x-2"
<keshav> Is it possible to show me in the invocation command line?
<PaulFertser> keshav: please rephrase
<keshav> Could you edit my invocation command line? I tried with -f, but it throws an error  Error: Command/target: stm32f3x.cpu Exists
crabbedhaloablut has quit [Ping timeout: 276 seconds]
loki_val has joined #openocd
<PaulFertser> keshav: yes, it now says you need to add that -c command before -f so that it would be using different CHIPNAME
<keshav> PaulFertser: You mean like this?
<keshav> "C:\Program Files\GNU ARM Eclipse\OpenOCD\xpack-openocd-0.11.0-3\bin\openocd.exe"  -f interface\ftdi\olimex-arm-usb-ocd-h.cfg -f target\stm32f3x.cfg -f "set CHIPNAME stm32f3x-2" -c target\stm32f3x.cfg -c init -c targets -c "halt" -c "flash  erase_sector 0 0 127" -c "reset halt" -c "flash write_image C:/Users/Buero-1/Desktop/init.hex" -c
<keshav> "verify_image C:/Users/Buero-1/Desktop/init.hex" -c "reset halt" -c shutdown
<PaulFertser> keshav: not -f before set, -c
<PaulFertser> keshav: other than that, yes, like that.
<keshav> It throws the error
<keshav> Info : DEPRECATED target event trace-config; use TPIU events {pre,post}-{enable,disable}
<keshav> stm32f3x-2
<keshav> invalid command name "targetstm32f3x.cfg"
<keshav> I think on the second line it prints the name that we provided. But after that, it is unable to find the target cfg as a config data.
<keshav> I ran the invocation command line,
<keshav> "C:\Program Files\GNU ARM Eclipse\OpenOCD\xpack-openocd-0.11.0-3\bin\openocd.exe"  -f interface\ftdi\olimex-arm-usb-ocd-h.cfg -f target\stm32f3x.cfg -c "set CHIPNAME stm32f3x-2" -c target\stm32f3x.cfg -c init -c targets -c "halt" -c "flash  erase_sector 0 0 127" -c "reset halt" -c "flash write_image
<keshav> Z:/Elektronik/GSV13/Fertigung_GSV-13iu/Init/GSV13init_Ver1_6.hex" -c "verify_image Z:/Elektronik/GSV13/Fertigung_GSV-13iu/Init/GSV13init_Ver1_6.hex" -c "reset halt" -c shutdown
<PaulFertser> keshav: -c is for Tcl commands. -f is for files.
<PaulFertser> keshav: first you had -c for the file. Then you changed it to -f so it was correct but then we figured another command was to be added before that, and you added it with -f (which was wrong). Now you changed it to -c (correct) but also for whatever reason changed correct -f for the file to incorrect -c.
<keshav> I understand now. I was a bit stupid and understood that the -c corresponded to the next data in the command.
<keshav> I have altered it again. Thank you.
<keshav> "C:\Program Files\GNU ARM Eclipse\OpenOCD\xpack-openocd-0.11.0-3\bin\openocd.exe" -f interface\ftdi\olimex-arm-usb-ocd-h.cfg -f target\stm32f3x.cfg -c "set CHIPNAME stm32f3x-2" -f target\stm32f3x.cfg -c init -c targets -c "halt" -c "flash  erase_sector 0 0 127" -c "reset halt" -c "flash write_image C:/Users/Buero-1/Desktop/init.hex" -c
<keshav> "verify_image C:/Users/Buero-1/Desktop/init.hex" -c "reset halt" -c shutdown
<keshav> Somehow I got a bit flustered and understood it wrongly. Thank you. Now I will test if it works
<PaulFertser> keshav: that still writes only to one part, you'll need to also add commands to select another target and to flash it too after the first flash verify_image retuns.
<keshav> It works with "target CHIPNAME" right?
<keshav> To select the other target
<PaulFertser> keshav: I think the command is "targets stm32f3x-2" or "targets stm32f3x".
<PaulFertser> I know, sounds confusing
<PaulFertser> keshav: you can experiment interactively with telnet.
<keshav> Thank you so much. I will test it out and update you.
<karlp> it' also wonderful that the CHIPNAME is just a convention, entirely implemented as copypasta inside _most_ of the target tcl file too :)
<bencoh> :)
<bencoh> well, this convention is mentionned in the documentation ... I guess it helps :)
<bencoh> -n
<karlp> where is it in the docs?
<karlp> it's not in tap declaration
<bencoh> "variable naming convention"
<karlp> oh right, that's totally discoverable...
<karlp> the section "Communication Between Config files" which is really "example for multiple target support".... is super easy to find
<bencoh> I kinda feel like one needs to real the whole documentation to get a good grasp of what it can or cant do :)
<bencoh> (apart from trial&error)
<bencoh> to read*
<karlp> yeah, but it's splattered all over the place, even after having readit a few times I could never find it,
<bencoh> I usually search in the (full) pdf, I think it helps
<PaulFertser> When you search in the Info manual you get all the hits too
keshav has quit [Quit: Client closed]
wingsorc__ has joined #openocd
wingsorc__ has quit [Client Quit]
wingsorc has quit [Ping timeout: 265 seconds]
<karlp> I find info cumbersome, so I'm normally using the html. and the single page one loads badly, so I get no useful search :|
<PaulFertser> karlp: do you use GNOME or KDE probably? Their GUI Help apps should be showing Info pages too.
keshav has joined #openocd
keshav has quit [Quit: Client closed]
<karlp> gnome, but I've never had any luck with the built in help app honestly.
<karlp> it's either installed separately, or only handles the packaged versions, or whatever
<karlp> I mean, I can install to prefix=$HOME/.local and the cli does the right thing for unning, but whether man/info do the right thing? I've no idea.
<karlp> and the installed man/info pages I hve don't have any version info so I can't tell either
<PaulFertser> OpenOCD info has version on the first page iirc.
Hawk777 has joined #openocd
Haohmaru has quit []
nerozero has quit [Ping timeout: 240 seconds]
key2 has quit [Read error: Connection reset by peer]
key2 has joined #openocd
tlwoerner_ has joined #openocd
bencoh_ has joined #openocd
tlwoerner has quit [Remote host closed the connection]
bencoh has quit [Ping timeout: 260 seconds]
Steffann is now known as Steffanx
v0|d has joined #openocd
thinkfat has joined #openocd
bencoh_ has joined #openocd
bencoh_ has quit [Changing host]
bencoh_ is now known as bencoh
<karlp> not here, nor at work...
<karlp> I did look...
<PaulFertser> This User's Guide documents release 0.10.0+dev, dated 9 December 2020,
<PaulFertser> of the Open On-Chip Debugger (OpenOCD).
<karlp> hrm, I suspect info on my machine is showing me a man page.
<karlp> the _man_ page doesn't have a verison at least...
<karlp> in fact, it's dated 2009
<PaulFertser> man page didn't receive any love, that's true.
<karlp> well, "info openocd" is showing me the man page of my local custom build at least.
<karlp> I guess configure && make && make install didn't find the right things to build info?
<PaulFertser> it ends up in doc/openocd.info* and then installed in /usr/local/share/info normally
<karlp> yeah, I guess I don't have makeinfo or something, but that's not there.
<karlp> and "info openocd" is apparently falling back to showing me a man page
<PaulFertser> Lack of makeinfo would explain it.
Hawk777 has quit [Quit: Leaving.]
zkrx has joined #openocd