Page 1 of 1

OpenOCD and JLINK

Posted: Tue Mar 15, 2016 3:09 am
by whoenig
Hi,

I am trying to get J-LINK (EDU) to work with the various crazyflie firmwares. The trunk of openocd works directly with jlink already. However, I need to specify

Code: Select all

-c "transport select swd"
in the Makefiles in order to get it to work (apart from switching OPENOCD_INTERFACE and OPENOCD_TARGET). For example

Code: Select all

openocd:
	$(OPENOCD) -d2 -f $(OPENOCD_INTERFACE) -f $(OPENOCD_TARGET) -c init -c targets -c "\$$_TARGETNAME configure -rtos auto"
changes to:

Code: Select all

openocd:
	$(OPENOCD) -d2 -f $(OPENOCD_INTERFACE) -c "transport select swd" -f $(OPENOCD_TARGET) -c init -c targets -c "\$$_TARGETNAME configure -rtos auto"
I don't own an STLINKv2. Does the above change work with that as well? If that is the case I would like to create some pull-requests to add it consistently.

Thank you!

Re: OpenOCD and JLINK

Posted: Wed Mar 16, 2016 10:16 am
by marcus
Hi Wolfgang,

Unfortunately the STLINKv2 adapter doesn't seem to support the "swd" transport, only the "hla_swd" transport. So with the added command it doesn't work with the STLINKv2 anymore.

What about adding a variable in the Makefile with custom commandline arguments that's empty by default (maybe changes in the future) and can be overridden in the config.mk with special options for other adapters?

Re: OpenOCD and JLINK

Posted: Thu Mar 17, 2016 2:44 am
by whoenig
Thank you, Marcus! I created two pull-requests for the "important" repositories. If you are fine with the changes, I can do the same thing for the remaining ones as well.

I would also like to add some documentation in the wiki, for two things: a) How to flash from scratch (this was a recent discussion in the forum and I looked quite a bit before I found it), and b) special instruction for J-LINK (there seem to be multiple users around - the question came up frequently).
However, I am not sure where the best place would be for the instruction? So far I found the following pages:
https://wiki.bitcraze.io/projects:crazy ... er_flasher
https://wiki.bitcraze.io/doc:crazyflie: ... e_firmware

Re: OpenOCD and JLINK

Posted: Thu Mar 17, 2016 2:11 pm
by marcus
Thanks! The code is merged.

Yeah, it would be great to document it somewhere. I think the second link looks good, since it has lots of information on how to build (it will require to edit the config.mk).