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

STM32F103C8T6: Unknown chip id 0042000 on the 2nd st-flash write #669

Closed
6 tasks done
Tyrn opened this issue Feb 18, 2018 · 6 comments
Closed
6 tasks done

STM32F103C8T6: Unknown chip id 0042000 on the 2nd st-flash write #669

Tyrn opened this issue Feb 18, 2018 · 6 comments

Comments

@Tyrn
Copy link

Tyrn commented Feb 18, 2018

  • Programmer/board type: Stlink/v2
  • Programmer firmware version:
  • Operating system: Linux
  • Stlink tools version and/or git commit hash: stlink 1.4.0
  • Stlink commandline tool name: e.g st-flash
  • Target chip (and optional board): STM32F103C8T6

Sorry, being a newbie I've no idea how to check the programmer hardware version.

The following is pretty self-explanatory: first, the blinkyx uploads and blinks; on an attempt at reuploading it bricks. It looks very much like improper usage of st-flash, yet I failed to google a solution. Or the right manual.

Output:

$ st-flash write blinkyx.bin 0x8000000
st-flash 1.4.0
2018-02-18T15:12:37 INFO src/common.c: Loading device parameters....
2018-02-18T15:12:37 INFO src/common.c: Device connected is: F1 Medium-density device, id 0x20036410
2018-02-18T15:12:37 INFO src/common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 1024 bytes
2018-02-18T15:12:37 INFO src/common.c: Attempting to write 8336 (0x2090) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08002000 erased
2018-02-18T15:12:38 INFO src/common.c: Finished erasing 9 pages of 1024 (0x400) bytes
2018-02-18T15:12:38 INFO src/common.c: Starting Flash write for VL/F0/F3/F1_XL core id
2018-02-18T15:12:38 INFO src/flash_loader.c: Successfully loaded flash loader in sram
  9/9 pages written
2018-02-18T15:12:38 INFO src/common.c: Starting verification of write complete
2018-02-18T15:12:38 INFO src/common.c: Flash written and verified! jolly good!

$ st-flash write blinkyx.bin 0x8000000
st-flash 1.4.0
2018-02-18T15:19:56 INFO src/common.c: Loading device parameters....
2018-02-18T15:19:56 WARN src/common.c: unknown chip id! 0xe0042000

$ st-flash erase
st-flash 1.4.0
2018-02-18T15:20:25 INFO src/common.c: Loading device parameters....
2018-02-18T15:20:25 WARN src/common.c: unknown chip id! 0xe0042000

Thank you,
The stlink project maintainers

@lhoyosm
Copy link

lhoyosm commented Sep 13, 2018

I've got a very similar issue with almost the same conditions, I got instead:

$st-flash --format ihex write out.hex
st-flash 1.5.0
2018-09-12T20:47:17 INFO common.c: Loading device parameters....
2018-09-12T20:47:17 WARN common.c: Invalid flash type, please check device declaration
Unknown memory region

I could fix that by moving the boot0 and boot1 to make it boot from from anywhere else but flash, reset it, and then it will accept the st-flash commands again.
This problem is caused by the SWDIO and SWCLK being configured for other purpose (GPIO, etc) other than Serial Wire configuration or Jtag

On the STM32CubeMx set the SYS->Debug option to "Serial Wire" or Jtag and it should work every time.

Hope this helps!
Luis

@Nightwalker-87 Nightwalker-87 added this to the General milestone Feb 19, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: General, v1.6.1 Feb 21, 2020
@Nightwalker-87 Nightwalker-87 added this to To do in Release v1.6.1 via automation Feb 21, 2020
@Nightwalker-87 Nightwalker-87 self-assigned this Feb 21, 2020
Release v1.6.1 automation moved this from To do to Done Feb 21, 2020
@Nightwalker-87 Nightwalker-87 moved this from Done to Reviewer approved in Release v1.6.1 Mar 16, 2020
@Nightwalker-87 Nightwalker-87 removed this from Reviewer approved in Release v1.6.1 Mar 16, 2020
@Nightwalker-87 Nightwalker-87 added this to To do in Release v1.6.1 via automation Mar 16, 2020
Release v1.6.1 automation moved this from To do to In progress Mar 16, 2020
@Nightwalker-87 Nightwalker-87 changed the title Unknown chip id 0042000 on the 2nd st-flash write flashing: Unknown chip id 0042000 on the 2nd st-flash write Mar 17, 2020
@Nightwalker-87 Nightwalker-87 removed this from In progress in Release v1.6.1 Mar 19, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: v1.6.1, Feedback required Mar 19, 2020
@Nightwalker-87 Nightwalker-87 changed the title flashing: Unknown chip id 0042000 on the 2nd st-flash write STM32F103C8T6: Unknown chip id 0042000 on the 2nd st-flash write Mar 31, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: Device issues, Feedback required, Old issues, Unknown chip id 0042000 Apr 6, 2020
@Nightwalker-87 Nightwalker-87 added this to To do in Release v1.7.0 via automation Jun 3, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: d) Unknown chip id 0042000, v1.6.2 Jun 3, 2020
@Nightwalker-87 Nightwalker-87 self-assigned this Jun 3, 2020
@Nightwalker-87
Copy link
Member

The meaning of the output unknown chip id! 0xe0042000 should be documented, as well as some other error codes.

@Nightwalker-87
Copy link
Member

Duplicate of #568.

@Nightwalker-87 Nightwalker-87 moved this from To do to In progress in Release v1.7.0 Mar 12, 2021
@Nightwalker-87 Nightwalker-87 moved this from In progress to Review in progress in Release v1.7.0 Mar 12, 2021
@Nightwalker-87 Nightwalker-87 moved this from Review in progress to Reviewer approved in Release v1.7.0 Mar 15, 2021
@Nightwalker-87 Nightwalker-87 moved this from Reviewer approved to Review in progress in Release v1.7.0 Mar 20, 2021
@Nightwalker-87 Nightwalker-87 moved this from Review in progress to Reviewer approved in Release v1.7.0 Mar 24, 2021
Release v1.7.0 automation moved this from Reviewer approved to Done Mar 24, 2021
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Mar 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.