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

st-flash fails on 1st upload (stlink) #685

Closed
zgoda opened this issue Jun 3, 2016 · 4 comments
Closed

st-flash fails on 1st upload (stlink) #685

zgoda opened this issue Jun 3, 2016 · 4 comments
Assignees
Milestone

Comments

@zgoda
Copy link

zgoda commented Jun 3, 2016

Built in st-flash fails to upload firmware when run for 1st time, 2nd consecutive attempt succeeds.

$ pio run -t upload
[Fri Jun  3 17:03:05 2016] Processing disco_f051r8 (upload_protocol: stlink, board: disco_f051r8, framework: mbed, platform: ststm32)
------------------------------------------------------------------------------------------------------------------------
"/home/jazg/.platformio/packages/tool-stlink/st-flash" write .pioenvs/disco_f051r8/firmware.bin 0x08000000
2016-06-03T17:03:05 INFO src/stlink-usb.c: -- exit_dfu_mode
2016-06-03T17:03:05 INFO src/stlink-common.c: Loading device parameters....
2016-06-03T17:03:05 INFO src/stlink-common.c: Device connected is: F0 device, id 0x20006440
2016-06-03T17:03:05 INFO src/stlink-common.c: SRAM size: 0x2000 bytes (8 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 1024 bytes
2016-06-03T17:03:05 INFO src/stlink-common.c: Attempting to write 20208 (0x4ef0) bytes to stm32 address: 134217728 (0x8000000)
2016-06-03T17:03:06 INFO src/stlink-common.c: Finished erasing 20 pages of 1024 (0x400) bytes
2016-06-03T17:03:06 INFO src/stlink-common.c: Starting Flash write for VL/F0/F3 core id
2016-06-03T17:03:06 INFO src/stlink-common.c: Successfully loaded flash loader in sram
2016-06-03T17:03:08 ERROR src/stlink-common.c: flash loader run error
2016-06-03T17:03:08 ERROR src/stlink-common.c: run_flash_loader(0x8000000) failed! == -1
Flash page at addr: 0x08004c00 erased
stlink_fwrite_flash() == -1
scons: *** [upload] Error 255
============================================= [ ERROR ] Took 3.49 seconds =============================================
jazg@JAZG-LENOVO:~/work/stm32_lcd $ pio run -t upload
[Fri Jun  3 17:03:18 2016] Processing disco_f051r8 (upload_protocol: stlink, board: disco_f051r8, framework: mbed, platform: ststm32)
------------------------------------------------------------------------------------------------------------------------
"/home/jazg/.platformio/packages/tool-stlink/st-flash" write .pioenvs/disco_f051r8/firmware.bin 0x08000000
2016-06-03T17:03:18 INFO src/stlink-common.c: Loading device parameters....
2016-06-03T17:03:18 INFO src/stlink-common.c: Device connected is: F0 device, id 0x20006440
2016-06-03T17:03:18 INFO src/stlink-common.c: SRAM size: 0x2000 bytes (8 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 1024 bytes
2016-06-03T17:03:18 INFO src/stlink-common.c: Attempting to write 20208 (0x4ef0) bytes to stm32 address: 134217728 (0x8000000)
2016-06-03T17:03:19 INFO src/stlink-common.c: Finished erasing 20 pages of 1024 (0x400) bytes
2016-06-03T17:03:19 INFO src/stlink-common.c: Starting Flash write for VL/F0/F3 core id
2016-06-03T17:03:19 INFO src/stlink-common.c: Successfully loaded flash loader in sram
Flash page at addr: 0x08004c00 erased
2016-06-03T17:03:20 INFO src/stlink-common.c: Starting verification of write complete
2016-06-03T17:03:20 INFO src/stlink-common.c: Flash written and verified! jolly good!
 19/19 pages written
============================================= [SUCCESS] Took 2.41 seconds =============================================

Standalone st-flash utility does not have this problem.

@ivankravets
Copy link
Member

@valeros Should we update our st-link package?

@valeros
Copy link
Member

valeros commented Jun 17, 2016

Hi @zgoda !
tool-stlink package was updated to 1.2.0 version. Could you please re-test it in your system?
Thanks!

@zgoda
Copy link
Author

zgoda commented Jun 21, 2016

Now it works in CLI, no change in IDE. Package tool-stlink is at version 3 in both environments.

@ivankravets ivankravets added this to the 2.10.4 milestone Jun 21, 2016
@zgoda
Copy link
Author

zgoda commented Jun 21, 2016

Actually it works in IDE as well, had to restart after upgrading tool-stlink. Thank you guys.

ivankravets added a commit that referenced this issue Jul 6, 2016
* develop: (27 commits)
  Update boards list
  Add Arduino M0 as a separate board
  Update history
  Update microchippic32 platform and boards
  Fix PyLint warning
  Keep user changes for ".gitignore" file when re-generate/update project data
  Documented uploading of EEPROM data
  Push 2.11.1.dev1
  Automatically install dependent upload tools // Issue #472
  Split source files to HEADERS and SOURCES when generate project for Qt Creator IDE // Resolve #713
  Improve project generator for CLion IDE
  Fix missing trailing ``\`` for the source files list when generate project for Qt Creator IDE // Resolve #711
  * Fix missed ``--boot`` flag for the firmware uploader for ATSAM3X8E Cortex-M3 MCU based boards (Arduino Due, etc) // Resolve #710
  Initial support for Arduino M0/Tian boards // Issue #472
  Update project template for Qt Creator // Issue #711
  Fix missed --boot flag for sam3x uploader // Issue # 710
  Auto-remove project cache when PlatformIO is upgraded
  Version bump to 2.11.0 (issues #472, #520, #614, #620, #685, #698, #699)
  Update history
  Update espressif platform according to the new framework version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants