NishanthMenon changed the topic of #openocd to: this is the place to discuss all things OpenOCD | Logs: https://libera.irclog.whitequark.org/openocd/
nerozero has joined #openocd
nerozero has quit [Read error: Connection reset by peer]
nerozero has joined #openocd
JakeSays_ has joined #openocd
JakeSays has quit [Ping timeout: 264 seconds]
nerozero has quit [Ping timeout: 255 seconds]
nerozero has joined #openocd
hosk has joined #openocd
philflieger has joined #openocd
<philflieger> hello
<philflieger> I have trouble to connect to my ST-Link (V2) with openocd. Maybe someone can help me?
philflieger has quit [Quit: Client closed]
<karlp> well, not if they don't say anything and leave.... :|
Haohmaru has joined #openocd
wingsorc has quit [Ping timeout: 252 seconds]
merethan_ has joined #openocd
renrelkha has quit [Quit: bye]
renrelkha has joined #openocd
<Haohmaru> "mon reset halt" - does this take into account something from gdb or from the .elf being loaded? or it simply just resets the chip?
<PaulFertser> Haohmaru: everything you do with "mon" goes behind gdb's back.
<PaulFertser> Haohmaru: on "reset halt" OpenOCD uses vector catch to stop at reset exception handler and then resets the target.
<Haohmaru> x_x
<Haohmaru> i'm making a bootloader for cortex M4, and when it should jump to the firmware - sh*t freezes.. so i ran gdb-multiarch with "tui" and loaded the firmware.elf, when i power on - i know the bootloader works, if i pause i see in gdb a low address so this looks okay.. when the bootloader jumps to the firmware - sh*t f*cks up, then if i break i see the HardFault handler in the firmware
<Haohmaru> thing is, in this situation, when i do "mon reset halt" and then "continue" - it doesn't start my bootloader
<Haohmaru> i keep seeing that hardfault handler
<Haohmaru> so the only way to get thru the bootloader again is to power OFF and that's highly inconvenient
<Haohmaru> ...afaik
<karlp> I would suspect yoru actual problem is you enabled irqs in the bootloader that your app isn't handling, or isn't handling in time.
<Haohmaru> the bootloader was made by... copying an already working "standalone" firmware for this board, and then changing stuff to make it into a bootloader
<Haohmaru> so yes, i removed a ton of the firmware things, but it surely uses interrupts, usarts, and some other crap
<Haohmaru> however, i made it so that the jumping to firmware happens in the very beginning of main() before i initialize the usarts even
<Haohmaru> ehm, more like.. the bootloader checks for a "magic" value in RAM, only then it can jump to the firmware, otherwise it continues forward and initializes a pile of things... so when i tell it to run the firmware - it "configures" this "magic" and does a NVIC_SoftReset(), then the top of main() has the checks and does the jumping
<Haohmaru> at least this was the plan..
<Haohmaru> so before the jump to firmware, in main() i only touch some settings related to brown-out detection, and i use a CRC32 and a SHA hash peripheral
<Haohmaru> the SHA code is from $vendor, the rest is mine..
<Haohmaru> afaik the SHA uses DMA stuff, i don't even call the $vendor init() at the top of main()
<Haohmaru> bluh
<Haohmaru> can openocd do a reset via the RESET pin?
<Haohmaru> i can't get the chip to re-start running from the bootloader once i get it into this frozen state
<Haohmaru> i can't even find an __enable_irq() in my code, yet interrupts work o_O
<Haohmaru> wtf is going on
<Haohmaru> are they ON by default or something?
<Mis012[m]> ok, so apparently if I define both the cpu AND the mem_ap, then I can run dap info?
<Mis012[m]> dap info 0 results in the familiar infinite loop
<Mis012[m]> but...
dliviu has quit [Ping timeout: 255 seconds]
dliviu has joined #openocd
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #openocd
<Haohmaru> holy sh*t, the firmware started o_O
nerozero has quit [Ping timeout: 255 seconds]
<Haohmaru> karlp you're right, my firmware was being ran and it was getting stuck after it prints a ton of sh*t to UART and the FIFO runs out of space and starts blocking wait
<Haohmaru> added __disable_irq() right before any switch between BL<->FW, and __enable_irq() early in main() for both
<Haohmaru> but it seems the interrupts must be enabled by default on the chip or i don't know wtf was going on
Haohmaru has quit []
<Mis012[m]> PaulFertser: I managed to examine the RPM (which is not the boot core fwiw), but I get this if I try to connect with gdb (telnet to :4444 works fine)
<Mis012[m]> (gdb) target extended-remote :3333
<Mis012[m]> Remote connection closed
<Mis012[m]> Remote debugging using :3333
<Mis012[m]> oh, I see
<Mis012[m]> the RPM is at :3334
merethan__ has joined #openocd
merethan_ has quit [Read error: Connection reset by peer]
merethan__ has quit [Remote host closed the connection]
merethan__ has joined #openocd
<PaulFertser> Mis012[m]: awesome progress
<Mis012[m]> does gcc's x command use instruction stuffing?
<Mis012[m]> it doesn't seem to behave nicer than the MEM-AP
<PaulFertser> You mean GDB? You can do "set debug remote 1" in gdb and see what exactly it sends, the protocol is documented in GDB Info under "Serial protocol" chapter.
<Mis012[m]> yes, gdb
<Mis012[m]> how do I still mistype it as gcc
merethan__ has quit [Ping timeout: 246 seconds]
<Mis012[m]> fwiw it seems that again I can access the addresses on that AHB bus where the DAP stuff is
wingsorc has joined #openocd
<Mis012[m]> Info : 191 301 cortex_m.c:912 cortex_m_poll(): [chip.rpm] external reset detected
<Mis012[m]> PaulFertser: does this mean SRST is somehow being pulled down?
<Mis012[m]> should be high unless there's something suspicious going on with the singal while on the PCB
<Mis012[m]> but swd signals work fine
<Mis012[m]> well, I guess that CPU shouldn't be running on boot
<Mis012[m]> and there is a reset signal for it... that I can't access afaict :/
ianstcdns has joined #openocd
shibboleth has joined #openocd
shibboleth has quit [Remote host closed the connection]
shibboleth has joined #openocd
shibboleth has quit [Remote host closed the connection]
shibboleth has joined #openocd
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #openocd
shibboleth has quit [Quit: shibboleth]