Hi all,
I have done some testing with and without short enums option with following build settings
Here are the results:
Short enums
SPE:
FLASH: 178344 B 2047 KB 8.51%
RAM: 75864 B 988 KB 7.50%
NSPE:
flash: 101408 B 511 KB 19.38%
ram: 512 KB 512 KB 100.00%
Long enums (no -fshoert-enums option)
SPE:
FLASH: 178344 B 2047 KB 8.51%
RAM: 75864 B 988 KB 7.50%
NSPE:
flash: 101408 B 511 KB 19.38%
ram: 512 KB 512 KB 100.00%
The memory consumption seems to be the same – My assumption is that compiler generates enums as 4 bytes even with -fshoert-enums option
as 4 bytes aligned access is better anyways, same goes for enums as struct members or function parameters – 4 bytes are used there anyways.
So I think it is safe to just remove the -fshort-enums and -fshort-wchar compile flags – so I have created
https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/49176 to do this
Next is for
@Nicola Mazzucato to rebuild RTX in tests repo and then we can merge this change.
Best regards,
Bohdan Hunko
Cypress Semiconductor Ukraine LLC
Senior Engineer
CSS ICW SW INT BFS SFW
Mobile: +380995019714
Bohdan.Hunko@infineon.com
From: Nicola Mazzucato <Nicola.Mazzucato@arm.com>
Sent: Friday, 6 March 2026 12:48
To: Hunko Bohdan (CSS ICW SWE INT BFS SFW) <Bohdan.Hunko@infineon.com>; tf-m@lists.trustedfirmware.org
Cc: nd <nd@arm.com>
Subject: Re: Short enums and short wchar
|
Caution: This e-mail originated outside Infineon
Technologies. Please be cautious when sharing information or opening attachments especially from unknown senders. Refer to our intranet
guide to help you identify Phishing email. |
Great!
It is next Thursday the 12th at 3PM UK time. Every 4 weeks.
Thanks
Nick
From:
Bohdan.Hunko@infineon.com <Bohdan.Hunko@infineon.com>
Sent: 06 March 2026 10:44
To: Nicola Mazzucato <Nicola.Mazzucato@arm.com>;
tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.org>
Cc: nd <nd@arm.com>
Subject: RE: Short enums and short wchar
Hi
Nicola,
Sure – lets discuss it on the next tech forum. Is it this one
[TF-M] Synced invitation: TF-M Tech forum @ Every 4 weeks from 8am to 9am on Thursday (MST) (tf-m@lists.trustedfirmware.org)
So next Thursday ?
Best regards,
Bohdan Hunko
Cypress Semiconductor Ukraine LLC
Senior Engineer
CSS ICW SW INT BFS SFW
Mobile: +380995019714
Bohdan.Hunko@infineon.com
From: Nicola Mazzucato <Nicola.Mazzucato@arm.com>
Sent: Wednesday, 4 March 2026 13:05
To: tf-m@lists.trustedfirmware.org; Hunko Bohdan (CSS ICW SWE INT BFS SFW) <Bohdan.Hunko@infineon.com>
Cc: nd <nd@arm.com>
Subject: Re: Short enums and short wchar
|
Caution: This e-mail originated outside Infineon
Technologies. Please be cautious when sharing information or opening attachments especially from unknown senders. Refer to our intranet
guide to help you identify Phishing email. |
Hi Bohdan.
Would you be able to join next week Tech forum?
We can discuss the re-building of RTX binaries, flags, etc to make it compatible with everyone. Also, we may want to explore options and interest for other RTOSes.
Hope that helps
Thanks
Nick
From: Bohdan.Hunko--- via TF-M <tf-m@lists.trustedfirmware.org>
Sent: 04 March 2026 10:58
To: tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.org>
Cc: nd <nd@arm.com>
Subject: [TF-M] Re: Short enums and short wchar
Hi all,
Any updates on this topic?
Best regards,
Bohdan Hunko
Cypress Semiconductor Ukraine LLC
Senior Engineer
CSS ICW SW INT BFS SFW
Mobile: +380995019714
Bohdan.Hunko@infineon.com
From: Bohdan.Hunko--- via TF-M <tf-m@lists.trustedfirmware.org>
Sent: Friday, 27 February 2026 14:23
To: Antonio.DeAngelis@arm.com;
Anton.Komlev@arm.com;
Nicola.Mazzucato@arm.com;
tf-m@lists.trustedfirmware.org;
David.Hazi@arm.com
Cc: nd@arm.com
Subject: [TF-M] Re: Short enums and short wchar
|
Caution: This e-mail originated outside Infineon
Technologies. Please be cautious when sharing information or opening attachments especially from unknown senders. Refer to our intranet
guide to help you identify Phishing email. |
Hi all,
Thank you for the replies and suggestions.
I investigated the short enum and short wchar settings, and here is what I found.
At the moment, enum and wchar width settings are inconsistent across compilers:
|
|
|
|
|||||||||||||||
|
|
|
This inconsistency means that we cant choose uniformed flags for our crypto library.
I checked proposed solutions and I can agree that limited bandwith is also huge limitation for our team, thus we also will not be able to implement solutions like
moving to freertos or building CMSIS rtos from sources during TFM build are.
As stated by Nicola:
> I rebuilt RTX not long ago and was not very difficult.
I believe this is the best solution here – just rebuild RTOS (with versions that are currently used (v5.5.0 for ARMCLANG and GCC compilers and v5.7.0 for IAR compiler))
with -fno-short-wchar and -fno-short-enums. And then remove short enum/wchar from compiler options in respective toolchain.cmake files in TFM.
If this change is acceptable I would gladly make changes in TFM cmake files and maybe
@Nicola Mazzucato
would be generous to provide rebuilt for the libraries?
Best regards,
Bohdan Hunko
Cypress Semiconductor Ukraine LLC
Senior Engineer
CSS ICW SW INT BFS SFW
Mobile: +380995019714
Bohdan.Hunko@infineon.com
From: Antonio De Angelis <Antonio.DeAngelis@arm.com>
Sent: Friday, 27 February 2026 11:08
To: Anton Komlev <Anton.Komlev@arm.com>; Nicola Mazzucato <Nicola.Mazzucato@arm.com>;
Hunko Bohdan (CSS ICW SWE INT BFS SFW) <Bohdan.Hunko@infineon.com>;
tf-m@lists.trustedfirmware.org; David Hazi <David.Hazi@arm.com>
Cc: nd <nd@arm.com>
Subject: Re: Short enums and short wchar
|
Caution: This e-mail originated outside Infineon
Technologies. Please be cautious when sharing information or opening attachments especially from unknown senders. Refer to our intranet
guide to help you identify Phishing email. |
There were mentions of using FreeRTOS, I believe it’s a good option as well, being it a widely adopted solution in the ecosystem. But we can discuss further in a tech forum.
Thanks,
Antonio
Sent from Outlook for Mac