This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

UCD3138FW-BIDI: What should I be aware of when changing version number information?

Part Number: UCD3138FW-BIDI
Other Parts Discussed in Thread: PMP21529, TIDA-00653

Tool/software:

Dear TI Experts,

I referred to the "PMP21529" device_id.c file and modified the related functionality into the "UCD3138FW_BIDI" device_id.c file.

//###########################################################################
//
// FILE:    device_id.c
//
// TITLE:
//
// NOTES:
//  1)
//###########################################################################
//
//  Ver  | dd mmm yyyy | Who  		| Description of changes
// ======|=============|============|========================================
//  00 	   05 04 2015 	 HPCS
//
//  Texas Instruments, Inc
//  Copyright Texas Instruments 2008. All rights reserved.
//###########################################################################

#include "build.h"
#include "date.h"

/* 20240925 add start */
#include "Cyclone_Device.h"     // UCD30xx Headers Include File
#include "system_defines.h"
#include "variables.h"
#include "pmbus_commands.h"
#include "pmbus.h"
#include "function_definitions.h"

//------------------------------------------------------------------------------------------
// DEFINITIONS
//------------------------------------------------------------------------------------------
#define PMBUS_DATA_LENGTH (32)         // the max number of data bytes in a command
/* 20240925 add end */

//------------------------------------------------------------------------------------------
// MACROS
//------------------------------------------------------------------------------------------
#define min(a,b)  (((a)>(b)) ? (b):(a))


//------------------------------------------------------------------------------------------
// Firmware Release Version Information
//------------------------------------------------------------------------------------------
#define RELEASE_MAJOR   0              // 1-digit decimal (or 4 bits hex)
#define RELEASE_MINOR   0              // 2-digit decimal (or 8 bits hex)


// Create string of leading zeros to pad the build number to four characters.
#if BUILD_NUMBER < 10
    #define ZBLD    "000"
#elif BUILD_NUMBER < 100
    #define ZBLD    "00"
#elif BUILD_NUMBER < 1000
    #define ZBLD    "0"
#else
    #define ZBLD    ""
#endif

// Ugly macros to combine numbers into one big string with proper punctuation.
// Two layers of macros required to force proper substitution.
// Typical result would be "2.04.0.0058"
#define PREMAKE_VERSION_STRING(  maj,    min,     sub,     zbld, bld) \
                                #maj "." #min "." #sub "." zbld #bld

#define    MAKE_VERSION_STRING(maj, min, sub, zbld, bld) \
        PREMAKE_VERSION_STRING(maj, min, sub, zbld, bld)

#define VERSION_STRING \
          MAKE_VERSION_STRING(RELEASE_MAJOR, RELEASE_MINOR, RELEASE_SUB, ZBLD, BUILD_NUMBER)

#define PREMAKE_DEVICE_ID_STRING(__DEVICE_ID__, __BUILD_DATE__) \
          #__DEVICE_ID__ "|" VERSION_STRING "|" #__BUILD_DATE__

#define    MAKE_DEVICE_ID_STRING(__DEVICE_ID__, __BUILD_DATE__) \
        PREMAKE_DEVICE_ID_STRING(__DEVICE_ID__, __BUILD_DATE__)

// Combine hardware device ID, firmware version string, and firmware build date into
// on long string with proper punctuation.  Typical output would be
// "UCD92120|3.8.0.0058|080522"

#define DEVICE_ID_STRING  MAKE_DEVICE_ID_STRING(DEVICE, BUILD_DATE)


#pragma DATA_SECTION (device_id_string, "FixedDeviceID");
//const char  device_id_string[] = DEVICE_ID_STRING;

/* 20240925 add start */
const char  device_id_string[] = DEVICE_ID_STRING; //�إ�device_id��T, �ϥΤFbuild.h�Bdate.h�����Ѽƫإ�version��T�P���ɤ��

//------------------------------------------------------------------------------------------
// pmbus_read_device_id() returns a string with the controller's model number that
// includes sub-release, build number, and build date.  Uses lots of macros to generate
// string at compile time instead of run time.
//------------------------------------------------------------------------------------------
int pmbus_read_device_id(void)
{
    Uint32  string_len;

    // Determine the length of the string to send.
    // Do not allow string to overflow the PMBus buffer size.
    string_len = min(sizeof(device_id_string), PMBUS_DATA_LENGTH);

    send_string(device_id_string, string_len);
    return PMBUS_SUCCESS;
}
/* 20240925 add end*/

And commented out the original functionality for reading the device_id.

And modified the BUILD_DATE in "date.h".

The device_id has been confirmed to be correctly displayed in the GUI regarding the above modifications.

It can now be confirmed that the modifiable version parameters are RELEASE_MAJOR, RELEASE_MINOR, and BUILD_DATE.

I noticed that the message in "build.h" mentions "DO NOT MODIFY BY HAND." So when do the BUILD_NUMBER and RELEASE_SUB parameters automatically change? Or is it actually possible to manually adjust these parameters?