-
Notifications
You must be signed in to change notification settings - Fork 724
Description
I have a social project and I wanted to customize the device name. I had two options:
-
1 - Fork the project and change 2 lines of C code.
-
2 - Create new Python code to rename the device.
I chose the first option, but it made me think, "If the code is open source, and I can modify the firmware at will, why so much work to choose the hardware name?"
I suggest adding a select menu to the website to give the user the option to choose whether they want the default firmware or to customize it.
Default - Remains the same.
(New) Customized - Two more input boxes. Example:
Device Runtime name: "Placeholder"
Device Boot Mode name: "Placeholder"
Note: I don't know how your infrastructure is set up, so I opened an insured thread before getting my hands on the code.
Since the endpoint changes for each "device family," the implementation would only look for the latest stable version of the project and check the input fields to see if there was a change. If so, we could create logic to retrieve the information to be "exchanged," perform the change, compilation, and delivery to the user.
My example:
https://circuitpython.org/board/waveshare_rp2040_zero/
:/firmware/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h
I have a social project and I wanted to customize the device name. I had two options:
1 - Fork the project and change 2 lines of C code.
2 - Create new Python code to rename the device.
I chose the first option, but it made me think, "If the code is open source, and I can modify the firmware at will, why so much work to choose the hardware name?"
I suggest adding a select menu to the website to give the user the option to choose whether they want the default firmware or to customize it.
Default - Remains the same.
(New) Customized - Two more input boxes. Example:
Device Runtime name: "Placeholder"
Device Boot Mode name: "Placeholder"
Note: I don't know how your infrastructure is set up, so I opened an insured thread before getting my hands on the code.
Since the endpoint changes for each "device family," the implementation would only look for the latest stable version of the project and check the input fields to see if there was a change. If so, we could create logic to retrieve the information to be "exchanged," perform the change, compilation, and delivery to the user.
My example:
https://circuitpython.org/board/waveshare_rp2040_zero/
C:\firmware\ports\raspberrypi\boards\raspberry_pi_pico\mpconfigboard.h
# 1. Enter the directory of the RP2040 family boards (Raspberry Pi Pico)
cd ports/raspberrypi/boards/
# 2. Rename the "Board Name" in all mpconfigboard.h files of the family
find . -name "mpconfigboard.h" -exec sed -i 's/"Raspberry Pi Pico"/"NOT So Bad USB - 0x29 VHC"/g' {} +
# 3. Rename the "OBJ Name" (Boot Mode Name) in all mpconfigboard.h files
find . -name "mpconfigboard.h" -exec sed -i 's/"RP2040"/"NotSoBadUSB-BootMode"/g' {} +
# 4. Return to the root port to compile
cd ../..
# 5. Clear old builds (important to avoid keeping old names in cache)
make clean
# 6. Compile the new UF2 firmware (using the default Pico profile as a base)
make BOARD=raspberry_pi_pico