ElectricMotorcycleForum.com

  • November 27, 2024, 03:57:14 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Electric Motorcycle Forum is live!

Pages: [1]

Author Topic: Firmware update 2016 SR to 2017 SR firmware level, enabling future DIY updates?  (Read 1204 times)

ZeroPointZero

  • Full Member
  • ***
  • Posts: 102
    • View Profile

Its all in the subject...

What is the difference between the 2017 model year that allows DIY firmware updates via the Zero App, as opposed to the 2016 and older firmware that requires a trip to the dealer??

Logged

Fred

  • Sr. Member
  • ****
  • Posts: 486
    • View Profile

Apparently the microcontroller on the 2017 has more flash memory - enough to store both the current and new firmware. This is needed so that the entire new firmware can be loaded onto the device and verified before it's reprogrammed. Imagine if the Bluetooth connection dropped halfway through.
Logged
Zero SR/F
Ducati Hypermotard 950

BrianTRice@gmail.com

  • Unofficial Zero Manual Editor
  • Hero Member
  • *****
  • Posts: 4014
  • Nerdy Adventurer
    • View Profile
    • Personal site

Fred's understanding matches everything I've heard. Older models firmware is not equipped for it.

I've developed firmware, and being able to hot-switch versions with an atomic file system operation and reboot is a big deal.
Logged
Current: 2020 DSR, 2012 Suzuki V-Strom
Former: 2016 DSR, 2013 DS

ZeroPointZero

  • Full Member
  • ***
  • Posts: 102
    • View Profile

Fred's understanding matches everything I've heard. Older models firmware is not equipped for it.

I've developed firmware, and being able to hot-switch versions with an atomic file system operation and reboot is a big deal.

The Zero app should enable backing up the existing firmware to the phone and flashing the new firmware to the bike, if the <=MY2016 bike doesnt have the measly amount of space required to store a couple firmware configs.  This way if the new firmware is faulty you can re-flash from backup.  Seem doable to me, if the App were better.  For those who cant handle such an operation, they could refer to their dealer.
Logged

BrianTRice@gmail.com

  • Unofficial Zero Manual Editor
  • Hero Member
  • *****
  • Posts: 4014
  • Nerdy Adventurer
    • View Profile
    • Personal site

Fred's understanding matches everything I've heard. Older models firmware is not equipped for it.

I've developed firmware, and being able to hot-switch versions with an atomic file system operation and reboot is a big deal.

The Zero app should enable backing up the existing firmware to the phone and flashing the new firmware to the bike, if the <=MY2016 bike doesnt have the measly amount of space required to store a couple firmware configs.  This way if the new firmware is faulty you can re-flash from backup.  Seem doable to me, if the App were better.  For those who cant handle such an operation, they could refer to their dealer.

That's unfortunately not a reasonable way to implement it; Bluetooth file transfer is very unreliable and this has a great risk of "bricking" the MBB or BMS or anything else requiring an update.

Basically, the base bootloader has to be able to run bluetooth communications, have a default and fallback listening mode, accept the firmware when the existing one is broken, and manage that mode transfer itself. At which point you've implemented something else you need to update.

Compared to serial mode transfer, it's just risky.

Firmware and boards really have to be designed up front to support this in concert.
Logged
Current: 2020 DSR, 2012 Suzuki V-Strom
Former: 2016 DSR, 2013 DS

Doug S

  • Hero Member
  • *****
  • Posts: 1631
    • View Profile

That's unfortunately not a reasonable way to implement it; Bluetooth file transfer is very unreliable and this has a great risk of "bricking" the MBB or BMS or anything else requiring an update.

Agreed. Even for a robust, wired connection, you really need to download the whole image, verify its integrity via 32-bit CRC or something even more rigorous, THEN it's reasonably safe for the device to reprogram itself with the new image. Even if the bootloader doesn't overwrite itself, and is probably still intact, you still probably need at least some degree of functionality in the app to invoke the bootloader again so you can re-try. If the bootloader does "upgrade" itself with a bad image, you're completely out of luck...only a low-level reprogram is going to restore function.

All of which gets much riskier when using any sort of wireless connection. WiFi is very good at correcting bad transmissions because it's designed to transfer data files back and forth, but bluetooth isn't nearly as good....it's designed for microphones, earbuds, that sort of thing, where an occasional bad packet isn't life-threatening. But even with WiFi, errors are far more likely than with a wired connection, so it's even more critical to follow the protocol above....download the WHOLE image, verify the living crap out of it, THEN burn it. Anything else is just asking for trouble.
Logged
There's no better alarm clock than sunlight on asphalt.

Fred

  • Sr. Member
  • ****
  • Posts: 486
    • View Profile

Even if it was possible, there's little business sense in porting a new feature to a previous model. There's not that much to distinguish between the 2016 and 2017 models. Why remove one of them and potentially reduce new bike sales?
Logged
Zero SR/F
Ducati Hypermotard 950

ZeroPointZero

  • Full Member
  • ***
  • Posts: 102
    • View Profile

That's unfortunately not a reasonable way to implement it; Bluetooth file transfer is very unreliable and this has a great risk of "bricking" the MBB or BMS or anything else requiring an update.

Agreed. Even for a robust, wired connection, you really need to download the whole image, verify its integrity via 32-bit CRC or something even more rigorous, THEN it's reasonably safe for the device to reprogram itself with the new image. Even if the bootloader doesn't overwrite itself, and is probably still intact, you still probably need at least some degree of functionality in the app to invoke the bootloader again so you can re-try. If the bootloader does "upgrade" itself with a bad image, you're completely out of luck...only a low-level reprogram is going to restore function.

All of which gets much riskier when using any sort of wireless connection. WiFi is very good at correcting bad transmissions because it's designed to transfer data files back and forth, but bluetooth isn't nearly as good....it's designed for microphones, earbuds, that sort of thing, where an occasional bad packet isn't life-threatening. But even with WiFi, errors are far more likely than with a wired connection, so it's even more critical to follow the protocol above....download the WHOLE image, verify the living crap out of it, THEN burn it. Anything else is just asking for trouble.

So how does the 2017 model accomplish the firmware upgrade via the App, if not using the bluetooth connection?

Logged

Doug S

  • Hero Member
  • *****
  • Posts: 1631
    • View Profile

So how does the 2017 model accomplish the firmware upgrade via the App, if not using the bluetooth connection?

It DOES use the bluetooth connection. The point is, the newer microprocessor used in the 2017 bikes has enough onboard flash RAM to download the new code image while still running the old image, verify the new package is valid and intact, and THEN program it as the new main image. During the process, it has two complete images, the older one that it's currently running, and the new one that it's verifying. If you don't have enough space to hold the two images, you can't do it this way, which is the only really safe way.
Logged
There's no better alarm clock than sunlight on asphalt.

JaimeC

  • Hero Member
  • *****
  • Posts: 1987
    • View Profile
    • Facebook page

The point is, the newer microprocessor used in the 2017 bikes has enough onboard flash RAM to download the new code image while still running the old image, verify the new package is valid and intact, and THEN program it as the new main image. During the process, it has two complete images, the older one that it's currently running, and the new one that it's verifying. If you don't have enough space to hold the two images, you can't do it this way, which is the only really safe way.

I think anyone who has ever flashed a new BIOS on to a PC should be familiar with this process.  If something doesn't go right, your nice, fast PC becomes a big paperweight or doorstop.  This isn't something you want to "shortcut" or "jerry rig."  If Zero is making this available to the consumer one would hope they've worked out every conceivable scenario so we don't end up with an expensive lawn ornament.  However, as former Secretary of Defense Donald Rumsfeld so famously said:

"There are known knowns. These are things we know that we know. There are known unknowns. That is to say, there are things that we know we don't know. But there are also unknown unknowns. There are things we don't know we don't know."
Logged
1999 BMW K1200LT
2019 Yamaha XMAX
2021 Zero SR
Pages: [1]