cancel
Showing results for 
Search instead for 
Did you mean: 

Can't build user program with hwspinlock framework

Mesiaren
Associate II

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:
Mesiaren_0-1690974160200.png

Original post (with less description):
https://community.st.com/t5/other-tools-mpu/stm32mp1-build-user-program-with-hwspinlock-support/td-p/576966

1 ACCEPTED SOLUTION

Accepted Solutions
Erwan SZYMANSKI
ST Employee

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.

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.

View solution in original post

3 REPLIES 3
Erwan SZYMANSKI
ST Employee

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.

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.

Thank you Erwan for your answer. Now I know, what to aim 🙂

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.