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

STM32L051C8: Can't flash on command-line, can flash using GUI #1010

Closed
p-rodrigues opened this issue Jul 31, 2020 · 4 comments
Closed

STM32L051C8: Can't flash on command-line, can flash using GUI #1010

p-rodrigues opened this issue Jul 31, 2020 · 4 comments

Comments

@p-rodrigues
Copy link

Hi,

I've looked in other issues and could not find anything equal to this:

Compiled from source-code and I can upload the code through stlink-gui. When uploading with stlink-gui the code appears to work perfectly fine on the hardware.

However, when using st-flash I get the following error:
$st-flash --opt --freq=4m write file.hex 0x8000000
st-flash 1.6.1-86-gf162a5d
2020-07-31T15:23:16 INFO common.c: L0x3: 8 KiB SRAM, 64 KiB flash in at least 128 byte pages.
file file.hex md5 checksum: 5adcb1cef8433736cf5a8cd8acbfd82, stlink checksum: 0x0061899c
2020-07-31T15:23:16 INFO common.c: Attempting to write 123012 (0x1e084) bytes to stm32 address: 134217728 (0x8000000)
2020-07-31T15:23:16 ERROR common.c: addr too high
stlink_fwrite_flash() == -1

The file I am using is the same on the UI and on command-line. Yes the file is larger than 64kB, however, how can I upload it through the UI and not through the command-line? Am I doing something wrong on the command-line? I have already tried some combinations on the command-line parameters (the one I posted is just the last one I ran).

Info:

  • Programmer/board type: Stlink v2
  • Programmer firmware version: [enter here] (e.g STSW-LINK007 2.27.15)
  • Operating system and version: Ubuntu 18.04 Linux
  • Stlink tools version and/or git commit hash: v1.6.1-86-gf162a5d
  • Stlink commandline tool name: st-flash
  • Target chip (and board if applicable): STM32L051C8
@stappersg
Copy link
Contributor

stappersg commented Jul 31, 2020 via email

@p-rodrigues
Copy link
Author

On Fri, Jul 31, 2020 at 07:27:46AM -0700, p-rodrigues wrote: When uploading with stlink-gui the code appears to work perfectly fine on the hardware. However, when using st-flash I get an error.
Here someone who is new to st-link, I'm with st-link since #1007 ;-) I do read the issue as How to translate a succesfull stlink-gui action into stlink command line action? I don't know, but I want to say
Thank you for sharing that stlink-gui has something, maybe "knowledge", that makes succesfull flashing possible.
Cheers Stappers

I cannot say you are wrong :). It's just that I do not know what else to do.

@Nightwalker-87 Nightwalker-87 added this to the v1.6.2 milestone Jul 31, 2020
@Nightwalker-87 Nightwalker-87 changed the title [STM32L051C8]: Can flash on command-line, can flash using GUI STM32L051C8: Can flash on command-line, can flash using GUI Aug 1, 2020
@p-rodrigues p-rodrigues changed the title STM32L051C8: Can flash on command-line, can flash using GUI STM32L051C8: Can't flash on command-line, can flash using GUI Aug 3, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: v1.6.2, v1.6.3 Mar 23, 2021
@Ant-ON
Copy link
Collaborator

Ant-ON commented Mar 25, 2021

@p-rodrigues Everything works correctly. You forgot to specify the firmware format. The problem is solved by adding --format=ihex

@Nightwalker-87
Copy link
Member

Closed by #1010 (comment).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.