SparkFun Forums 

Where electronics enthusiasts find answers.

Open source ARM Debugger
By joncrave
#169951
I would like to get to the first line of code that is executed in the binary of a smartphone. When I halt within openocd this line has already run. I tried to insert a breakpoint at that line of code and reset the device after configuring reset_config and typing in the command reset or reset init. But then i lose the jtag with the following error: JTAG scan chain interrogation failed:allones
Do u guys know any other way of having openocd stop at the first line? ty
By hsutherl
#170084
The normal command sequence to halt at the reset vector would be reset halt

I guess it depends on the processor architecture as to what the chip actually does once it receives the reset halt command. My experience is limited to arm7TDMI and cortex-m parts. Most stm32 parts will actually halt at the first "line" of crt0.s, but the NXP parts have a bootloader that always runs. I've gone so far as to put a delay loop in crt0.s to allow openocd to get control once the bootloader calls the code in flash.

I don't know if your smartphone SOC has similar issues or if you have the luxury of putting a delay at the start of your code. The more knowledgable guys would surely ask you for processor type, openocd config, and so forth.