-
Notifications
You must be signed in to change notification settings - Fork 132
arguments.c: add --erase-first argument to flash for devices with lockbits set #90
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
arguments.c: add --erase-first argument to flash for devices with lockbits set #90
Conversation
|
My general feeling is that this would be helpful, even for other targets. These changes look good to me. However, I'd like to let this sit for a short amount of time (1~3 weeks) to collect any comments about issues that I may not have considered. I'm particularly interested in other mechanisms that could be used to do the same thing. I just want to be a little careful and intentional about adding arguments that would need to be supported for the future life of this project. Thank you for the contribution :) |
…kbits set ATxmega devices have lockbits efuses, which can be used to limit what flash areas can be read/written. The Atmel DFU bootloader checks the lock bits at SET_CONFIGURATION time, and will reject a program request unless an erase has been sent. SET_CONFIGURATION is unfortunately triggered every time dfu-programmer is run (from dfu_device_init()), so it doesn't work to do: dfu-programmer <device> erase dfu-programmer <device> flash As the lockbits are again read at the start of the flash command. As a workaround, add an --erase-first argument to the flash command to trigger a full erase before flashing. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
f93d6dd to
5d7d90c
Compare
Great!
Sure. I have pondered it a bit, and haven't been able to come up with anything better than this, as we somehow need to do the erase and program without calling
You're welcome, thanks for a nice tool! |
|
Not my tool. I just raised my hand and joined the team. Have been cleaning up a couple things here and there. |
Hi, We're now 3 weeks later. Can this be applied? |
|
@cinderblock thanks! |
ATxmega devices have lockbits efuses, which can be used to limit what flash areas can be read/written. The Atmel DFU bootloader checks the lock bits at
SET_CONFIGURATIONtime, and will reject a program request unless an erase has been sent.SET_CONFIGURATIONis unfortunately triggered every time dfu-programmer is run (fromdfu_device_init()), so it doesn't work to do:As the lockbits are again read at the start of the flash command. As a workaround, add an
--erase-firstargument to the flash command to trigger a full erase before flashing.