Recovering from failed flash upgrade

Home Forums TinyG TinyG Support Recovering from failed flash upgrade

Tagged: ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5329
    flux
    Member

    Hello,

    If I flash a self-compiled .hex over USB with AvrDude and it goes somehow wrong, am I able to recover without XMega programmer hardware? Especially if the self-compiled .hex contains my modifications which fail to work properly :). I’m hoping to make use of the I2C bus for controlling things like the VFD controlling my spindle.

    The size of the hex file from my self-compiled version 380.08 (git 7c1ca1f79) is 271229 bytes whereas the original in the tree is 288951 bytes long (program size in my compilation is 96424 bytes and data size is 10669). So while this can be explained by different compilers used, I’m a bit wary of actually flashing this version in :).

    Btw, it was quite easy to compile the firmware under Linux (I understand developers work in Windows?), with just make -C firmware/tinyg/default. I wish I had known this before fixing up the (obsolete?) Makefile under firmware/tinyg/Release :).

    #5330
    cmcgrath5035
    Moderator

    Flux
    I believe Alden and Riley both use Mac/OSX environment for development.
    For sure, Riley’s tgFX work is OSX/Java.

    IIRC, programming the bootloader area requires the XMega to access a protected area, so unless you manage to bork the bootloader recovery would be possible. Search about a bit on Forum for bootloader, or wait for Alden to stop by.

    #5331
    flux
    Member

    Thanks,

    So it seems I cannot accidentally reprogram the bootloader (much like Arduino?) so experimenting should be safe. Thanks :). (The only problem I see is that if I happen to be able to erase the flash but writing the flash wouldn’t work for some reason or another.)

    #5333
    alden
    Member

    Please let us know if you run into any difficulties. Be aware that the boot loader we are using is a separate program located here:
    https://github.com/synthetos/tg-xboot

    If you use the boot loader to program you will not overwrite it. However, if you program the chip directly using an AVRISP mkII programmer it is possible to overwrite the boot loader if you are not careful (or you actually intend to do it).

    TinyG is currently developed under AVR Studio4 and Atmel Studio6.1 – both in a Windows VM. I just moved the VM from XP to W7. The main reason for using Atmel/Windows is a nice integrated simulation and debugging offered in the native Atmel tools. In spite of the Windows requirement. I run the VMs on OSX, but have not tried Mavericks yet. We have other developers using Xcode with GCC on mac, but no one (to my knowledge) in Linux before you tried it.

    If you are so inclined you could add the Linux toolchain notes as a page on the wiki. We’ll link it into the developer’s notes somewhere.

    • This reply was modified 10 years, 7 months ago by alden.
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.