-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Semi-OT] Get Megawin MCU into bootloader mode? #173
Comments
Hi, |
Hi, thanks. According to the datasheet, there is a bootloader section (see page 192ff) which handles USB. Unfortunately, even though in theory not possible, this section got erased on my accucell. Therefore, pressing the key combo won't do any good. You'd really have to have one of their in-circuit programmers to flash app code and bootloader again and those things are like 70 EUR + shipping. The whole charger costs way less.
While I don't know how this could have happened (no power loss, and in theory, boot loader section is write protected from user app space), you apparently can brick it with no chance of recovery. |
Supplemental :) The bootloader code probably is still in there. But the only way to execute code from ISP flash section is through application code. If that got erased, the MCU will not enter ISP flash section and never execute the bootloader code. Crap by design ^^, so in case something goes wrong during flash, afaik that's it. |
Supplemental: I asked MegaWin about the issue and they responded with an undocumented way on putting the MCU into an HID USB mode in order to flash a firmware file ("DFU mode").
after a while, the progress should be indicated as text in the text box bottom left. hope that this helps someone some time in the future... |
Hey, amazing ! Did you do it ? Do that works like they say ? I'd like modify and compile a firmware and try on mine. But for sure, won't work first time => crash and need hardware way of reflash. Do you know that there is MOSI and MISO pins (pin 2 & 3) ? That the way they flash atmega with a cheap device. Anyone have an occasion to try ? Jief |
No, I have a MegaWin exactly like yours. But there is the same pins MOSI & MISO as on Atmega. So maybe it can also be programmed with the same device. |
I don't think so. Their ISP uses !RESET, OCD_SCL and OCD_SDA signals. I'm fairly certain that they did not build the same ISP protocol as Atmel into their devices, moreover since this is intellectual property of Atmel (or MicroChip now). |
I've download the datasheet from their website : http://www.megawin.com.tw/zh-cn/support/downloadDocument/119/381 |
|
|
I bricked a SkyRC iMax B6 mini a year ago while upgrading the firmware. Wonder if I can resurrect it if I manage to put it in bootloader mode!? That small charger was pretty handy... |
Let me know, I'm interested !! |
Didn't work :-( |
Were you able to put it into bootloader mode? What failed? |
No, nothing happened. No HID device detected by my Linux laptop. When I power on the charger, the first row of the LCD is filled by black squares, the second row is empty. Nothing more, nothing less. Don't know how badly it is bricked. The PCB is not the same as on the picture above but the pins look exactly the same. Any idea? |
Maybe not the same order. The reset might not be the middle one ? |
You could try the other pin, I may have mixed the two OCD_* descriptions. But still:
Again: does not work for AVR MCUs, only for MegaWin MCU. |
No, nothing. That damn thing doesn't react to anything... I tried many combinations (even GND/+5V by mistake) but nothing. |
well, to quote a very popular TV show character:
|
You have to pull reset short to +5v then it works. After this you can use every Firmware tool (DFU) |
I can confirm: Shortly connect !Reset (inverted!) to +5V while holding GND to OCD_SCA to enter USB bootloader. I had to do it on a Turnigy Accucell 6 50W 6A LiHV, that does not work with the provided cheali firmware for the older Atmel Non-LiHV version. The ISP pins of the LiHV version are at the bottom side of the board, not at top side where the LCD is connected. Unscrew the board and you'll find 5 solder holes in a row with two marked as + (5V) and - (GND). !Reset is next to + and OCD_SCA is the last hole in the row when starting with GND from left to right. |
I can share that i followed this process... on my MegaWin CPU... i was able to get into DFU mode. |
Greetings, perhaps someone can help me here. I wanted to update an accucell 6 80W with firmware 1.2 to 1.3, but something went wrong and it froze mit update. It comes with a built-in USB interface and has the MegaWin MG84FG516 MCU.
According to the english datasheet, there are three sections in Flash:
Since the ISP section cannot be overwritten by itself, it seems that this thing just does not enter the bootloader correctly anymore. Is there a chance to get it into bootloader mode without the use of the ISP flash tool (50 EUR, can buy 2 new chargers for that)?
Thanks
The text was updated successfully, but these errors were encountered: