<maribu[m]>
Regarding the flash driver for the QN908x MCUs (https://review.openocd.org/c/openocd/+/5584/): I just installed a fresh build with that patch applied to the current master, and verify_image there fails while it does work in the branch I'm developing the flash driver. So please don't merge that right now, I'd like to have this working robust first.
marcusmae has joined #openocd
<maribu[m]>
Flashing does work fine in both versions. There are some things that I cannot explain in the behavior, though.
<PaulFertser>
maribu[m]: hey
<PaulFertser>
maribu[m]: comments like that should better be added to Gerrit, you can put your -1 along the way.
<PaulFertser>
maribu[m]: thank you for working on that driver!
<PaulFertser>
maribu[m]: CI says it doesn't compile anyway, so don't worry, it can't be merged :)
<maribu[m]>
Oh, man. That build failure just found I pretty serious bug :)
<maribu[m]>
One question: I get a `Warn : no flash bank found for address 0x20000000` warning after rebasing on `master`. This makes sense, as this is where SRAM is located. However, the TCL script uses `$TARGETNAME configure -work-area-phys 0x04000000 -work-area-size $WORKAREASIZE`. According to the data sheet 0x04000000 is the "canonical" address where the SRAM is mapped, but 0x20000000 is an euqally valid alias region for the SRAM. (Note: It is not a
<maribu[m]>
bit-banding alias, but it really works just the same.)
<maribu[m]>
So, I kind of have to expect that ELF files may use either SRAM address range, as both are equally valid. Is there a way to configure that correctly in TCL?
<PaulFertser>
maribu[m]: your elf file should not have any sections with load address 0x20000000 I think?
<PaulFertser>
maribu[m]: it looks like somehow your LD script puts something in the elf that makes OpenOCD think that 0x20000000 needs to be flashed too.
<PaulFertser>
(my terminology might be off but I hope you get the idea)
<maribu[m]>
Could be. So -work-area-phys mismatching the SRAM address range the firmware uses (which, given that there are two equally valid areas is a 50:50 chance) is not the issue here?
<maribu[m]>
[ 5] .stack NOBITS 20000000 005000 000200 00 WA 0 0 1 is one of the segments in question, the others have the same flags.
<maribu[m]>
Let me double check if I don't get the warning when flashing STM32 boards as well, and it is a systematic issues in RIOT's linker scripts.
<PaulFertser>
maribu[m]: yeah, OpenOCD doesn't care about how ELF is going to use RAM at all. work-area can be configured to use any place in it.
<PaulFertser>
maribu[m]: if certain section should be in RAM during the run time in the ld script it should be specified like this: .data : AT (_flash_data) (that is, AT keyword should be used to set the flash location for it)
<PaulFertser>
maribu[m]: OpenOCD only uses PT_LOAD segments for flashing.
<maribu[m]>
The current git version of OpenOCD won't flash the ELF files for STM32 boards as well. I will investigate what the issue is.
<maribu[m]>
That looks fine, nothing in the SRAM region is marked as LOAD
<PaulFertser>
maribu[m]: probably 047b1a8fc237af480e3bab66a9827a358afd7547 is related, there were no other changes to src/target/image.c lately.
<PaulFertser>
Might have been tested only for loading ELFs to RAM.
<PaulFertser>
Looks like it might indeed affect flashing.
<PaulFertser>
Yep. If reverting it fixes everything you just add a comment there on Gerrit and Antonio and the original author will do the right thing to revert or to fix it.
<PaulFertser>
maribu[m]: sorry about that. Regressions happen, any progress would be impossible otherwise.
<maribu[m]>
No problem. My initial assumption was that the regression is actually due to a bug in my code not triggered so far.
<PaulFertser>
maribu[m]: easy to check by reverting that commit
<PaulFertser>
maribu[m]: or by converting to .hex file and flashing and verifying that instead.
nerozero has quit [Ping timeout: 276 seconds]
nerozero has joined #openocd
slobodan_ has joined #openocd
<maribu[m]>
Indeed, with the revert it works all as expected :) (Except for the bug the CI found; but that was easy to fix.)
Deneb has joined #openocd
<Deneb>
is there an irc channel that deals specifically with baremetal? I would like to find a definitive answer on whether there is a way to determine whether a device implements SWDv1 vs SWDv2 and whether SWDv2 is backward compatiblwe with SWDv1?
wingsorc has quit [Ping timeout: 240 seconds]
<PaulFertser>
Deneb: hi
<PaulFertser>
Deneb: if you have multi-drop SWD in mind, then yes, they're all compatible. Of course a non-multi drop device can't share a bus with any other.
<PaulFertser>
Deneb: I think if the vendor doesn't state SWD DPv2 in the datasheet then you can't count on it being available.
<Deneb>
PaulFertser: thanks. That makes sense.
<PaulFertser>
Deneb: or were you asking about debug adapters, not targets?
<Deneb>
PaulFertser: but you have also clarified the point with mixing v1 and v2 devices on the same bus. Haven't done anything with multidrop yet, but did wonder about that.
<Deneb>
PaulFertser: asking about targets.
<PaulFertser>
Because for adapters if it's not a high-level then OpenOCD will support multidrop on old adapters too.