texane/stlink — Issue #64: unknown chip id! 0xe0042000
Author: linvinus
Created: 2012-02-25 12:32:58+00:00
State: open

Hello!
May be it is not an issue of st-link, but if I use

AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; /*!<((uint32_t)0x02000000) JTAG-DP Disabled and SW-DP Enabled */

then,next time after power down/up board, st-link do not recognise chip.

./st-util -1
2012-02-25T16:00:42 INFO src/stlink-common.c: Loading device parameters....
2012-02-25T16:00:42 WARN src/stlink-common.c: unknown chip id! 0xe0042000
2012-02-25T16:00:42 INFO src/stlink-sg.c: Successfully opened a stlink v1 debugger
Chip ID is 00000000, Core ID is 00000000.
KARL - should read back as 0x03, not 60 02 00 00
init watchpoints
Listening at *:4242...

I use following code to allowing debug,

int main(void) {

chThdSleepMilliseconds(3000);//allow debug for 3 sec run st-link at this time
AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE;/*!< JTAG-DP Disabled and SW-DP Enabled */
......

./st-util -1
2012-02-25T16:01:11 INFO src/stlink-common.c: Loading device parameters....
2012-02-25T16:01:11 INFO src/stlink-common.c: Device connected is: F1 High-density device, id 0x10016414
2012-02-25T16:01:11 INFO src/stlink-common.c: SRAM size: 0x10000 bytes (64 KiB), Flash: 0x80000 bytes (512 KiB) in pages of 2048 bytes
2012-02-25T16:01:11 INFO src/stlink-sg.c: Successfully opened a stlink v1 debugger
Chip ID is 00000414, Core ID is 1ba01477.
KARL - should read back as 0x03, not 60 02 00 00

my setup:
ubuntu 11.04 x86_64
st-link from git (24.02.2012)
STM32VLDISCOVERY -> SW-DP (only SWDIO, SWCLK, GND)->STM32F103VET6
chibios 2.3.3

hopefully this information save some time for somebody.
(I use internal loader to recovery my board)

Also "unknown chip id " error could perhaps because program hangs before stlink was running.
probably this information should be in readme file.

p.s. sorry for my English.