crabbedhaloablut has quit [Read error: Connection reset by peer]
crabbedhaloablut has joined #openocd
nerozero has joined #openocd
zjason` is now known as zjason
bvernoux has joined #openocd
<zapb_>
frankplow, what J-Link probe do you have?
<zapb_>
frankplow, a fatal error in the emulator should not happen
slobodan has joined #openocd
bvernoux has quit [Quit: Leaving]
gzlb has joined #openocd
dinkelhacker has quit [Server closed connection]
dinkelhacker has joined #openocd
<frankplow>
zapb_: It's the J-Link OB firmware running on the nRF5340 interface MCU of the nRF52 DK
<PaulFertser>
frankplow: please use some pastebin to show full -d2 log of an attempt.
<frankplow>
zapb_: Re. the error itself: the GDB server seems completely fine, the only thing which does not work is the SWV. I think it is an emulator fatal error as I get a 1Hz flash on the interface MCU's indicator LED, which the J-Link manual says indicates a fatal error: https://wiki.segger.com/UM08001_J-Link_/_J-Trace_User_Guide. I am not sure if this indicator behaves the same when using OpenOCD rather than the J-Link software?
<PaulFertser>
frankplow: and how do you create and monitor itm.fifo?
<frankplow>
PaulFertser: I've tried mkfifo, touch and letting OpenOCD create the file itself, and have been monitoring with cat or checking the size with ls -l
<PaulFertser>
frankplow: and do you by any chance have an oscilloscope to see if SWO pin has any transmission when you use it with OpenOCD?
<frankplow>
PaulFertser: Not on hand unfortunately, I can try on Monday
<PaulFertser>
frankplow: probably j-link software does some additional init which is supposed to be performed with firmware itself in OpenOCD case and the signal is just not there.
<PaulFertser>
frankplow: or probably nrf config is indeed missing some configuration for pinmuxing the SWO pin or some other enable action. Have you checked with the datasheet?
<PaulFertser>
frankplow: if you have a reasonable UART adapter you should be able to receive that data even without SWD, just by firmware itself setting everything right.
<frankplow>
Yeah, you have to set a register up for pinmuxing, but I've done that and it works with the J-Link software
<frankplow>
PaulFertser: How do I know what frequency I should be trying if it is not negotiated? I suppose I can do this to see if I get any data in lieu of a scope.
<PaulFertser>
E.g. stm32 MCUs have _proc_pre_enable function in OpenOCD configs which are needed for SWO to be used.
<PaulFertser>
frankplow: jlink software might be doing something extra, just like OpenOCD does with stm32 targets.
<PaulFertser>
frankplow: when you do all the TPIU/SWO configuration in firmware you just set the prescaler.
<PaulFertser>
frankplow: btw, are you writing to stimulus port 0?
<PaulFertser>
frankplow: you can try just running that gdb script verbatim who knows, probably it's a bit more tricky than that
<PaulFertser>
I see there's also target-specific NRF_CLOCK there.
<frankplow>
I think I have resolved the issue. Adding `itm port 0 on` seems to have fixed the problem. I did not have this previously as the documentation says "Port 0 is enabled on target creation automatically"
<zapb_>
frankplow, there is only a green LED on the board, right? A flashing green LED usually does not mean a fatal error
<PaulFertser>
Hm, weird, probably that changed.
<PaulFertser>
When I added that code port 0 was enabled by default, but probably it's not the case now.
<PaulFertser>
Guess karlp knows
<frankplow>
zapb_: This is from the J-Link user guide I linked earlier: "GREEN, flashing at 1 Hz: Emulator has a fatal error. This should not normally happen."
<PaulFertser>
frankplow: so did you need any additional code in firmware or mrw commands?
<frankplow>
The pin does not seem to need to be set up as an output, and I'm not sure why orbuculum is fiddling with P0.20 at all
<PaulFertser>
frankplow: hm, so that should be included in openocd config then I guess
<frankplow>
PaulFertser: I'm not sure what the precendent/convention is for OpenOCD and these things --- whether OpenOCD attempts to set up the entire SWV or just the TPIU. I think it would be okay for OpenOCD to not configure this as it is pretty evident from the MCU's datasheet that it must be set to enable SWO. It was the ITM stimulus port documentation that really caught me out.
<frankplow>
PaulFertser: Thanks a lot for all your help
<PaulFertser>
frankplow: sorry about this problem with the docs, somehow it was changed but the docs were forgotten
<PaulFertser>
frankplow: if you check e.g. target/stm32f1x.cfg you see _proc_pre_enable_$_CHIPNAME.tpiu . The current OpenOCD convention is that everything target-specific to get SWO working should be set up automatically.
slobodan has quit [Read error: Connection reset by peer]
slobodan has joined #openocd
frankplow has quit [Server closed connection]
frankplow has joined #openocd
<zapb_>
frankplow, I know but from my experience this does not apply to some on-board J-Link probes
slobodan has quit [Read error: Connection reset by peer]
slobodan has joined #openocd
nerozero has quit [Ping timeout: 244 seconds]
* karlp
reads the scrollback
<karlp>
no idea. I always felt that blindly enabling port 0 was... "magic" and not the good sort, but it was compatible? I've done very little / zero tracing since the entire config were upended, barely enough to get a few fixes in that broke compat.
<karlp>
I would concur though, that openocd configs should set this up as per requested config...
<frankplow>
PaulFertser: No need to apologise --- thank you for the tool!
<frankplow>
Been looking at putting together a patch for setting TRACECONFIG.TRACEMUX as part of a proc_pre_enable, however unfortunately this register does not appear to be common across the entire nRF52 line. I think this means setting this automatically would require splitting the nRF52 series into seperate targets.
<PaulFertser>
frankplow: or probably it can be detected by reading flash id register or something? Tcl is flexible enough.
<frankplow>
PaulFertser: Ok, I will investigate further when I have some time
<PaulFertser>
frankplow: thank you!
<PaulFertser>
karlp: I wonder when it happened so that itm port 0 is no longer enabled automatically.
<PaulFertser>
I guess because it's checking trace_config.itm_deferred_config now.
<PaulFertser>
borneoa___: hey :) can you please take a look at f9509c92dba370be363f5641d3fefe2250bee10c ? Seems like now itm stimulus port 0 is not enabled by default. So either the docs need to be fixed or this deferred init amended.
diddly has quit [Ping timeout: 255 seconds]
diddly has joined #openocd
akaWolf has quit [Server closed connection]
haxar has quit [Server closed connection]
haxar has joined #openocd
crabbedhaloablut has quit []
urja has quit [Read error: Connection reset by peer]
slobodan has quit [Ping timeout: 240 seconds]
urja has joined #openocd
Foxyloxy has quit [Read error: Connection reset by peer]