Tutorial  Updated

How to flash the HWFLY Clone chips

See below for updates.

IF YOU BREAK YOUR BOOT0 PIN. DO NOT DM ME ASKING FOR HELP. THAT'S IT. YOU BREAK THAT PIN AND YOU CANT FLASH. YOUR CHIP IS STUCK WITH WHATEVER HWFLY PUT ON IT


Pre-requisites:




  • Raspberry Pi Zero W
    • You may use another flasher if you desire.
  • Pinout Diagram
  • Modchip Diagram
  • FULL_CHIP_STOCK.bin
  • Modchip Diagram, find the PA9(TX) and the PA10(RX) pins on your modchip, and do the following:
    • Connect GPIO14(TX) on your Raspberry Pi Zero W to the PA10(RX) pin on your modchip.
    • Connect GPIO15(RX) on your Raspberry Pi Zero W to the PA9(TX) pin on your modchip.

  1. Solder a wire to each of the following pinouts on the Raspberry Pi Zero W:
    • 3.3V
    • Ground
    • GPIO 14 (UART TX)
    • GPIO 15 (UART RX)
  2. Do the following to prepare the modchip:
    1. Lift pin 44 (also known as BOOT0).
    2. You will need a way to power the chip, so you need to find two 3.3v points. It can be on a MOSFET, but it will differ based on the revision of the modchip.
    3. Connect Ground on your Raspberry Pi Zero W to the Ground pin on your modchip.
    4. Check the Modchip Diagram, find the PA9(TX) and the PA10(RX) pins on your modchip, and do the following:
      • Connect GPIO14(TX) on your Raspberry Pi Zero W to the PA10(RX) pin on your modchip.
      • Connect GPIO15(RX) on your Raspberry Pi Zero W to the PA9(TX) pin on your modchip.
  3. Boot your Raspberry Pi Zero W and do the following:
    1. In the terminal, type the following command, and press enter:
      Bash:
      sudo nano /boot/config.txt
    2. Add the following line to the end of the file:
      INI:
      dtoverlay=pi3-miniuart-bt
    3. Press CTRL + X to save and exit the editor.
    4. In the terminal, type the following command, and press enter:
      Bash:
      sudo nano /boot/cmdline.txt
    5. Remove the following line from the file:
      INI:
      console=serial0,115200
    6. Press CTRL + X to save and exit the editor.
    7. Restart your Raspberry Pi with this command
      Bash:
      sudo /sbin/reboot
    8. In the terminal, type the following commands, and press enter after each command:

      Bash:
      git clone https://github.com/Pheeeeenom/stm32flash.git
      cd stm32flash
      sudo make install
  4. Now you will flash the modchip.
    Note: This will remove read protection, and the modchip will wipe itself (that is what we want).
    1. In the terminal, type the following command, and press enter:
      Bash:
      stm32flash -k /dev/serial0
    2. Now to flash Spacecraft-NX Version 0.2.0, type the following, and press enter:
      Bash:
      stm32flash -v -w ./FULL_CHIP_STOCK.bin /dev/serial0
  5. Once you're done flashing your modchip, remove the wiring from the modchip, and restore the 3.3v pin on the modchip to its original position.

Please post pictures of your work here to further the identification of the different board revisions!


UPDATE: So it seems like stitching the spacecraft bootloader and firmware together from the repo causes unstable glitching behaviors. For now, consistent glitching behavior works with this bootload/firmware combo.
This is the original file on the OLED variant chip which has 0.2.0 spacecraft. As for glitching, I'll figure it out, give me some time...unless someone else wants to hop in and reverse the differences.

For now, this at least solves the 0.1.0 HWFLY gen 3 issue. More to come.

UPDATE 2: This is only going to work on some HWFLY chips. Older ones use higher protection than the new revisions that seem to use the QFN FPGA.

UPDATE 3: This should fully work on OLED modchips with the QFN FPGA. https://github.com/Pheeeeenom/firmware
 
Last edited by Mena,

Hackerman_2137

Well-Known Member
Newcomer
Joined
Feb 15, 2017
Messages
48
Trophies
0
XP
1,414
Country
Poland
Hi, i just installed hwfly to my OLED switch. First the console boot up normally, with No sd Message. Ive tested everything, but then i have updated the chip to spacecraft 0.2.0 with the USB port. But suddenly the chip wont start, just the yellow led lights up. Then ive tried update the bootloader but it frezzes during the update. Now the console boots up to HOS, but the chip dont give any sings of life. Is my chip bricked? Ive ST-Link programmer in my work. Will it Help?
 

kylum

Well-Known Member
Member
Joined
Dec 8, 2008
Messages
394
Trophies
1
XP
1,481
Country
United States
Hi, i just installed hwfly to my OLED switch. First the console boot up normally, with No sd Message. Ive tested everything, but then i have updated the chip to spacecraft 0.2.0 with the USB port. But suddenly the chip wont start, just the yellow led lights up. Then ive tried update the bootloader but it frezzes during the update. Now the console boots up to HOS, but the chip dont give any sings of life. Is my chip bricked? Ive ST-Link programmer in my work. Will it Help?
You should not update to vanilla spacecraft 0.2.0, but the China edition from Mena or r021 from Sthetix.

If your USB OLED chip is bricked, you can bring it back to life using the method Sthetix posted on his YouTube channel:

This will help you unbrick the chip since you flashed vanilla spacecraft but you potentially have another issue. On first boot did you get OFW? That’s how I read your post. Or did it actually train and boot CFW because you had an SD card inserted? What was the color of the LED prior to you flashing if it was not successful?
 
Last edited by kylum,
  • Like
Reactions: Donnie-Burger

Hackerman_2137

Well-Known Member
Newcomer
Joined
Feb 15, 2017
Messages
48
Trophies
0
XP
1,414
Country
Poland
This will help you unbrick the chip since you flashed vanilla spacecraft but you potentially have another issue. On first boot did you get OFW? That’s how I read your post. Or did it actually train and boot CFW because you had an SD card inserted? What was the color of the LED prior to you flashing if it was not successful?

When i boot the first time, everything went well. I got the „NO SD” message etc. so it was trained and i was good to go. Buy then, ive updated the chip, After that the chip flashes the yellow led constantly, and the switch boot to hos. So i tried to update the bootloader and now the chip dont turn off. I try flash the chip with the ST Link.

I checked the GD32F350 with the multimeter. When the console is turned off, those two pins are shorted. But after i turn the console, the short is gone. Can someone check this?
 

Attachments

  • l4luW3Uh.jpg
    l4luW3Uh.jpg
    50.6 KB · Views: 68
Last edited by Hackerman_2137,

kylum

Well-Known Member
Member
Joined
Dec 8, 2008
Messages
394
Trophies
1
XP
1,481
Country
United States
When i boot the first time, everything went well. I got the „NO SD” message etc. so it was trained and i was good to go. Buy then, ive updated the chip, After that the chip flashes the yellow led constantly, and the switch boot to hos. So i tried to update the bootloader and now the chip dont turn off. I try flash the chip with the ST Link.

I checked the GD32F350 with the multimeter. When the console is turned off, those two pins are shorted. But after i turn the console, the short is gone. Can someone check this?
Ok, I miss read your post originally. My apologies! All you should have to do is re-flash. USB should still using boot_firm.bin from @sthetix ‘s video above. However to use it you will have to separate the bootloader and firmware into two files to use it through USB. Or flash the whole bin with the ST-link
 

kylum

Well-Known Member
Member
Joined
Dec 8, 2008
Messages
394
Trophies
1
XP
1,481
Country
United States
Last edited by kylum,

urherenow

Well-Known Member
Member
Joined
Mar 8, 2009
Messages
4,786
Trophies
2
Age
48
Location
Japan
XP
3,687
Country
United States
If your USB OLED chip is bricked, you can bring it back to life using the method Sthetix posted on his YouTube channel:
Thank you! I asked about this a while ago. I don't even know if my chip is bricked because I didn't actually install it yet. I'm afraid to because I did something really damn stupid. While waiting for some thermal paste to come in, I decided to flash that 021fw... but I installed the damn usb dongle backwards! I didn't even get that far. Just got the "usb device is malfunctioning" message on Windows. Now, when installing it the correct way, I get a quick flash of I don't know what color, then it turns red and stays there for several seconds before simply turning off. I never get a yellow/amber light and a COM port is never installed.

So now... I wait for a GD-Link OB to come in. That'll probably take a few weeks :(
But I sure hope I didn't fry the chip. Makes me wonder though... why would any connection at all be made with the dongle upside down? The under part of the dongle doesn't have traces, and I don't understand why the pins in the socket would be both on the top and the bottom, or at least, why both the top and the bottom would actually be connected to something. I'm mostly just super mad at myself for not noticing a big bold "UP" on one side of the dongle...
 

lufeig

Well-Known Member
Member
Joined
Oct 22, 2009
Messages
306
Trophies
1
Age
45
Location
São Paulo, Brazil
XP
1,057
Country
Brazil
Thank you! I asked about this a while ago. I don't even know if my chip is bricked because I didn't actually install it yet. I'm afraid to because I did something really damn stupid. While waiting for some thermal paste to come in, I decided to flash that 021fw... but I installed the damn usb dongle backwards! I didn't even get that far. Just got the "usb device is malfunctioning" message on Windows. Now, when installing it the correct way, I get a quick flash of I don't know what color, then it turns red and stays there for several seconds before simply turning off. I never get a yellow/amber light and a COM port is never installed.

So now... I wait for a GD-Link OB to come in. That'll probably take a few weeks :(
But I sure hope I didn't fry the chip. Makes me wonder though... why would any connection at all be made with the dongle upside down? The under part of the dongle doesn't have traces, and I don't understand why the pins in the socket would be both on the top and the bottom, or at least, why both the top and the bottom would actually be connected to something. I'm mostly just super mad at myself for not noticing a big bold "UP" on one side of the dongle...
I think when you asked me, that video from Sthetix wasn’t available yet.

Good luck on unbricking it.
 

urherenow

Well-Known Member
Member
Joined
Mar 8, 2009
Messages
4,786
Trophies
2
Age
48
Location
Japan
XP
3,687
Country
United States
I think when you asked me, that video from Sthetix wasn’t available yet.

Good luck on unbricking it.
Yea... I'm so impatient. I already ordered a gd-link OB from Ali Express, because I couldn't find one on Amazon Japan... but if I shell out 1,400yen, I can have an st-link tomorrow... some reviews say that the firmware needs to be updated on the st-link, so I'd have to dig for that info.

What's really confusing is that I thought you had to choose GD-Link or ST-Link based on what chip your mod was using, otherwise I would have ordered an st-link a few days ago and probably would have modded my OLED by now.
 

Hackerman_2137

Well-Known Member
Newcomer
Joined
Feb 15, 2017
Messages
48
Trophies
0
XP
1,414
Country
Poland
Yea... I'm so impatient. I already ordered a gd-link OB from Ali Express, because I couldn't find one on Amazon Japan... but if I shell out 1,400yen, I can have an st-link tomorrow... some reviews say that the firmware needs to be updated on the st-link, so I'd have to dig for that info.

What's really confusing is that I thought you had to choose GD-Link or ST-Link based on what chip your mod was using, otherwise I would have ordered an st-link a few days ago and probably would have modded my OLED by now.
Do you have any short circuits on the chip, when you put the usb dongle backwards?
 

urherenow

Well-Known Member
Member
Joined
Mar 8, 2009
Messages
4,786
Trophies
2
Age
48
Location
Japan
XP
3,687
Country
United States
Do you have any short circuits on the chip, when you put the usb dongle backwards?
I have no idea and no clue how to test. As I said, I've been afraid to install the thing now. I did plug it in with the reset pads shorted, and got the blue LED like it's supposed to... I'm hoping that's a good sign that I didn't actually fry it. I'll maybe find out 20~44 hours from now, when I try to flash it. I'm not doing an install before I can do that.
 

Hackerman_2137

Well-Known Member
Newcomer
Joined
Feb 15, 2017
Messages
48
Trophies
0
XP
1,414
Country
Poland
I have no idea and no clue how to test. As I said, I've been afraid to install the thing now. I did plug it in with the reset pads shorted, and got the blue LED like it's supposed to... I'm hoping that's a good sign that I didn't actually fry it. I'll maybe find out 20~44 hours from now, when I try to flash it. I'm not doing an install before I can do that.

Afaik there is a zener diode so it should prevent from frying the chip
 

kylum

Well-Known Member
Member
Joined
Dec 8, 2008
Messages
394
Trophies
1
XP
1,481
Country
United States
Thank you! I asked about this a while ago. I don't even know if my chip is bricked because I didn't actually install it yet. I'm afraid to because I did something really damn stupid. While waiting for some thermal paste to come in, I decided to flash that 021fw... but I installed the damn usb dongle backwards! I didn't even get that far. Just got the "usb device is malfunctioning" message on Windows. Now, when installing it the correct way, I get a quick flash of I don't know what color, then it turns red and stays there for several seconds before simply turning off. I never get a yellow/amber light and a COM port is never installed.

So now... I wait for a GD-Link OB to come in. That'll probably take a few weeks :(
But I sure hope I didn't fry the chip. Makes me wonder though... why would any connection at all be made with the dongle upside down? The under part of the dongle doesn't have traces, and I don't understand why the pins in the socket would be both on the top and the bottom, or at least, why both the top and the bottom would actually be connected to something. I'm mostly just super mad at myself for not noticing a big bold "UP" on one side of the dongle...
Have you tried to flash it using another PC. My main pc refuses to connect properly to the chip through USB I’ve tried everything. Tried on my laptop and it works fine!
 

urherenow

Well-Known Member
Member
Joined
Mar 8, 2009
Messages
4,786
Trophies
2
Age
48
Location
Japan
XP
3,687
Country
United States
Have you tried to flash it using another PC. My main pc refuses to connect properly to the chip through USB I’ve tried everything. Tried on my laptop and it works fine!
Yes, I tried on my PC and my laptop. Wonder if I should try connecting it to a ubuntu vm... but I doubt that's easy to even attempt. The chip is dead anyway. Got an ST-LINK V2 today that doesn't seem to work either. Shows Serial Number: D. That's it. "D".
Using standalone upgrader, I get a success message.

Using the upgrader in STM32CubeProgrammer, I have to unplug, plug back in, click "Open in Update mode", then it shows what appears to be a normal STlink ID, and

"Type" <blank>
"Version" unknown
"Update to Firmware" unknown

Then I click on "Open in Update mode" again, and it shows: STM8/STM32 Debugger, and valid info for the other two things.

Then I hit "Upgrade", and I eventually get the message "ST-Link device lost when exiting upgrade mode", and the ID returned to "D".

And while trying to figure that out, I picked at the wires a bit on the v3 chip, to see if anything was shorted (the above was attempted with nothing connected to the ST-Link, by the way) and of course I pulled a damn pad. TMS/SWDLD point, to be exact. So I'm screwed no matter what. I have to give up, bow out, and simply take my V1 Switch with me on my trip next week.

EDIT: But the outdated software STM32 ST-LINK Utility v4.6.0.0 seems to correctly see the ST-Link dongle (with the real serial number). Wonder if I could have flashed with that. I'll have to keep wondering, unless there is another place for me to hook up the SWDLD/TMS line.
 
Last edited by urherenow,

Hackerman_2137

Well-Known Member
Newcomer
Joined
Feb 15, 2017
Messages
48
Trophies
0
XP
1,414
Country
Poland
Yes! However, but try this firmware only first as your bootloader might be intact and or working since your getting a flashing yellow led. The shorted pins I’m not sure about and I’m not able to test at the moment.
https://github.com/Pheeeeenom/firmware/releases/tag/0.2.0.ChinaSDCardCompat
Do you know if you flashed both the bootloader and firmware?
So i unbricked my HWFly, but when i start the console (without an SD Card), the LED is constantly yellow.

Any idea?
 

kylum

Well-Known Member
Member
Joined
Dec 8, 2008
Messages
394
Trophies
1
XP
1,481
Country
United States
Yes, I tried on my PC and my laptop. Wonder if I should try connecting it to a ubuntu vm... but I doubt that's easy to even attempt. The chip is dead anyway. Got an ST-LINK V2 today that doesn't seem to work either. Shows Serial Number: D. That's it. "D".
Using standalone upgrader, I get a success message.

Using the upgrader in STM32CubeProgrammer, I have to unplug, plug back in, click "Open in Update mode", then it shows what appears to be a normal STlink ID, and

"Type" <blank>
"Version" unknown
"Update to Firmware" unknown

Then I click on "Open in Update mode" again, and it shows: STM8/STM32 Debugger, and valid info for the other two things.

Then I hit "Upgrade", and I eventually get the message "ST-Link device lost when exiting upgrade mode", and the ID returned to "D".

And while trying to figure that out, I picked at the wires a bit on the v3 chip, to see if anything was shorted (the above was attempted with nothing connected to the ST-Link, by the way) and of course I pulled a damn pad. TMS/SWDLD point, to be exact. So I'm screwed no matter what. I have to give up, bow out, and simply take my V1 Switch with me on my trip next week.

EDIT: But the outdated software STM32 ST-LINK Utility v4.6.0.0 seems to correctly see the ST-Link dongle (with the real serial number). Wonder if I could have flashed with that. I'll have to keep wondering, unless there is another place for me to hook up the SWDLD/TMS line.
I it took a few tries to get my stlink updated as it isn’t straight forward. However, i think I had to unplug and plug back in for it to work after putting it into update mode. I ant remember honestly. Unfortunate about your chip. Lifting a pad. You could always try to fix the lifted pad with a jumper.

So i unbricked my HWFly, but when i start the console (without an SD Card), the LED is constantly yellow.

Any idea?
What steps did you do exactly with what files and procedure?
 

PamanX

Member
Newcomer
Joined
Jan 12, 2022
Messages
11
Trophies
0
Age
36
XP
98
Country
Mexico
Hi, I want to tell you about a problem I had trying to install the chip to my oled, the multimeter gave me correct values when checking the points, when I finished installing it, the chip led only blinked 4 times and started the console in OFW, I turned the console off and on 3 times and it started the same in direct OFW, on the fourth attempt it turned on a purple screen and it doesn't come out of there, I don't see that there is much information in forums about this failure, only something oriented to damage in the emmc, do you think there is a solution or it will definitely be a brick? thanks for your help
 

Attachments

  • 20220201_201455.jpg
    20220201_201455.jpg
    2.6 MB · Views: 71
  • Like
Reactions: leerz

Hackerman_2137

Well-Known Member
Newcomer
Joined
Feb 15, 2017
Messages
48
Trophies
0
XP
1,414
Country
Poland
Hi, I want to tell you about a problem I had trying to install the chip to my oled, the multimeter gave me correct values when checking the points, when I finished installing it, the chip led only blinked 4 times and started the console in OFW, I turned the console off and on 3 times and it started the same in direct OFW, on the fourth attempt it turned on a purple screen and it doesn't come out of there, I don't see that there is much information in forums about this failure, only something oriented to damage in the emmc, do you think there is a solution or it will definitely be a brick? thanks for your help
Check again the values on the chip. Maybe the D0 point is shorted.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • K3Nv2 @ K3Nv2:
    How do you know if the night will be good when you're asleep
  • BakerMan @ BakerMan:
    because i didn't say i was asleep
  • BakerMan @ BakerMan:
    i said i was sleeping...
  • BakerMan @ BakerMan:
    sleeping with uremum
  • K3Nv2 @ K3Nv2:
    Even my mum slept on that uremum
  • TwoSpikedHands @ TwoSpikedHands:
    yall im torn... ive been hacking away at tales of phantasia GBA (the USA version) and have so many documents of reverse engineering i've done
  • TwoSpikedHands @ TwoSpikedHands:
    I just found out that the EU version is better in literally every way, better sound quality, better lighting, and there's even a patch someone made to make the text look nicer
  • TwoSpikedHands @ TwoSpikedHands:
    Do I restart now using what i've learned on the EU version since it's a better overall experience? or do I continue with the US version since that is what ive been using, and if someone decides to play my hack, it would most likely be that version?
  • Sicklyboy @ Sicklyboy:
    @TwoSpikedHands, I'll preface this with the fact that I know nothing about the game, but, I think it depends on what your goals are. Are you trying to make a definitive version of the game? You may want to refocus your efforts on the EU version then. Or, are you trying to make a better US version? In which case, the only way to make a better US version is to keep on plugging away at that one ;)
  • Sicklyboy @ Sicklyboy:
    I'm not familiar with the technicalities of the differences between the two versions, but I'm wondering if at least some of those differences are things that you could port over to the US version in your patch without having to include copyrighted assets from the EU version
  • TwoSpikedHands @ TwoSpikedHands:
    @Sicklyboy I am wanting to fully change the game and bend it to my will lol. I would like to eventually have the ability to add more characters, enemies, even have a completely different story if i wanted. I already have the ability to change the tilemaps in the US version, so I can basically make my own map and warp to it in game - so I'm pretty far into it!
  • TwoSpikedHands @ TwoSpikedHands:
    I really would like to make a hack that I would enjoy playing, and maybe other people would too. swapping to the EU version would also mean my US friends could not legally play it
  • TwoSpikedHands @ TwoSpikedHands:
    I am definitely considering porting over some of the EU features without using the actual ROM itself, tbh that would probably be the best way to go about it... but i'm sad that the voice acting is so.... not good on the US version. May not be a way around that though
  • TwoSpikedHands @ TwoSpikedHands:
    I appreciate the insight!
  • The Real Jdbye @ The Real Jdbye:
    @TwoSpikedHands just switch, all the knowledge you learned still applies and most of the code and assets should be the same anyway
  • The Real Jdbye @ The Real Jdbye:
    and realistically they wouldn't

    be able to play it legally anyway since they need a ROM and they probably don't have the means to dump it themselves
  • The Real Jdbye @ The Real Jdbye:
    why the shit does the shitbox randomly insert newlines in my messages
  • Veho @ Veho:
    It does that when I edit a post.
  • Veho @ Veho:
    It inserts a newline in a random spot.
  • The Real Jdbye @ The Real Jdbye:
    never had that i don't think
  • Karma177 @ Karma177:
    do y'all think having an sd card that has a write speed of 700kb/s is a bad idea?
    trying to restore emunand rn but it's taking ages... (also when I finished the first time hekate decided to delete all my fucking files :wacko:)
  • The Real Jdbye @ The Real Jdbye:
    @Karma177 that sd card is 100% faulty so yes, its a bad idea
  • The Real Jdbye @ The Real Jdbye:
    even the slowest non-sdhc sd cards are a few MB/s
  • Karma177 @ Karma177:
    @The Real Jdbye it hasn't given me any error trying to write things on it so I don't really think it's faulty (pasted 40/50gb+ folders and no write errors)
    Karma177 @ Karma177: @The Real Jdbye it hasn't given me any error trying to write things on it so I don't really...