2023-08-02 04:06 AM - edited 2023-08-02 04:18 AM
Hello, I am currently researching about possibilities in STM32MP1 dual core. I am trying to create user program that uses HW Semaphore. I used program from wiki:
https://wiki.st.com/stm32mpu/wiki/Hardware_spinlock_overview.
and makefile described here:
https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Develop_on_Arm%C2%AE_Cortex%C2%AE-A7/Create_a_simple_hello-world_application
with including builded linux kernel 5.15.67.
But I can't build program, because of numerous errors. I was trying to resolve some of errors by including them hard-coded way into user space program, but I think, that is not the correct way to fix these errors. How to properly build program including kernel files? Is there any include to be included when using kernel files? Or any other makefile switch? See attached files...
Thanks for any tips.
Some of compile errors:
Original post (with less description):
https://community.st.com/t5/other-tools-mpu/stm32mp1-build-user-program-with-hwspinlock-support/td-p/576966
Solved! Go to Solution.
2023-08-03 06:05 AM
Hello @Mesiaren ,
I am almost 100% sure that you are not allowed to call hwspinlock from user space application. This is dedicated to Kernel world.
I think you will need to find a way to call a driver (maybe a Linux that you made yourself) that will manage HW spinlock for you, but in Kernel space.
We can imagine an home made driver called by IOCTL by your user application, and that will manage spinlock itself I guess.
Kind regards,
Erwan.
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
2023-08-03 06:05 AM
Hello @Mesiaren ,
I am almost 100% sure that you are not allowed to call hwspinlock from user space application. This is dedicated to Kernel world.
I think you will need to find a way to call a driver (maybe a Linux that you made yourself) that will manage HW spinlock for you, but in Kernel space.
We can imagine an home made driver called by IOCTL by your user application, and that will manage spinlock itself I guess.
Kind regards,
Erwan.
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
2023-08-07 11:36 PM
Thank you Erwan for your answer. Now I know, what to aim :)
2023-08-10 12:32 AM
Hello @Erwan SZYMANSKI, is there any example how to do that? I found driver directly in kernel, but I wonder, that is possible to create user space program using systemcalls open, write, read.