Coder Social home page Coder Social logo

Comments (10)

benlye avatar benlye commented on July 21, 2024 2

I haven't had time to implement the check yet, so I've added a warning (plus a few instructions) to the firmware update page. Hopefully this helps...

updater

from octoprint-firmwareupdater.

Alissonverd avatar Alissonverd commented on July 21, 2024

To reflash the bootloader I use this tutorial: https://learn.sparkfun.com/tutorials/installing-an-arduino-bootloader
and
https://www.arduino.cc/en/Tutorial/ArduinoISP

from octoprint-firmwareupdater.

Alissonverd avatar Alissonverd commented on July 21, 2024

And thank you for this amazing plugin!

from octoprint-firmwareupdater.

Alissonverd avatar Alissonverd commented on July 21, 2024

@benlye
Take a look at this, I do not know if it helps.

Marlin.ino.mega.hex
End of file

:101A6C0065206C696768743A206F6E00436173651A
:101A7C00206C696768743A206F666600646973004D
:101A8C004D313038004D313132004D3431300000A1
:00000001FF

Marlin.ino.with_bootloader.mega.hex
End of file

:10FD0000F999FECF1FBA92BD81BD20BD0FB6F89400
:0EFD1000FA9AF99A0FBE01960895F894FFCF63
:040000033000E000E9
:00000001FF

http://www.microchip.com/forums/m1006173.aspx

Now.. See in file with bootloader then start the bootloader part.. after the last line of file without BL.

in Marlin.ino.with_bootloader.mega.hex

:101A6C0065206C696768743A206F6E00436173651A
:101A7C00206C696768743A206F666600646973004D
:101A8C004D313038004D313132004D3431300000A1 < Last line of file without bootloader
:020000023000CC < ?? Start bootloader code?
:10E000000D9489F10D94B2F10D94B2F10D94B2F129
:10E010000D94B2F10D94B2F10D94B2F10D94B2F1F0
..
..
:10FD0000F999FECF1FBA92BD81BD20BD0FB6F89400
:0EFD1000FA9AF99A0FBE01960895F894FFCF63
:040000033000E000E9
:00000001FF

And test this part of file with bootloader in one hex to text converter:
http://www.unit-conversion.info/texttools/hexadecimal/

:020000023000CC
:10E000000D9489F10D94B2F10D94B2F10D94B2F129
:10E010000D94B2F10D94B2F10D94B2F10D94B2F1F0
:10E020000D94B2F10D94B2F10D94B2F10D94B2F1E0
:10E030000D94B2F10D94B2F10D94B2F10D94B2F1D0
:10E040000D94B2F10D94B2F10D94B2F10D94B2F1C0
:10E050000D94B2F10D94B2F10D94B2F10D94B2F1B0
:10E060000D94B2F10D94B2F10D94B2F10D94B2F1A0
:10E070000D94B2F10D94B2F10D94B2F10D94B2F190
:10E080000D94B2F10D94B2F10D94B2F10D94B2F180
:10E090000D94B2F10D94B2F10D94B2F10D94B2F170
:10E0A0000D94B2F10D94B2F10D94B2F10D94B2F160
:10E0B0000D94B2F10D94B2F10D94B2F10D94B2F150
:10E0C0000D94B2F10D94B2F10D94B2F10D94B2F140
:10E0D0000D94B2F10D94B2F10D94B2F10D94B2F130
:10E0E0000D94B2F141546D656761323536300041AF
:10E0F000726475696E6F206578706C6F72657220DE
:10E1000073746B3530305632206279204D4C530099
:10E11000426F6F746C6F616465723E004875683F52
:10E1200000436F6D70696C6564206F6E203D200048
:10E130004350552054797065202020203D20005FF9
:10E140005F4156525F415243485F5F3D2000415658
:10E1500052204C696243205665723D20004743437C
:10E160002056657273696F6E203D20004350552024
:10E1700049442020202020203D20004C6F7720663D
:10E18000757365202020203D20004869676820665F
:10E190007573652020203D200045787420667573D6
:10E1A00065202020203D20004C6F636B2066757336
:10E1B000652020203D20004D617220203720323024
:10E1C000313300312E362E3800342E332E350056A2
:10E1D00023202020414444522020206F7020636F70
:10E1E00064652020202020696E73747275637469E1
:10E1F0006F6E2061646472202020496E74657272B3

Result Hex to text

���0���
���ATmega2560A����rduino explorer ���stk500V2 by MLS����Bootloader>Huh?R�� Compiled on = H��0CPU Type = ���@AVR_ARCH= AVX��PR LibC Ver= GCC|��` Version = CPU $��pID = Low f=��use = High f_��use = Ext fus���e = Lock fus6��e = Mar 7

from octoprint-firmwareupdater.

Alissonverd avatar Alissonverd commented on July 21, 2024

@benlye
Maybe be it's safe to check file for this two keys:
426F6F746C6F61646572 < Bootloader
41546D65676132353630 < ATmega2560

from octoprint-firmwareupdater.

benlye avatar benlye commented on July 21, 2024

I can see another way to do this, which wouldn't require decoding the hex data...

We know which MCU the user has, and the datasheets tell us the start addresses of the flash bootloader section for each MCU we support, so we can just look for any matching lines.

For example, an Atmega2560 supports 512, 1024, 2048, or 4096 word bootloaders, with 4096 being the default. The start address for each of those is 0x3FC00, 0x3F800, 0x3F000, and 0x3E000, with 0x3E000 being the default.

In the Atmega2560 file with the bootloader we see this line:
:020000023000CC

Which instructs that each subsequent data record should be offset by 0x3000 * 16. So, the following line:
:10E000000D9489F10D94B2F10D94B2F10D94B2F129
is really being written at (0x3000 * 16) + 0xE000, which is 0x3E000, one of the known bootloader start addresses for the Atmega2560.

I'll work on a way to implement this check and throw a warning. It's should be fairly straight-forward.

from octoprint-firmwareupdater.

Alissonverd avatar Alissonverd commented on July 21, 2024

=D
I have basic programming skills. So I can only get ideas and I can not implement them.
Many thanks for your support!

from octoprint-firmwareupdater.

codecvlt avatar codecvlt commented on July 21, 2024

+1 Totally bricked my cr-10s because of this. Ordered an Arduino uno so i can reflash the bootloader. The fun never ends :)

from octoprint-firmwareupdater.

benlye avatar benlye commented on July 21, 2024

I've released v1.0.0 which will warn if 'bootloader' is in the hex file name.

from octoprint-firmwareupdater.

github-actions avatar github-actions commented on July 21, 2024

This issue has been automatically locked because there was no further activity after it was closed. Please open a new issue for any related problems.

from octoprint-firmwareupdater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.