Welcome to Our Community

Some features disabled for guests. Register Today.

xPro Bootloader corrupt. How to reflash? Keywords: atmega328pb vs atmega328p, usbtiny, Arduino

Discussion in 'Controller Boards' started by Sabrina Romero, Jul 15, 2019.

  1. Sabrina Romero

    Builder

    Joined:
    Jun 19, 2019
    Messages:
    7
    Likes Received:
    1
    Hello!

    I tried to update the firmware on the cnc xpro controller board without success, but now when I connect it to the usb port, the direction and spindle spd lights are on, besides the one of the +5V that is supposed to be on.
    Before it used to be recognized in openbuilds control, and now it says no supported firmware detected.
    How can I fix this?
     
  2. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,749
    Likes Received:
    4,070
    Sounds like the firmware didnt flash correctly, so Grbl isnt booting up, and thus, the weird LEDs as Grbl isnt controlling them.

    Try flashing again - make sure it says Succesful at the end.

     
    Sabrina Romero likes this.
  3. Sabrina Romero

    Builder

    Joined:
    Jun 19, 2019
    Messages:
    7
    Likes Received:
    1
    I have been trying through Xloader and Arduino and I can't get it to work.
    With Xloader it says uploading but never gets to finish, and with Arduino this is the error that I'm getting:
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x83
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x83
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x83
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x83
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x83
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x83
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x83
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x83
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x83
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x83
    Problem uploading to board. See Arduino - Troubleshooting for suggestions.

    do you have any suggestions?
    Thanks!
     
  4. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,749
    Likes Received:
    4,070
    Flashing firmware can be dangerous, for example if you disconnect before its complete, or other unintended actions.
    The Arduino based boards run a Bootloader in flash memory.
    Some actions (brownouts, flash wear, failed flash operation, etc) can damage the bootloader - its really easy to put back, but you need a couple tools:

    1. Order USBTinyISP off Amazon/ebay/sparkfun etc )$6-25 - cheaper than an Xpro)
    2. Connect the USBTinyISP to the ISP Header on the board
    3. Flash the Bootloader using the Arduino IDE

    On Point 1 above, you can also alternatively try Arduino - ArduinoISP with a spare arduino (I have a USBtiny and it works great, so can't vouch for ArduinoISP - you're on your own there, but may save some time over getting a programmer)

    ATmega328P vs 328PB (Extra B is what you didnt know about and thus broke it)

    One other point specific the the xPro is that it does not use the standard ATmega328P. It uses the ATmega328PB (which Xloader etc does not support - probably where the failed flash originated... Xloader will not flash the "wrong" chip correctly... it will corrupt it) The printing on the chip shows ATmega328PB, and Xloader only has 328P boards in its list. (They are not the same)

    So remember to add ATmega328PB support to Arduino before installing the bootloader, making sure to select the right chip under tools>boards as well: See (for example - first result on google, havent tested this add on myself) Pololu - 4.4. ATmega328PB support in the Arduino IDE
    (or google how to add ATmega328PB support to Arduino)
     
    #4 Peter Van Der Walt, Jul 15, 2019
    Last edited: Jul 15, 2019
    Sabrina Romero likes this.
  5. Sabrina Romero

    Builder

    Joined:
    Jun 19, 2019
    Messages:
    7
    Likes Received:
    1
    Thank you!
    One more question: Is it possible to use an arduino Due to flash the bootloader?
     
  6. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,749
    Likes Received:
    4,070
    I am not sure (google result: ArduinoISP on Arduino DUE), personally, I'd get a programmer - be sure it works / less faffing.

    One issue with Due even if you can find a sketch to turn it into a programmer is that the Due is a 3.3v device, so you'd need to add level shifters to the SPI lines to program the 5v atmega.
     
    #6 Peter Van Der Walt, Jul 16, 2019
    Last edited: Jul 16, 2019
  7. Sabrina Romero

    Builder

    Joined:
    Jun 19, 2019
    Messages:
    7
    Likes Received:
    1
    Hello,
    I added the ATMega328PB support to the arduino, and am using the USBTinyISP to burn the bootloader on the board. However, I keep getting this error:
    Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "ATmega328, Yes (UART1 328PB only), 328PB, BOD 2.7V, LTO disabled, 16 MHz external"
    avrdude: Version 6.3-20171130
    Copyright (c) 2000-2005 Brian Dean, BDMICRO Microcontrollers, Relays, Optocouplers, and IoT
    Copyright (c) 2007-2014 Joerg Wunsch
    System wide configuration file is "C:\Users\Sabrina Romero\Documents\ArduinoData\packages\MiniCore\hardware\avr\2.0.3/avrdude.conf"
    Using Port : usb
    Using Programmer : usbtiny
    avrdude: usbdev_open(): Found USBtinyISP, bus:device: bus-0:\\.\libusb0-0001--0x1781-0x0c9f
    AVR Part : ATmega328PB
    Chip Erase delay : 9000 us
    PAGEL : PD7
    BS2 : PC2
    RESET disposition : dedicated
    RETRY pulse : SCK
    serial program mode : yes
    parallel program mode : yes
    Timeout : 200
    StabDelay : 100
    CmdexeDelay : 25
    SyncLoops : 32
    ByteDelay : 0
    PollIndex : 3
    PollValue : 0x53
    Memory Detail :
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
    eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
    flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
    lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
    hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
    lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
    calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
    signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
    efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
    Programmer Type : USBtiny
    Description : USBtiny simple USB programmer, USBtinyISP - Inexpensive USB AVR Programmer
    avrdude: programmer operation not supported
    avrdude: Using SCK period of 10 usec
    avrdude: AVR device initialized and ready to accept instructions
    Reading | ################################################## | 100% 0.00s
    avrdude: Device signature = 0xffffff (retrying)
    Reading | ################################################## | 100% 0.00s
    avrdude: Device signature = 0xffffff (retrying)
    Error while burning bootloader.
    Reading | ################################################## | 100% 0.00s
    avrdude: Device signature = 0xffffff
    avrdude: Yikes! Invalid device signature.
    Double check connections and try again, or use -F to override
    this check.
    avrdude done. Thank you

    Do you know what could be going wrong?
    Thanks!
     
  8. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,749
    Likes Received:
    4,070
    Its not getting comms to the chip:

    - Not sure if the board is powered off the ISP (any lights on?) if not add USB power to the Board
    - ISCP header plugged in wrong way round?
     
  9. Sabrina Romero

    Builder

    Joined:
    Jun 19, 2019
    Messages:
    7
    Likes Received:
    1
    This is how I have it connected. I don't see what could be going wrong.
    upload_2019-7-29_6-46-9.png
     
  10. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,749
    Likes Received:
    4,070
    At this point, maybe a dead chip?
    What is the history? Why did you reflash initially?

    Only other option henceforth may be to check in with Mike at @Spark Concepts for ideas too
     
  11. Sabrina Romero

    Builder

    Joined:
    Jun 19, 2019
    Messages:
    7
    Likes Received:
    1
    I was trying to update the firmware, which I tried with Xloader but it failed. After that, the board isn't recognized in OPENBUILDSControl, and has those two orange lights next to the 5V one. I have been trying to burn the bootloader as you suggested.
     
    Peter Van Der Walt likes this.
  12. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,749
    Likes Received:
    4,070
    Understood that much from all the posts above. My question relates to Why? Why update in the first place, were you trying to fix something (looking for clues to why the chip maybe died, providing the USBTiny works correctly, hook up correct, correct arduino boards.txt etc, that is one of the options, trying to fill in blanks in the history)
     
  13. Rob702Martinez

    Builder

    Joined:
    Aug 20, 2016
    Messages:
    19
    Likes Received:
    1
    I need serious help, please @Spark Concepts @Peter Van Der Walt @Sabrina Romero

    I've read just about everything I can about flashing the Spark Concepts CNC Xpro V3. I have been running GRBL 0.9j with Universal Gcode Sender 1.0.9 since 2016 when I originally bought everything. I have a Openbuilds C-Beam Machine, NEMA 23 Motors, limit switches, 24v power supply, Dewalt DWP611 and using Fusion360. No issues at all and everything works perfect.

    Last night I decided to upgrade to Universal Gcode Sender 2.0 to take advantage of the new Platform GUI and it's features. I connected to the Xpro (still on GRBL 0.9j) with UGS 2.0 and ran a job. It errored out a few times on sending the code and the job would stop after a few seconds.
    No problem I'll just update the controller to GRBL 1.1h.....

    I found the Spark Concepts website that showed how to do it using Xloader. Found here-- Spark-Concepts/xPRO
    Downloaded the GRBL 1.1h.hex file and sent it to Xloader. It forever stayed on "uploading". Fine, I did some digging and found a user on openbuilds who had the same problem. He solved it by using another computer. Fine, I grabbed my other laptop, downloaded Xloader and the .hex file. Same result.

    Then I find this Spark concepts page about using Audrino IDE to flash the .hex file. Found here-- How to Reflash GRBL to the CNC xPRO
    Also this video to go along with it. found here--
    Fine, download Audrino IDE, download the GRBL File, match it up in the Library, select the instructed settings and options and I got multiple fails similar to above.

    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 1 of 10: not in sync:

    And so on....

    Then I find THIS thread that talks about the Xloader not working because it doesn't support the 328PB. But I have seen other threads where people used Xloader successfully. Ok, fine. This page says to use Audrino IDE and to make it work with Pololu A-Star drivers and functions.
    Fine. I go to this web page-- Pololu A-Star 328PB User’s Guide that explains how to interface IDE with the correct A-Star drivers and such.
    Found here -- Pololu A-Star 328PB User’s Guide
    It says to add “Additional Boards Manager URLs” text box (highlighted in the picture below). Copy and paste the following URL into this box:

    https://files.pololu.com/arduino/package_pololu_index.json

    Ok, fine. I follow through the instructions and install all the A-Star 328PB stuff. Deleted the GRBL IDE library. Re-entered the GRBL Library, followed the steps, connected to the controller at 5v 16mhz, ran the code. Error. I tried 5v 20mhz, 3.3v 8mhz, 3.3v 12mhz and error afteviar error after error. Ive tried about every combination with just the controller hooked up via USB- the green light is on. I've tried with the main power on and the USB. Same Result. Whenever I press Upload I see 3 orange-light blinks and about 1 blink every 10-12 seconds after that until it fails. After hours and hours of trying I give up at this point. I tried pressing the "reset" button on the board and got the 3 quick blinks and the motors jolted for a second. Tried to re-do all of the above and same result.

    I need some help and where to go from here. Just wanted to simply update GRBL and UGS to take advantage of the new features and this is where I end up.
     
  14. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,749
    Likes Received:
    4,070
    Please contact Mike at Spark Concepts. I am sure if you ask he will let you send it in to get reflashed and then sent back.

    Xloader wiped the bootloader so you need to get that put back first (needs an ICSP programmer)
     
  15. Rob702Martinez

    Builder

    Joined:
    Aug 20, 2016
    Messages:
    19
    Likes Received:
    1
    Ok. Why am I seeing people successful at using Xloader given the above info?
     
  16. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,749
    Likes Received:
    4,070
    Some of the older xPro's had the ATmega328p. They flash fine with xLoader
    Ones with ATmega328PB gets corrupted when you use xLoader and select Uno (Atmega328p) in the dropdown. Its actually user error, selecting the wrong chip - but also xLoader should check the signature before doing the flash, but it does sadly not.
     
  17. Rob702Martinez

    Builder

    Joined:
    Aug 20, 2016
    Messages:
    19
    Likes Received:
    1
    Ok. I dont agree with the user error part as there are no instructions or indicators or information, other than this thread, about the chip difference. The github/wiki/sparkconcepts, all the information sources, do not mention anything about it. It should be updated to reflect this information rather than having to learn the hard way and be fustrated.

    How would I know, or anyone else for that matter, know which chip to look at to see if it's a P or PB and then figure out to use IDE, then install all the Pololu driver stuff...and so on... there is no mention of it anywhere.
     
  18. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,749
    Likes Received:
    4,070
    Please, do bring that under thier attention too, we do not have access to edit their documentation: Contact US

    From our side we've done what we can to include a flashing tool with ATmega328PB support right inside OpenBuilds CONTROL:
    flashing.PNG


    (just a shame xloader was 'the bomb' back in the day so its mentioned all over, but it hasnt been updated in several years though! )
    I don't even know where you guys still find it :) Russemotto's websites been down for years (the original author): http://xloader.russemotto.com/
     
  19. Giarc

    Giarc OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Jan 24, 2015
    Messages:
    2,898
    Likes Received:
    1,613
    Recently, I had a problem installing code on an Arduino nano. I got the same error I believe. When I looked there was a selection for "nano 328 old version" or something like that. I selected that and it worked. I never had a problem until I updated the Arduino IDE a few months ago. There are now two selections depending on what nano you have. It might be worth a shot to try.

    It took me a while and much googling to figure it out. At first I thought I had fried the board somehow but it was the same for all of them. That is when I figured out something had cyanged.
     
  20. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,749
    Likes Received:
    4,070
    Wouldn't be his issue (the atmega328p vs 328pb is a oldie of a known issue, and xLoader is the big killer) but FYI, the reason theres an "old nano" entry is because theres a range of "new nanos": See Arduino just unveiled four new powerful and cheap Nano boards | ZDNet - yip I also think its dumb to reuse the name! Thats going to cause so much confusion!
     
  21. Rob702Martinez

    Builder

    Joined:
    Aug 20, 2016
    Messages:
    19
    Likes Received:
    1
    So the controller still connects to UGS both old and new versions and connects to Openbuilds Control. It still shows grbl0.9j and still has all the correct $$ settings and responds to simple commands. I have it disconnected completely from the machine and am just running this with the USB cable.
    I tried Openbuilds grbl flasher thing and it keeps saying failed.
    Any ideas?
    Mike responded Wednesday that it could be sent in but I have not heard back on where to send it and if there is a cost, should I send a shipping label to return it, etc... like most people I'm in a "hurry".
     
  22. Rob702Martinez

    Builder

    Joined:
    Aug 20, 2016
    Messages:
    19
    Likes Received:
    1
    Sending it to Mike for an update! :thumbsup:
     
    Peter Van Der Walt likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice