Stlink: stm32f4-discovery - unknown chip id! 0xe0042000

Created on 1 Sep 2012  ·  27Comments  ·  Source: stlink-org/stlink

Hi, i have a problem similar as #issue 64, but with a STM32F4-DISCOVERY.

st-flash write build/ch.bin 0x8000000

2012-09-01T18:33:59 INFO src/stlink-usb.c: -- exit_dfu_mode
2012-09-01T18:33:59 INFO src/stlink-common.c: Loading device parameters....
2012-09-01T18:33:59 WARN src/stlink-common.c: unknown chip id! 0xe0042000
stlink_sram_flash() == -1

Any hints?

bufixed componenst-flash errounknown-chipid staturesolved targestm32f4

Most helpful comment

What worked for me was:

  1. Short the BOOT0 pin with VDD
  2. Reset the board
  3. st-flash erase

All 27 comments


Have a look here:

"Connect under Reset" technique in STM-32 ST-LINK Utility brought back my dead mcus.


I have the same problem!

To get back in touch with the chip, I have to boot into Windows and use the STM-32 ST-LINK Utility from ST to erase the flash with "Connect under Reset" enabled in Settings.

I have the same problem but now it comes back with STM-32 ST-LINK Utility on Windows. Thanks!

You can also short the BOOT0 pin with the VDD pin (using a jumper) to select the system memory (DFU bootloader) as the boot mode. Quick and simple.

@perexg That does not work.

@tghosgor works for me...

What worked for me was:

  1. Short the BOOT0 pin with VDD
  2. Reset the board
  3. st-flash erase

Thanks @latsku, that worked perfectly.

@latsku yes, your 3 steps worked for me too. Thanks!

Hi Latsku,

Great buddy, those 3 steps works fine for me ....
Thank you..

@latsku thank you very much for your suggestion! This helped me as well.

Tried all suggestions but still get WARN src/stlink-common.c: unknown chip id! 0xe0042000

Check the below link, that works fine for me.

On Tue, Sep 22, 2015 at 7:24 PM, Nickolay Kondratenko <
[email protected]> wrote:

Tried all suggestions but still get WARN src/stlink-common.c: unknown
chip id! 0xe0042000

Reply to this email directly or view it on GitHub


@ADARSHBU it's a link to the current page

@ Nickolay : Even I faced the same issue at the beginning of my work and
solved it by following the procedure mentioned by Latsku.

_unknown chip id 0xe0042000_
This means either 1) you have bricked the ST-Link bridge chip (U2) somehow

  • you'll need ST's own Windows utilities to fix that, or 2) you are trying
    to flash the Discovery in ST-Link (SWD/JTAG) mode. Replace the CN3 jumper
    if you're using the Discovery board!

Also, follow the instructions in the stlink readme _to the letter.._.
Simply going into GDB and calling "load whatever.elf" didn't work, you need

  1. start st-util
  2. load the elf file in GDB ("gdb fancyblink.elf")
  3. (gdb) load
  4. wait...
  5. (gdb) cont

and your code will start. _Don't *use *run_ instead of _cont_, that doesn't
seem to work either. Unintuitive but there you go.

I would also like to suggest you to check with

  1. Jumper Configuration
  2. Have a look at: #62
  3. Also flash does not work when CPU is in sleep mode

On Wed, Sep 23, 2015 at 2:48 PM, Nickolay Kondratenko <
[email protected]> wrote:

@ADARSHBU it's a link to the current page

Reply to this email directly or view it on GitHub

ADARSH B U Stm32 St-link utility application
2.Target>Settings mode should be Connect Under Reset
3.Full erase chip
it is okey.

@latsku im very new in stlink and boards, so sorry for the dumb question but, what does "1. Short the BOOT0 pin with VDD" really mean?

@polaroi8d Not a dump question at all.
Connect the BOOT0 pin with the VDD pin.

And the electronics slang part. Short comes from short circuit, which is connecting the pins with a wire or similar conductor.

@latsku Okey, thanks for the answer, its woorking :)

So far I have just connected the ST-LINK V2 (with no board connected) and then ran st-util which gave the rc/stlink-common.c: unknown chip id! 0xe0042000 which let me here.

Now is this because there is no board connected?
Or is this about the ST-LINKV2 itself?
Or what is it?

I still have to try the above instructions on how to fix this - but could someone try to explain what the problem actually is? I didn't get it from the above comments yet.

@xor-gate why the close without further explanation?

Because this issue dates back to 2011 and is kept alive by != author. Feel free to reopen a new detailed issue tested against stlink tools currently in master. And latest stlink firmware (2.27).

You are trying to detect a chip id with nothing connected, this is not as the tools are intended.

The comment by @ADARSHBU has proved to be valuable to me; I want to stress the fact that the CN3 pins need to be shorted.

Out of the box, discovery boards come with a jumper on these pins, but one of our boards had somehow lost this jumper and it took a while to notice. When in doubt, look up a few photos of the relevant board and check if the same jumpers are in place on yours!

For people who comes to this issue from Google. If you see an unknown chip id! 0xe0042000 error this most likely means that you connected ST-Link pin SWDIO to the CLK pin of your STM32 board and vise versa (SWCLK on ST-Link to IO pin on the board). Just re-check the connection, it should be SWDIO -> IO and SWCLK -> CLK. This is exactly what happened to me.

@afiskon not sure about the "most likely" but it might be a cause

Thanks @latsku your 3 setup very good

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Arathy760 picture Arathy760  ·  30Comments

xor-gate picture xor-gate  ·  17Comments

yosoufe picture yosoufe  ·  12Comments

ihassin picture ihassin  ·  30Comments

gcohara picture gcohara  ·  5Comments