-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
MPU fault while trying to call symbol in LLEXT module #72957
Comments
Additional informations. In my code after loading the module with
Result is the following:
So the function is found but execution failed as seen previously in the shell. Also done some basics, but not sure it helps:
I also executed
So looks it's something related maybe to my project configuration ? |
Can you give me a few details, what device are you trying this on? How was the extension built? |
@teburd hello, I provided these information in the first message of this issue, with details. |
Redone a new test rebuilding and flashing my target with https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/subsys/llext/shell_loader/README.rst indicates: "You may need to disable memory protection for the sample to work (e.g. CONFIG_ARM_MPU=n)." If disabling MPU is a requirement to LLEXT, how is it possible to unselect |
Its not required that CONFIG_ARM_MPU=n, but if you want to use the MPU and loadable extensions, we need to be able to setup memory region permissions. That today requires CONFIG_USERSPACE=y So the options are CONFIG_ARM_MPU=n || CONFIG_USERSPACE=y Note that using userspace may not be enough, if you look at the test I setup a thread (both in supervisor mode and user mode) before calling into the extension with the regions setup. That's because some arm parts (nxp kinetis for example) don't have many mpu regions to work with, and the thread context to run from needs to have access to the .text of the extension today. There's some other ways of solving the problem that I didn't explore because the tools to setup regions with permissions was already there with user space (memory domains and partitions) I'd very happily accept pull requests updating the documentation to reflect this if its not clear |
Okkkk good, thanks for the details @teburd !!! |
Hello,
I'm working with nucleo_l4a6zg board from st.
I have build hello-world LLEXT example with the following command:
and then retrieved
hello-world.llext
file in the build dir.Then I have loaded the file on the board using the llext loader (not using the shell).
Then with the shell I would like to test it, so some simple commands on the uart interface:
Looks it's properly loaded 🎉
Seems there is no symbol 😔
And finally:
What could be the reason the
test_entry
function is not available ??I activated LLEXT debug log level and I have the following logs when the module is loaded in my application:
This looks good and we can see the
test_entry
symbol is properly read.I'm on top of the main branch + 1 modification to get the LLEXT shell building properly (looks strange nobody is reporting this isn't it ? I can do a PR):
So at the end several questions:
test_entry
symbol is not found ? Could it be related to my platform ? I tested withCONFIG_ARM_MPU=n
after discussion on discord, same result.Thanks for any advice!
The text was updated successfully, but these errors were encountered: