stacksmashing / tamarin-firmware

GNU General Public License v3.0
431 stars 51 forks source link

A7/S5L8960 swd only working partially #17

Open VDavid003 opened 11 months ago

VDavid003 commented 11 months ago

Not sure if this issue belongs here or the bonobo configs repo, don't have a bonobo cable to test this with. I'm using an iPhone 5s (N53, iphone6,2) and it seems like jtag/swd debugging only works partially.

If I connect openocd with the unmodified s5l8960x config, the phone instantly shows the apple logo and starts booting up. I figured out that if I remove the 2nd core from the config, leaving only the first in place, openocd kind of works. I can read memory, step inside assembly but breakpoints and watchpoints seem to be just broken. Setting a breakpoint "works" but they never get hit, seems like they are just ignored. Setting a watchpoint (awatch) makes stepping or continuing not work returning this:

(gdb) si
Warning:
Could not insert hardware watchpoint 1.
Could not insert hardware breakpoints:
You may have requested too many hardware breakpoints/watchpoints.

Command aborted.

Anyone else experiencing these problems on A7? Would be great if breakpoints/watchpoints worked along with the 2nd core.

chris-pcguy commented 5 months ago

Already had that issue with A9 and the bonobo cable. Make the "dbgwrap"-variable use uint32_t and the write that uses the "dbgwrap"-variable use a sizeof uint32_t instead uint64_t. That fixed it for me on both cables.

nezza commented 5 months ago

Super interesting, thanks @chris-pcguy - I don't have a device to test with unfrotunately but would love to add a patch for this