Closed elotom closed 1 year ago
Maybe https://github.com/esp-rs/esp-wifi/issues/16 is related. My experiments initially showed it might work correctly but it probably depends on the number of arguments
This is a bug in the Xtensa port of LLVM. C.f. espressif/llvm-project#66.
If you're responsible for compiling all of the code a workaround would be to compile the C portions with clang instead of GCC.
We have a fix for this internally which fixes the issue. Hopefully will be merged shortly! I'll be sure to do a point release as of the Rust compiler as this issue is quite severe.
Patch release is now available here: https://github.com/esp-rs/rust, builds are on the way.
Builds are now available. Closing this issue.
I'm binding a Rust function to a C function that takes 10 parameters. What I'm seeing now is some kind of misalignment where the parameters following the 7th parameter are misaligned by two bytes. We are using esp32 S3
To reproduce the issue please clone https://github.com/elotom/rust-esp32-std-demo/tree/c-parameters-align-issue then run the following commands: 1.
xtensa-esp32s3-elf-gcc -Ilibtest_parameters -o c/test_parameters.o -c c/test_parameters.c
2.xtensa-esp32s3-elf-ar csrDT c/libtest_parameters.a -c c/test_parameters.o
cargo +esp espflash --target xtensa-esp32s3-espidf --release --monitor
The C function only returns param8
The Rust function calls test_parameters and I'm expecting a return value of 800 but I'm getting 900 instead
Meta
rustc --version --verbose
: