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,

leerz

Well-Known Member
Member
Joined
Jan 11, 2015
Messages
754
Trophies
0
Age
36
Location
Makati
Website
leerz25.sitesled.com
XP
2,184
Country
please help
I followed the instructions and flashed successfully. but when re-installing the oled, only the white light is on at startup, then off, then the oled boots into ofw. does anyone have the full .bin file of v0.1.0 for hwfly lite? I will try to flash again
whitelite shows when no nand is detected (at least on original sx firmware), could be similar, usually red if dat0 can't be detected,. please do correct me but that's from experience.
 
  • Like
Reactions: mocthulang

Mena

Well-Known Member
OP
Member
Joined
Oct 5, 2020
Messages
148
Trophies
0
Age
29
XP
1,032
Country
United States
please help
I followed the instructions and flashed successfully. but when re-installing the oled, only the white light is on at startup, then off, then the oled boots into ofw. does anyone have the full .bin file of v0.1.0 for hwfly lite? I will try to flash again
DM me. I know what issue you’re having
 

mattyv

Member
Newcomer
Joined
May 28, 2009
Messages
20
Trophies
1
XP
1,427
Country
United States
I have this new OLED specific chip installed and can confirm it has Spacecraft 2.0 on it. No USB debug port on this chip for 'easily' flashing firmware.
My OLED chip was just delivered today and is the same revision (without USB). Do you have install instructions for this revision? I can only find instructions for the OLED chip with the USB port
 

mocthulang

Member
Newcomer
Joined
Jan 21, 2022
Messages
13
Trophies
0
Age
42
XP
100
Country
Vietnam
DM me. I know what issue you’re having
IMG_1945.JPG
 

JaRocker

Well-Known Member
Member
Joined
May 3, 2018
Messages
341
Trophies
0
XP
1,486
Country
Jamaica

4.7kΩ ±1% 0.05W 0201​

47kΩ ±1% 0.05W 0201​

iPhone to chip but I don't know which one of these I should get.
RC Series 0201 0.05 W 4.7 kOhm ±1% ±200 ppm/°C SMT Thick Film Chip Resistor

AC Series 0201 4.7 kΩ ±1% 0.05 W ±200 ppm/°C Thick Film Chip Resistor
 

sean222

Well-Known Member
Newcomer
Joined
Sep 7, 2007
Messages
92
Trophies
1
XP
777
Country
Canada
My OLED chip was just delivered today and is the same revision (without USB). Do you have install instructions for this revision? I can only find instructions for the OLED chip with the USB port

Sorry, no instructions. I just went by pictures from the community.
 

Mena

Well-Known Member
OP
Member
Joined
Oct 5, 2020
Messages
148
Trophies
0
Age
29
XP
1,032
Country
United States
There is a lot of variances. This is becoming messier and messier by the day in terms of differences between chips, FPGAs, code in firmware, etc.
 
  • Like
Reactions: leerz

mattyv

Member
Newcomer
Joined
May 28, 2009
Messages
20
Trophies
1
XP
1,427
Country
United States
Sorry, no instructions. I just went by pictures from the community.
NP. Found your pics here that helped. Thanks
I plan on trying to tackle it this weekend. Question....did you cut the one qsb toward the top for a reason? It looks like gnd and 3.3v can be pulled from that same ribbon. Was wondering if you pulled those 2 points from elsewhere for a reason. Did you just have those wires already connected from a prior install?
 

kylum

Well-Known Member
Member
Joined
Dec 8, 2008
Messages
394
Trophies
1
XP
1,481
Country
United States
There is a lot of variances. This is becoming messier and messier by the day in terms of differences between chips, FPGAs, code in firmware, etc.
Sounds like a nightmare. At this point we are probably seeing clones of clones. Thanks for your hard work!

I do have a few questions for you if you don't mind indulging in my curiosity!

Does the OLED chip support flashing using the firmware.bin on the SD? Are you going to implement that if not when you release? This could help in the future

How to update firmware w/o taking it apart
  • If you have flashed Spacecraft-NX, you could update the firmware and built-in payload(sdloader) by putting firmware.bin in the root of your SD card.
  • To reflash/downgrade the firmware regardless of firmware version, create a file called .force_update. (Windows users might find it hard to create dot files, just grab one in the repo.)
  • Some might stuck with green LED at boot. Unfortunately, the only resolution is to connect the chip with micro-USB debug port and reset it via serial interface.

I really like the mod @kazushiMe did. Will you be merging that with your release?
Spacecraft-NX-MOD

  • Boot to OFW by holding down VOL + (works with/without SD card)
    • Usage: Hold down VOL +, then press POWER. Release VOL + when modchip LED turns off or the logo shows up.
 
Last edited by kylum,
  • Like
Reactions: lufeig

Mena

Well-Known Member
OP
Member
Joined
Oct 5, 2020
Messages
148
Trophies
0
Age
29
XP
1,032
Country
United States
Sounds like a nightmare. At this point we are probably seeing clones of clones. Thanks for your hard work!

I do have a few questions for you if you don't mind indulging in my curiosity!

Does the OLED chip support flashing using the firmware.bin on the SD? Are you going to implement that if not when you release? This could help in the future



I really like the mod @kazushiMe did. Will you be merging that with your release?


The Chinese seem to have released an update for the OLED chip with the USB header. I can tell you right now that this update does a couple of things.

1.) It disables debugging completely, if you try and connect to PuTTy you will get an error.
2.) They modified SD Loader so my payload checker will report an unknown payload. I don't know the changes that they've made. It seems like they merged kazushime's update for compatibility into it. Added some text on the bottom right-hand corner. The OLED chip came with 0.2.0 so I wouldn't assume they went back to 0.1.0 for any reason considering all the backlash.

Currently, the state of the RE'ing done on their firmware is:

I have a working build that does a successful glitch, but it crashes sometimes during training. I've gotten it to not crash on my OLED but I had a friend test it and it made their modchip crash. This looks like "infinite glitching" in reality....it's not glitching and the FPGA has hanged/crashed. I need to figure out the differences there before an official open-source release.

TL;DR I need more testers
 

Attachments

  • firmware_r021.zip
    173.1 KB · Views: 63

Mena

Well-Known Member
OP
Member
Joined
Oct 5, 2020
Messages
148
Trophies
0
Age
29
XP
1,032
Country
United States
Does the OLED chip support flashing using the firmware.bin on the SD? Are you going to implement that if not when you release? This could help in the future
Yes. This feature has been in spacecraft since first release. It was just never documented on github. All you need to do is create a file with the name ".force_update" on the root of your SD card and have the firmware.bin there as well. FAT32 formatted of course.
 
  • Like
Reactions: leerz and mattyv

kylum

Well-Known Member
Member
Joined
Dec 8, 2008
Messages
394
Trophies
1
XP
1,481
Country
United States
Yes. This feature has been in spacecraft since first release. It was just never documented on github. All you need to do is create a file with the name ".force_update" on the root of your SD card and have the firmware.bin there as well. FAT32 formatted of course.
Nice, I can test for you! As long as i do not have to flash via a programmer/ SWD. When i get back to the house i will put your firmware from previous post on the SD along with .force_update. My Raspberrypi has HomeAssistant running my my home automation(need to buy another). However, i do have a ST-Link coming on the slow boat.

FYI, my OLED chip does report to "Do use on a Oled" running payloadchecker.

If the "chip crash" occurs. What to do next?
 

Mena

Well-Known Member
OP
Member
Joined
Oct 5, 2020
Messages
148
Trophies
0
Age
29
XP
1,032
Country
United States
Nice, I can test for you! As long as i do not have to flash via a programmer/ SWD. When i get back to the house i will put your firmware from previous post on the SD along with .force_update. My Raspberrypi has HomeAssistant running my my home automation(need to buy another). However, i do have a ST-Link coming on the slow boat.

FYI, my OLED chip does report to "Do use on a Oled" running payloadchecker.

If the "chip crash" occurs. What to do next?
If you still have the USB header to program, you can always program it via that. DM me and we'll test from there. There's a few things I'd need you to capture for me
 
  • Like
Reactions: leerz

mocthulang

Member
Newcomer
Joined
Jan 21, 2022
Messages
13
Trophies
0
Age
42
XP
100
Country
Vietnam
The Chinese seem to have released an update for the OLED chip with the USB header. I can tell you right now that this update does a couple of things.

1.) It disables debugging completely, if you try and connect to PuTTy you will get an error.
2.) They modified SD Loader so my payload checker will report an unknown payload. I don't know the changes that they've made. It seems like they merged kazushime's update for compatibility into it. Added some text on the bottom right-hand corner. The OLED chip came with 0.2.0 so I wouldn't assume they went back to 0.1.0 for any reason considering all the backlash.

Currently, the state of the RE'ing done on their firmware is:

I have a working build that does a successful glitch, but it crashes sometimes during training. I've gotten it to not crash on my OLED but I had a friend test it and it made their modchip crash. This looks like "infinite glitching" in reality....it's not glitching and the FPGA has hanged/crashed. I need to figure out the differences there before an official open-source release.

TL;DR I need more testers
can i try with this file?
 

Mena

Well-Known Member
OP
Member
Joined
Oct 5, 2020
Messages
148
Trophies
0
Age
29
XP
1,032
Country
United States
The Chinese seem to have released an update for the OLED chip with the USB header. I can tell you right now that this update does a couple of things.

1.) It disables debugging completely, if you try and connect to PuTTy you will get an error.
2.) They modified SD Loader so my payload checker will report an unknown payload. I don't know the changes that they've made. It seems like they merged kazushime's update for compatibility into it. Added some text on the bottom right-hand corner. The OLED chip came with 0.2.0 so I wouldn't assume they went back to 0.1.0 for any reason considering all the backlash.

Currently, the state of the RE'ing done on their firmware is:

I have a working build that does a successful glitch, but it crashes sometimes during training. I've gotten it to not crash on my OLED but I had a friend test it and it made their modchip crash. This looks like "infinite glitching" in reality....it's not glitching and the FPGA has hanged/crashed. I need to figure out the differences there before an official open-source release.

TL;DR I need more testers

I've figured out the random crashing thanks to a friend. It's the SD card. You need to train it without an SD card inserted.

can i try with this file?

Sure, but fair warning: If you have issues, you will need to recover.

I suggest you start with firmware only. run the flash.bat inside that folder with the USB plugged in.

Let it train over putty by pressing T. Don't have an SD card inserted while training.

Let me know, thanks.
 

Attachments

  • OLEDUPDATER.zip
    222.8 KB · Views: 52

Dean_

Well-Known Member
Member
Joined
Sep 11, 2014
Messages
684
Trophies
0
XP
712
Country
I've figured out the random crashing thanks to a friend. It's the SD card. You need to train it without an SD card inserted.
Which version is this firmware based on? I guess it's modified from KazushiMe's mod, right?
 

Mena

Well-Known Member
OP
Member
Joined
Oct 5, 2020
Messages
148
Trophies
0
Age
29
XP
1,032
Country
United States
Which version is this firmware based on? I guess it's modified from KazushiMe's mod, right?
The firmware.bin attached above is vanilla spacecraft + the edits to make it work with their FPGA bitstream. The way they do things is different. They sync up with the FPGA, tie it pin 37? I think. There's not much difference. It's not KazushiMe's mod at all though.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • Xdqwerty @ Xdqwerty:
    good night
  • BakerMan @ BakerMan:
    as to you
  • 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
    The Real Jdbye @ The Real Jdbye: never had that i don't think