Skip to content
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

[BUG] Simpler distinct firmware rename omits *.bin* #25960

Closed
1 task
classicrocker883 opened this issue Jun 10, 2023 · 4 comments · Fixed by #25966
Closed
1 task

[BUG] Simpler distinct firmware rename omits *.bin* #25960

classicrocker883 opened this issue Jun 10, 2023 · 4 comments · Fixed by #25966

Comments

@classicrocker883
Copy link
Contributor

classicrocker883 commented Jun 10, 2023

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

the terminal outputs the file like this - without the exact label suffix (date/time)

Building .pio\build\STM32F103RE_creality\firmware.bin
rename_target([".pio\build\STM32F103RE_creality\firmware.bin"], [".pio\build\STM32F103RE_creality\firmware. Elf"])

it used to print out like this for example

Checking size .pio\build\STM32F103RC_creality_maple\firmware-20230610-005630.elf
Building .pio\build\STM32F103RC_creality_maple\firmware-20230610-005630.bin

and when you go see the file in the folder destination - it does not have*.bin*, the file name is correct, but there is no type, it is blank.

Bug Timeline

No response

Expected behavior

it should be like the previous printout

Actual behavior

does not show firmware-(date/time).bin
and does not have .bin file type in folder.

Steps to Reproduce

the following default_envs affected with the recent change

env:

  1. STM32F401RC_creality
  2. STM32F103Rx_creality
  3. STM32F103RE_creality_maple
  4. STM32F103RC_creality_maple
  5. GD32F303RE_creality_maple
  6. GD32F303RC_creality_maple
  7. GD32F103RET6_sovol_maple

but may not be limited to these.

Steps To Reproduce:

  1. platformio.ini default_envs = STM32F103RE_creality or RC
  2. BOARD_CREALITY_V4 or similar
  3. Build

Version of Marlin Firmware

Most recent commit firmware rename

Printer model

Voxelab Aquila, ender-3 v2

Electronics

No response

Add-ons

No response

Bed Leveling

None

Your Slicer

None

Host Software

None

Don't forget to include

  • A ZIP file containing your Configuration.h and Configuration_adv.h.

Additional information & file uploads

from the /ini/stm32f.ini* file -
in this code board_build.rename = firmware-{date}-{time}

i simply put .bin at the end like

board_build.rename   = firmware-{date}-{time}.bin

and it solved the problem of it not having a .bin type in destination folder, however the other issue of the terminal not printing out the true file name remains.

@classicrocker883
Copy link
Contributor Author

in the very last line of buildroot/share/Platformio/scripts/marlin.py

    env.AddPostAction(str(Path("$BUILD_DIR", "${PROGNAME}.bin")), action);

is that ; supposed to be there?
its showing as an error for me.

@classicrocker883
Copy link
Contributor Author

classicrocker883 commented Jun 10, 2023

in buildroot/share/Platformio/scripts/offset_and_rename.py

        def rename_target(source, target, env):
            from pathlib import Path
            from datetime import datetime
            FW_NAME = Path(target[0].path).replace(Path(target[0].dir.path, datetime.now().strftime(new_name.replace('{date}', '%Y%m%d').replace('{time}', '%H%M%S.bin'))))
            print("FIRMWARE NAME: %s" % FW_NAME)

this is a quick fix / bandaid I came up with
add ".bin" to the end of '{time}', '%H%M%S'
have the Path(...) also equal FW_NAME
and print out to terminal the path/name so you know how to distinguish it better

thats really it. but im sure there is a formal way thats better.

@thisiskeithb
Copy link
Member

Fixed in #25966

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants