stlink-org / stlink

Open source STM32 MCU programming toolset
BSD 3-Clause "New" or "Revised" License
4.4k stars 1.24k forks source link

unknown chip id! 0xe0042000 #64

Closed linvinus closed 12 years ago

linvinus commented 12 years ago

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.

linvinus commented 12 years ago

after reading this thread https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FBIG%20PROBLEM%20WITH%20SPI%20Interface%20in%20STM32%20completly%20disaster%20of%20ST&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=2514

i change my code to this int main(void) {

AFIO->MAPR |= AFIO_MAPR_SPI1_REMAP; AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE;

and now it working without start up delay.