Skip to main content
Associate II
August 2, 2023
Solved

Can't build user program with hwspinlock framework

  • August 2, 2023
  • 1 reply
  • 2988 views

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

This topic has been closed for replies.
Best answer by Erwan SZYMANSKI

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.

1 reply

Erwan SZYMANSKI
Erwan SZYMANSKIBest answer
Technical Moderator
August 3, 2023

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.
MesiarenAuthor
Associate II
August 8, 2023

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