Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programming via ST-LinkV2 #13

Open
rdpowers opened this issue Apr 7, 2017 · 8 comments
Open

Programming via ST-LinkV2 #13

rdpowers opened this issue Apr 7, 2017 · 8 comments

Comments

@rdpowers
Copy link

rdpowers commented Apr 7, 2017

I was able to flash the bootloader with an STLinkV2, but encountered some issues. I'm exceptionally new to OpenOCD, so it may just be inexperience on my part.

Using OpenOCD and an ST-LinkV2 gives a chip ID error:

Warn : 230 69 hla_interface.c:95 hl_interface_init_target(): UNEXPECTED idcode: 0x0bc11477
Error: 231 69 hla_interface.c:98 hl_interface_init_target(): expected 1 of 1: 0x2ba01477
Debug: 232 69 command.c:628 run_command(): Command failed with error code -4

It seems that the efm32hg309 is not defined and falls through to default (0x2ba01477)
From (tcl/target/efm32.cfg):

if { [info exists CPUTAPID] } {
   set _CPUTAPID $CPUTAPID
} else {
   set _CPUTAPID 0x2ba01477
}

Using a very recent build of OpenOCD

$openocd --version
Open On-Chip Debugger 0.10.0+dev-00096-gf605a23 (2017-04-07-09:10)

Workaround - Q&D Modify openocd/tomu.conf to define CPUTAPID

-source [find interface/raspberrypi-native.cfg]
-transport select swd
+set CPUTAPID 0x0bc11477

Then this works:
openocd -f interface/stlink-v2.cfg -f ./tomu.conf

Some questions, maybe more OpenOCD related than tomu-bootloader related:
Am I building OpenOCD wrong or is the efm32hg309 just not properly supported?
Perhaps you were doing development with one of the Cortex M3 or M4 which has the chip ID of 0x2ba01477?
Or does transport select swd on the RPi config get the ID right while hla_swd transport supported by STLink somehow get it wrong?

@mithro
Copy link
Member

mithro commented Apr 7, 2017

What type of STLink board do you have? Can you attach a picture?

When / Where did you get the board from?

After you make that change does the programming actually work? (IE The board goes into the bootloader fine?)

@rdpowers
Copy link
Author

rdpowers commented Apr 7, 2017

Yes, this ultimately works. I've got the tomu running the blinky example now. I got it off of you at LCA2017.

I'm using some old knock-off ST-LINK-V2 $8 programmer from e-Bay or somewhere. It is running the most recent firmware. It looks something like this.

@mithro
Copy link
Member

mithro commented Jun 27, 2017

@rdpowers Would you mind writing up some documentation on using that board with the tomu?

@rdpowers
Copy link
Author

Sure mate, I'll see what I can do.

@jadeaffenjaeger
Copy link

@mithro I just did more or less the same thing with the ST-Link that comes with STM Discovery Boards. If you're interested, I can document the necessary steps!

@mithro
Copy link
Member

mithro commented Feb 8, 2018 via email

@rdpowers
Copy link
Author

rdpowers commented Feb 8, 2018

Oh, wow. Sorry @mithro , this completely fell off my radar!! If something isn't together in the next week, I'll promise to pick it back up then.

@todbot
Copy link
Contributor

todbot commented Nov 18, 2018

Hi! Here's what I did to use a $8 ST-Link V2 to program Tomu via SWD
https://gist.github.com/todbot/6b8da4bed3545313ae976be6be7ffc40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants