Flashing blink on windows fails because firmware size is too large #329
-
Hi, I use this command (under windows) to upload the firmware on the board : Here are my source files : main.rs #![no_std]
#![no_main]
extern crate panic_halt;
use arduino_uno::prelude::*;
#[arduino_uno::entry]
fn main() -> ! {
let dp = arduino_uno::Peripherals::take().unwrap();
let mut pins = arduino_uno::Pins::new(dp.PORTB, dp.PORTC, dp.PORTD);
let mut led = pins.d13.into_output(&mut pins.ddr);
loop {
led.set_high().void_unwrap();
arduino_uno::delay_ms(1000);
led.set_low().void_unwrap();
arduino_uno::delay_ms(1000);
}
} cargo.toml [package]
name = "avr-example"
version = "0.1.0"
authors = ["Nexyll <[email protected]>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
# A panic handler is needed. This is a crate with the most basic one.
# The `leonardo-panic` example shows a more elaborate version.
panic-halt = "0.2.0"
[dependencies.arduino-uno]
git = "https://github.com/Rahix/avr-hal"
rev = "0c6cf1675c2724354f1adeaeee69992acd371e80"
feature = ["arduino-nano"]
# Configure the build for minimal size
[profile.dev]
panic = "abort"
lto = true
opt-level = "s"
[profile.release]
panic = "abort"
codegen-units = 1
debug = true
lto = true
opt-level = "s" config.toml [build]
target = "./avr-atmega328p.json"
[target.'cfg(target_arch = "avr")']
runner = "./uno-runner.sh"
[unstable]
build-std = ["core"] |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
Hmm, that seems very wrong ... I see a size of ~500 bytes for the blink examples:
Can you run |
Beta Was this translation helpful? Give feedback.
-
I must have missed something. When i run the
So it seems to be pretty the same as on your side. I use this version of avr-gcc : Maybe It's during the upload with avr-dude that the problem occur?
|
Beta Was this translation helpful? Give feedback.
-
this does not seem right ... We're using the following avrdude invocation in avr-hal/boards/arduino-uno/uno-runner.sh Line 58 in 0c6cf16 I think you might be missing the |
Beta Was this translation helpful? Give feedback.
-
I had deleted this param because I was getting the following error under windows :
Finally, with this command I generated a .hex which then passes into avr-dude and it works
Thanks again for your help ! |
Beta Was this translation helpful? Give feedback.
-
Interesting ... Maybe you have an old version of |
Beta Was this translation helpful? Give feedback.
-
Yeah, i use this version : |
Beta Was this translation helpful? Give feedback.
-
Just wanted to chime in with my own experience. It's because WinAVR is still on version 5.10. I'm using WinAVR because WSL2 does not have serial support at this time. Using @Nexyll's workaround in #91 (comment) worked great. Thank you for finding that! It is worth noting that the last update to WinAVR was in 2010... Definitely not ideal. If anyone has a more up-to-date solution for those looking for |
Beta Was this translation helpful? Give feedback.
-
@bacongobbler the Arduino IDE ships with 6.3-20190619 |
Beta Was this translation helpful? Give feedback.
-
Oh wonderful! Thank you for the pointer @lights0123. For those following along, that can be found via
|
Beta Was this translation helpful? Give feedback.
Just wanted to chime in with my own experience. It's because WinAVR is still on version 5.10. I'm using WinAVR because WSL2 does not have serial support at this time. Using @Nexyll's workaround in #91 (comment) worked great. Thank you for finding that!
It is worth noting that the last update to WinAVR was in 2010... Definitely not ideal. If anyone has a more up-to-date solution for those looking for
avrdude
on Windows... I'm all ears.https://sourceforge.net/projects/winavr/files/