Skip to content

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