SparkFun Forums 

Where electronics enthusiasts find answers.

Open source ARM Debugger
By jandyman
#195159
Hello,

I've just spent the better part of a day trying to get a simple hello world program working with Eclipse and OpenOCD. The target is a custom STM32l151 board with an external ST-LINK, hardware works perfectly with the IAR tools and has been for months.

I've read many of the chapters in the OpenOCD manual, enough to get a basic understanding of the config files. I've created a custom one based on the STLINK-V2 config file:

source [find interface/stlink-v2.cfg]
transport select hla_swd
set WORKAREASIZE 0x4000
source [find target/stm32lx_stlink.cfg]
reset_config srst_nogate

I seem to be able load my program (though OpenOCD seems to have problems with flash "falls back" to memory writes). However, once I get that far, things just don't seem to work that well. I can't modify chip registers in the registers window, the writes don't take. I get funny messages like this when I try to set the PC in the disassembly window:

Error: address + size wrapped (0xfffffffe, 0x00000004)
Error: address + size wrapped (0xfffffffe, 0x00000004)

Then I'll get "No Debug Context" in the disassembly windows after a branch, and then be unable to see some registers ("Error: Target not available" is the message).

I'm getting the sense that using OpenOCD with the ST-Link isn't such a solid solution? Does the hla transport have anything to do with this? I'm wonding that because I get this at startup:

Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD

What I'm trying to figure out is whether - if I invest the time - I will have a hope of having system that functions solidly. For comparison purposes, on another project, I'm using Eclipse with a Nordic Cortex chip and the J-link HW and SW, and the same development environment works just fine.

So what is it? If this is inherent, then I'll recommend to my client that we move to J-link. If not, then please advise me on what might be wrong about what I'm doing.

Thanks in advance for any help!!

- Andy