Skip to content

Commit 741d229

Browse files
committed
DeviceUid: changed uid vendor string in STM targets to a much smaller form
1 parent 0a907cd commit 741d229

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

targets/TARGET_STM/device_uid_api.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,15 @@ void device_uid_get_str(char *str)
104104
x = (uid_buf[0] >> 16) & 0x0000FFFF;
105105
y = uid_buf[0] & 0x0000FFFF;
106106

107-
// make a string in format "Lot xxxxxxx Wafer xxx X=xxxxx Y=xxxxx" - max 38 chars including terminating zero
108-
strcpy(str, "Lot ");
109-
strcat(str, lot_number);
110-
strcat(str, " Wafer ");
107+
// make a string in format "LLLLLL:WWW:XXXXX:YYYYY" - max 23 chars including terminating zero
108+
strcpy(str, lot_number);
109+
strcat(str, ":");
111110
cpu_uid_itoa(wafer_number, buffer, 10);
112111
strcat(str, buffer);
113-
strcat(str, " X=");
112+
strcat(str, ":");
114113
cpu_uid_itoa(x, buffer, 10);
115114
strcat(str, buffer);
116-
strcat(str, " Y=");
115+
strcat(str, ":");
117116
cpu_uid_itoa(y, buffer, 10);
118117
strcat(str, buffer);
119118
}

targets/targets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@
705705
"public": false,
706706
"extra_labels": ["STM"],
707707
"supported_toolchains": ["ARM", "uARM", "IAR", "GCC_ARM"],
708-
"macros": ["TRANSACTION_QUEUE_SIZE_SPI=2", "MBED_DEVICEUID_SIZE=12", "MBED_DEVICEUID_STR_SIZE_MAX=38"],
708+
"macros": ["TRANSACTION_QUEUE_SIZE_SPI=2", "MBED_DEVICEUID_SIZE=12", "MBED_DEVICEUID_STR_SIZE_MAX=23"],
709709
"config": {
710710
"lse_available": {
711711
"help": "Define if a Low Speed External xtal (LSE) is available on the board (0 = No, 1 = Yes). If Yes, the LSE will be used to clock the RTC, LPUART, ... otherwise the Low Speed Internal clock (LSI) will be used",

0 commit comments

Comments
 (0)