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

Flash is not erased when uploading hexfile #3

Closed
ghost opened this issue Jul 14, 2016 · 5 comments
Closed

Flash is not erased when uploading hexfile #3

ghost opened this issue Jul 14, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented Jul 14, 2016

Using the Platformio IDE integrated in Atom, when performing "Upload" the command line output shows that the "-D" flags is used with the avrdude tool.

This disables auto erase for flash. However, it is essential that the flash is erased before uploading new code into it. I am using a bare Atmega48 (no Arduino). I did not find a way to remove this flag anywhere in the platformio config files..

@ivankravets
Copy link
Member

Use program instead upload. See http://docs.platformio.org/en/latest/platforms/atmelavr.html#upload-using-programmer

program is bare target and you can customize it manually using upload_flags.

@ghost
Copy link
Author

ghost commented Jul 14, 2016

Great! Is it possible to have this integrated in the left toolbar? Otherwise I need to select "PlatformIO: Upload using programmer" either via left bottom option or via F7.

@ivankravets
Copy link
Member

Em.... Very interesting question 👍 There are a lot of solutions to do it 😄

How about to create extra_script and override with custom upload command?

See my example here platformio/platformio-core#247 (comment)

@ghost
Copy link
Author

ghost commented Jul 14, 2016

Thanks for the fast reply. Honestly I want to avoid tinkering with scripts. So I will use the available option then.

@ghost ghost closed this as completed Jul 14, 2016
@ivankravets
Copy link
Member

Another option is to use targets. In this case, "Build" button will have "program" behaviour.

For example,

[env:my]
targets = program

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant