-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
sched/semaphore: change semcount type to int #14625
Conversation
Some memory on the ESP32 requires aligned access, so the semcount type has been changed to int. Signed-off-by: zhangyuan29 <[email protected]>
[Experimental Bot, please feedback here] No, this PR does not fully meet the NuttX requirements. While it provides some information, it lacks crucial details. Here's a breakdown:
In short, the PR needs significantly more detail and evidence to meet the NuttX requirements. It needs to thoroughly explain the problem, the solution, and the impact of the change, supported by clear testing evidence. |
Testing... |
Unfortunately, the tests' results are the same... still failing to boot... |
Hi, @tmedicci, we only have the ESP32-S3 boards. Can we reproduce this issue using the ESP32S3? Just to confirm, this issue only occurs when using the IRAM heap, correct? |
Hi @zyfeier ,
Unfortunately not. ESP32-S3 uses SRAM1 (which is accessible using either the instruction and data bus): there isn't a separate heap for loading apps (we just need to access the heap using its data address when copying data to avoid non-aligned access). For ESP32, the text heap is used from SRAM0 (here). This memory bank is only accessible using the instruction bus and any non-aligned word would cause an exception. In fact, we capture this exception and repeat the operation using a aligned access. Check |
Hi @zyfeier , were you able to verify anything further? |
Hi, @tmedicci , plz help to know, after this PR, is the address of semcount in the semaphore 4-byte aligned? |
see also #14755 |
Hi, @tmedicci We get esp32 board, and will check soon. |
As indicated in #14465 (comment) , |
@tmedicci two solution we can come up:
which one do you like? |
This reverts commit befe298. Because a few regressions have been reported and it likely will take some time to fix them: * for some configurations, semaphore can be used on the special memory region, where atomic access is not available. cf. apache#14625 * include/nuttx/lib/stdatomic.h is not compatible with the C11 semantics, which the change in question relies on. cf. apache#14755
here is the patch for the first solution: #14625 |
let's close this pr since it can't fix the problem. |
This reverts commit befe298. Because a few regressions have been reported and it likely will take some time to fix them: * for some configurations, semaphore can be used on the special memory region, where atomic access is not available. cf. #14625 * include/nuttx/lib/stdatomic.h is not compatible with the C11 semantics, which the change in question relies on. cf. #14755
This reverts commit befe298. Because a few regressions have been reported and it likely will take some time to fix them: * for some configurations, semaphore can be used on the special memory region, where atomic access is not available. cf. apache#14625 * include/nuttx/lib/stdatomic.h is not compatible with the C11 semantics, which the change in question relies on. cf. apache#14755
This reverts commit befe298. Because a few regressions have been reported and it likely will take some time to fix them: * for some configurations, semaphore can be used on the special memory region, where atomic access is not available. cf. apache#14625 * include/nuttx/lib/stdatomic.h is not compatible with the C11 semantics, which the change in question relies on. cf. apache#14755
Summary
Fix the issue introduced by bug #14465.
Some memory on the ESP32 requires aligned access,
so the semcount type has been changed to int.
Impact
semaphore
Testing
bes board test pass