-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zephyr building TF-M gives Segmentation fault on b_u585i_iot02a/stm32u585xx/ns #80932
Comments
This is missing one line of context:
This error is actually a red herring, the true problem seems related to
|
@ahmadstm can you please have a look |
The following can be used to reproduce the issue: Minimal reproduction code derived from HAL#include <stddef.h>
#include <stdint.h>
/**
* Any value other than 0 and 0xFFFFFFFF causes ICE.
*/
#define MASK (0xA5A5A5A5)
/**
* Not marking the function as static prevents it from being inlined.
* Without inlining, the ICE doesn't seem to trigger.
*/
static uint32_t callee(void *a1, void *a2) {
uint32_t temp = (((uint32_t)a1 | (uint32_t)a2) & MASK);
uint32_t ref = 0U;
if (a1 != NULL) {
ref = (uint32_t)a1;
} else if (a2 != NULL) {
ref = (uint32_t)a2;
}
/* else: ref = 0U */
if (temp != (ref & MASK)) {
/* Removing `& MASK` here prevents ICE */
return 1U;
}
return 0U;
}
int caller(void *a1, void *a2) {
if ((a1 == NULL) || (a2 == NULL)) {
return 0;
}
if (callee(a1, a2) != 0U) {
return 1;
}
return 0;
} This code builds with GCC 10.5 and 13.1, but hangs with any version of GCC 11 and 12: see https://godbolt.org/z/hcv7zhhc3 This is a known GCC bug - see the following GCC BZ tickets:
(Ironically, three of these reports are 2+ years old but use the same HAL file to trigger the ICE...) |
The HALs in TF-M 2.1.1 are from the old cube FW version, and even the latest HAL version from cube FW 1.6.1 does not fix the problem: [https://github.com/STMicroelectronics/stm32u5xx-hal-driver]. @FRASTM @mathieuchopstm you must integrate a ticket for the HAL team to make the change. |
Summary: Issue linked to compilation of file Issue could be fixed by "adding attribute((no_inline)) to DMA_List_CheckNodesBaseAddresses allows the build to pass", see analysis above. |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
Zephyr CI testing reports a build error b_u585i_iot02a/stm32u585xx/ns tests/benchmarks/sched_queues
when building the tests/benchmarks/sched_queues on the stm32u585 disco kit
(during test campaign of the #79797)
whatever the option is -DCONFIG_SCHED_DUMB=y or -DCONFIG_SCHED_SCALABLE=y
Zephyr version: 4.0.0-rc2
toolchain: zephyr 0.16.8
CMake version: 3.22.1
trusted-firmware-m : 8134106ef9cb3df60e8bd22b172532558e936bd2 or a11cd27905aecc4416cfc85552bfc3b997375056
To Reproduce
Expected behavior
Impact
CI failure
Logs and console output
The text was updated successfully, but these errors were encountered: