Skip to content

Tronxy XY2 Pro firmware compilation and installation guide for 2025

License

Notifications You must be signed in to change notification settings

MystyJoy/2025-Tronxy-XY-2-pro-firmware

Repository files navigation

I have the tronxy xy-2 pro, although these instructions should work for any of the tronxy machines. These instructions have been made with the hope of preventing the weeks of tears, toil and trouble that I have been through. Hope it helps.

My Tronxy XY-2 pro would shift in the y-layer as I would print. I tested and checked every mechanical aspect that would cause such an issue, but to no avail. So I assumed that the tronxy stock firmware some how got corrupted (apperently this can 'just happen').

For some reason, tronxy are very cagey about their firmware (despite it all being open source and mostly stolen from marlin!), so the only files they offer are their newest bootloader and firmware that do not work! It's firmware tronxy! Not nuclear launch codes! I installed the bootloader and firmware tronxy was offering without backing up the old bootloader and firmware. DO NOT make that mistake, as although the old firmware did not work, it is still incredibly nerve wracking not having it to fall back onto. I do not recommend removing your bootloader at all, there is no need for. I was folllowing instructions that should never have been made.

I've tried many different firmwares that can be found online for the tronxy, most I struggled to get to compile and those that would compile would not upload to the printer.

The files which I used, and managed to get to work are all from tronxy3d

How to compile

  1. Install vscode, and install platformio plugin in the vscode extension. Do this by clicking on the sie menu option called 'extensions'. Then search for platformIO IDE, install it. (should have a large logo with an ants head)

  2. Download this firmware and unzip it, you will get a firmware folder. Run vscode -> file -> Open Folder, select the firmware folder, open it.

  3. Expand the folder called Marlin (should look like this: >Marlin) and then open the file TronxyMachine.h

  4. Find #define TRONXY_ PROJ (around line 23), change the following project name to PROJ_ XXX (XXX represents your printer model) - Note: The modified project name must be a name defined above the file(TronxyMachine.h). If there is no such name, contact customer service for handling e.g. your model is XY2_PRO:

  1. Launch platformio by clicking on the ant head in the left-hand column.

  2. Attempt to compile the firmware by clicking on Default/Build All. The first compilation may take a long time.

  3. WHEN the firmware fails to compile, if the error message in the terminal is as follows:
    os.makedirs(state_dir)
    File "", line 215, in makedirs
    File "", line 225, in makedirs
    FileNotFoundError: [WinError 3] The system cannot find the path specified: 'E:\' Drive_location_error
    Open the platformio.ini file and for (around line 15): core_dir =E:/.platformio Change 'E' to 'C', or whatever letter is used for your drive. Drive_file_location drive_fix

  4. With that changed, attempt to compile again, this time it will take longer than last as packages install themselves. Don't worry if a majority of them fail, wait for the program to finish.

  5. If you get an error message that looks like the following: Loop_Issue With your cursor, hover over the last link given in the terminal. It will be on the last yellow line that starts with 'file:', hold ctrl and click on it. This will open marlin.py (or you can locate the file manually) loop_location Locate the highlighted section. User eoyilmaz solved this issue by replaceing the loop sequence highlighted above to:

def replace_define(field, value):
    found_define = None
    for define in env['CPPDEFINES']:
	    if define[0] == field:
		    found_define = define
		    break
    if found_define:
	    env['CPPDEFINES'].remove(found_define)
    env['CPPDEFINES'].append((field, value))


You can comment out the old function, and add the new code beneath it. It should look like: loop_fixed

  1. Compile again and await the next error message.
    The next message should be: Handler_error This is because the IRQHandler has been defined in two different places. Hold ctrl and click the link which will open the interrupt.cpp file.
    Go to the line indicated e.g. line 349 for EXTI2, it will be different if the error message calls a different function (e.g. for EXTI1 on line 339) so make sure you make the change for the correct block of code. It will most likely be EXTI2 that is defined in multiple places, but do check. IQR-location

Comment out the block of code using //

IQR_CODE_FIXED

  1. Compile again and you shall recieve an error message saying elf-message


the solution to this can be found here. Ignore the comments saying not to use this solution, as it does work and it does not disable your ability to use the sd card slot to update firmware multiple times, as I have uploaded firmware multiple times using the sd card slot since making this change. IQR_fix


As directed, open ini\stm32f4.ini and comment out (using #) or delete line 659 like this: IQR_Code_Fix


Next do the same thing for ini\stm32f1.ini, commenting out line 476 like this: IQR-2-code-fix

  1. Once again, compile the firmware.

    14.The firmware should now be successfully compiled, if not - go to end of document success

Uploading firmware

  1. As stated before: elf_solution
    open the firmware file on your computer, click on '.pio', then 'build', then 'tronxy_stm32f446', then copy the file labelled 'firmware.bin' and paste it into the folder called 'update'
  2. Inside the update folder, delete the file named fmw_tronxy.bin, and then rename firmware.bin to fmw_tronxy.bin (I do not know how necessary this step is, but I did it anyways)
  3. Copy the 'update' folder into the root directory of the SD card, insert the card into the printer, restart, and the machine will automatically update the firmware. After that, the machine will run the current firmware.

Firmware still not compiling?

As a last attempt, open the firmware folder on your computer, and delete the folder named, '.pio'
Then try to compile the firmware again in VScode. The .pio folder is automatically generated when the code compiles.
If successful, go onto the "Uploading firmware" section of this document.

If you are unsuccessful, goodluck.