Page MenuHomePhabricator

Remove I/O format specifier macros from bootloader
Closed, ResolvedPublic

Description

The 8-bit format specifier macro types (e.g. PRIu8) requires the C99 I/O format support to be enabled, otherwise the usage
of these macros results in undefined behaviour. TF-M uses the newlib-nano standard library implementation which by default
does not support these format macros.

  • Remove the format specifier macros used in the formatted input/output functions.

Event Timeline

davidvincze triaged this task as Low priority.May 28 2019, 1:48 PM
davidvincze raised the priority of this task from Low to Normal.
davidvincze created this task.
davidvincze created this object with edit policy "Administrators".
davidvincze closed this task as Resolved.May 28 2019, 2:33 PM

@block blast
Yes, updating both spm_api.c and tfm_nspm.c to use #ifdef instead of #if for evaluating the macro TFM_PSA_API can help resolve the compiler error in mbed-os. This change ensures compatibility with both cmake-based builds (where the macro is defined using the -D option) and mbed-os (where the macro is defined using #define).

@Slice Master Run a bootloader on the device to ensure I/O functions work properly without macros.