How do I program a version number into my firmware?

mzincali
Posts: 46
Joined: Wed Jun 08, 2022 7:23 am

How do I program a version number into my firmware?

Postby mzincali » Wed Nov 16, 2022 9:40 am

I want this to show up in the startup log, after the partition table info or thereabouts.
I’m using PlatformIO and I don’t see how I can do this. Anyone know how?

(I know how to put a version number in my own code and print it. That will show up much later that the startup log.)

User avatar
rudi ;-)
Posts: 1698
Joined: Fri Nov 13, 2015 3:25 pm

Re: How do I program a version number into my firmware?

Postby rudi ;-) » Wed Nov 16, 2022 4:50 pm

mzincali wrote:
Wed Nov 16, 2022 9:40 am
I want this to show up in the startup log, after the partition table info or thereabouts.
I’m using PlatformIO and I don’t see how I can do this. Anyone know how?

(I know how to put a version number in my own code and print it. That will show up much later that the startup log.)


check the Custom bootloader examples and put your version message as "custom message" then in the boot proc.
hope this helps
best wishes
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

Re: How do I program a version number into my firmware?

Postby chegewara » Thu Nov 17, 2022 2:09 am

Simply add one file in your project with version you want:

Code: Select all

version.txt
You have also few options in menuconfig to control version, assuming you are using esp-idf and not arduino framework.

mzincali
Posts: 46
Joined: Wed Jun 08, 2022 7:23 am

Re: How do I program a version number into my firmware?

Postby mzincali » Sat Dec 03, 2022 9:43 am

Simply add one file in your project with version you want:
Would that work for Platformio? Or is that only for esp-idf?

Who is online

Users browsing this forum: Bing [Bot] and 109 guests