Boot2Qt and CAN or SPI communication
-
wrote on 13 Dec 2024, 15:13 last edited by Damian7546
I am testing Boot2Qt module together with STM32MP157F-DK2.
I prepared my first GUI in Qt Design Studio and deploy my application to target deviceNow I would like to establish communication with CAN device slaves, but I have no idea where to start.
While analyzing the STM32MP157F-DK2 diagram, I noticed that I had an SPI interface available, so I logged to target device by ssh and listed SPI devices bo nothing found.
root@b2qt-stm32mp15-disco:~# ls -1 /dev/spi* ls: /dev/spi*: No such file or directory
Can you give me any idea how add SPI or CAN driver to Boot2Qt system ?
Maybe simple question, how control GPIO from qt ?
-
wrote on 22 Dec 2024, 16:46 last edited by Damian7546
@jsulm
@mrdebug
I probably found appropriate knowledge about approach to programming STM32MP1.
The STM32MP1 series is based on Cortex-A7 and Cortex-M4 cores architecture.First Way:
First of those (Cortex-A7) is required to create GUI (ex. Boot2Qt) .
But second one (Cortex-M4) is required to communicate with STM32 peripheral (ex. by STM32CubeProgrammer).
Data processed in Cortex-M4 can be send to GUI (Cortex-M7) over the “Inter processor Communications” (IPC) virtual UART.Second Way:
All programing by userspace Linux . In case OpenSTLinux ad STM32MP157f-DK2 , necessery is to turn on CAN0 by editind device tree.
Device tree is generated by STM32CubeMX.
Just make sure to install the appropriate version of the STM32Cube* tools - supplied with the Ecosystem version you are using. -
wrote on 15 Dec 2024, 20:05 last edited by
Hi, this is not related to Qt. I suggest you to ask in ST forums related to your mcu.
Have you installed STM32CubeMX? Maybe you have got a sub folder with examples about gpio usage. -
wrote on 19 Dec 2024, 13:23 last edited by
So, the logic , for example control DI DO , I need STM32CubeMX to programing in? , not form C++ , qt ?
-
wrote on 19 Dec 2024, 13:32 last edited by
I haven't got experience with your device.
I the past I made a project for raspberry pi where the gui was made in Qt.
To manage the GPIOs and the spi I used a specified library for raspberry pi.
I think your device is similar.
I think that Qt can't support each device that has got a spi, i2c or gpio interfaces.
Have you check in the stm forums? -
wrote on 20 Dec 2024, 06:45 last edited by Damian7546
So, you included library for raspberry pi (ex. "wiringPi") to qt creator and controled GPIO from the qt level?
-
So, you included library for raspberry pi (ex. "wiringPi") to qt creator and controled GPIO from the qt level?
@Damian7546 You don't include a library "to QtCreator", you link the library to your application and use it like any other.
"controled GPIO from the qt level" - this has nothing to do with Qt, you use that library in your C++ code. -
wrote on 20 Dec 2024, 10:42 last edited by Damian7546
So, on my host machine (where I have qt and qtCreator) additionaly I should install SDK (STM32MP1 OpenSTLinux Developer Package Sources) to my STM32 and link downloaded library to my project in qt Creator ?
[https://www.st.com/en/embedded-software/stm32mp1dev.html#get-software](link url) -
wrote on 22 Dec 2024, 16:46 last edited by Damian7546
@jsulm
@mrdebug
I probably found appropriate knowledge about approach to programming STM32MP1.
The STM32MP1 series is based on Cortex-A7 and Cortex-M4 cores architecture.First Way:
First of those (Cortex-A7) is required to create GUI (ex. Boot2Qt) .
But second one (Cortex-M4) is required to communicate with STM32 peripheral (ex. by STM32CubeProgrammer).
Data processed in Cortex-M4 can be send to GUI (Cortex-M7) over the “Inter processor Communications” (IPC) virtual UART.Second Way:
All programing by userspace Linux . In case OpenSTLinux ad STM32MP157f-DK2 , necessery is to turn on CAN0 by editind device tree.
Device tree is generated by STM32CubeMX.
Just make sure to install the appropriate version of the STM32Cube* tools - supplied with the Ecosystem version you are using. -