Skip to content

Programming via ST-LinkV2 #13

Open
@rdpowers

Description

@rdpowers

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions