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

Add option for updating firmware after every reboot #345

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vladtcvs
Copy link

When you connect device to rs485 network, or connect it by 4-pin uart, or may be smth else, you can not send reset signal to go into bootloader mode. Check if (ch != 0) just skips to application.

But with option ALWAYS_USE_BOOTLOADER you can jump to 0x3F00 from your application and start to update firmware.

@WestfW
Copy link
Member

WestfW commented May 22, 2022

You should be able to "jump from the application" and have the bootloader run "always", if you've set MCUSR to zero (before the jump.) that's what the current check for ch!=0 does.

Isn't your "always_use_bootloader" flag backward? if set, you are running the code that decides NOT to run the bootloader.

Jumping to the bootloader start address and having it work is subject to a bunch of requirements like disabling interrupts and making sure certain other peripherals are in their "post-reset" status...

@hecko
Copy link

hecko commented Dec 22, 2022

I think you can mimic this behavior already by combining

-DWDTTIME=8 -DNO_START_APP_ON_POR=1

So you get 8 seconds of bootloader on every start of the uC. That should be plenty to update the application over the bootloader. Or am I missunderstanding either this PR or the NO_START_APP_ON_POR flag? Do you need more than 8 seconds to start a loading process?

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

Successfully merging this pull request may close these issues.

3 participants