Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[ARM] STM32MP157C MPU and programming sophisticated graphic application

Status
Not open for further replies.

FlyingDutch

Advanced Member level 1
Joined
Dec 16, 2017
Messages
457
Helped
45
Reputation
92
Reaction score
55
Trophy points
28
Location
Bydgoszcz - Poland
Activity points
4,954
Hello,

I have to extend system developed (by me and my coleague) for few years. System consists of from two to eight modules connected by CAN bus (CAN 2.0). First module is control unit and the next modules are acting as measuring and executive units. Every miodule (board) has its own processor - STM32F103VGTx and various peripherals. Up to this date for every instance of this system - dedicated panel had been designed and built in. I would like to add display( HDMI port) with "touch interface" by USB (17 to 24 inch display). For this purpose I would like to use "STM32MP157C" MPU (two Cortex-A7 cores with 650 MHz clock and one real-time core Cortex-M4 with 209 Mhz clock) with Linux OS - see link:

https://www.st.com/content/st_com/e...s/stm32mp1-series/stm32mp157/stm32mp157c.html

I have bought such development board:

https://kamami.pl/en/stm32-developm...rter-kit-with-stm32mp157c-microprocessor.html

for application development, but for production system I woiuld like to use such SOM modules:

https://somlabs.com/product/visionsom-stm32mp1/

with dedicated PCB board (only with needed peripherals). I am considering few options:

1) To use or not to use "Boost" C++ libraries

2) Use GTK toolkit for programming GUI (and use not OOP C language)

3) Use QT framework for programming GUI and use C++ (OOP) language

So far I made test of comunication from STM32MP157C-DK2 starter kit and control unit of my system (STM32F103 with CAN 2.0). I wrote program using CAN-FD from STM32MP157C-DK2 (on Cortex-M4 core) to comunicate with system control unit (CAN-FD was working in CAN 2.0 compatible mode). The comunication is fine.

I can not decide what way of graphical application (on STM32MP157C ) programming to choose:

1) Not object C language and GTK toolkit for Graphical GUI (in this case without "Boost" libraries)

2) Using C++ OOP with QT framework and "Boost" libraries

I am familiar with these two approach to C programming (non object versus OOP programming in C++.) What approach would be better in your opinion?
Maybe someone caan give me some "pros and cons" ?

Thanks in advance and regards
 

If you want to know about real engineering applications. First all sorts of OOP and ++ must be forgotten.

When computer systems tell you C++ is better, they mean its easier. However these things are not closer to the hardware and the understanding of how the hardware works will be removed from your knowledge base.

The best languages have always been and always are C and Assembler. Even PIC16 microcontrollers have the LIN or CAN option. Unfortunately everyone is just going for the easy version, so they are using C++, OOP and Python more and more.
 

If you want to know about real engineering applications. First all sorts of OOP and ++ must be forgotten.

The best languages have always been and always are C and Assembler. Even PIC16 microcontrollers have the LIN or CAN option. Unfortunately everyone is just going for the easy version, so they are using C++, OOP and Python more and more.

Hello, @"Carry for cents bazar",

for the real-time part of system (modules with STM32F103 MCU) i have programs written in not object C. Reason is not enough resources - especially RAM memory. But this graphical application (GUI) is very complicated - it would have about twenty different screens. The hardware on which it be run is quite powerful STM32MP157C MPU with 512 MB DDR memory, two cores of ARM A7 running STLinux. I have limited time to write this application and C++ with STL or Boost libraries provide much more higher level of abstraction during writting application.
You do not want to say that I should write such complicated application in assembler?

Best Regards
 

Hello, @"Carry for cents bazar",

for the real-time part of system (modules with STM32F103 MCU) i have programs written in not object C. Reason is not enough resources - especially RAM memory. But this graphical application (GUI) is very complicated - it would have about twenty different screens. The hardware on which it be run is quite powerful STM32MP157C MPU with 512 MB DDR memory, two cores of ARM A7 running STLinux. I have limited time to write this application and C++ with STL or Boost libraries provide much more higher level of abstraction during writting application.
You do not want to say that I should write such complicated application in assembler?

Best Regards
I did not say that. I just though you the best ways of programming hardware, that is C and Assembler. It might be possible for your devices, but I don't say it at the moment. You would be surpirsed how many libraries the companies have especially for your devices in C and Assembler, which make your public libraries worthless. Unfortunately, they don't share them.

If I have to speak realistically, the old nintendo games with super mario were working a 12MHz Motorla 6800, don't ask how much RAM they had, they were written in assembler and C. If you provide with some drawings(I mean the outer appearance of your device) it will help me to understand how it will work from a users' point of view. My specialty is optimization, that means that I take a complex device and make it simple with less circuits.

For the GUI, I don't understand why do you need such complex graphical interpretation? Is this the user interface? Is it going to be used by a worker to set the machine every day? Please provide a description of what your device is expected to do(20 words or less)?
 
Last edited:
If I have to speak realistically, the old nintendo games with super mario were working a 12MHz Motorla 6800, don't ask how much RAM they had, they were written in assembler and C. If you provide with some drawings(I mean the outer appearance of your device) it will help me to understand how it will work from a users' point of view. My specialty is optimization, that means that I take a complex device and make it simple with less circuits.
This sytem is not simple game for small micro-controller - it is complex system for monitoring and steering many devices on naval vessels. It is connected to several dozen of hardware devices on ship.

For the GUI, I don't understand why do you need such complex graphical interpretation? Is this the user interface? Is it going to be used by a worker to set the machine every day? Please provide a description of what your device is expected to do(20 words or less)?

The display with touch interface will be the major control stand for many devices located on all ship (also measurement stand). It have to provide monitoring and steering all these devices in real-time. I have one question: have you ever written very complicated application in limited time (comercially). I think not - because your approach to such task is not suitable. On such sytem: two strong cores running Linux OS (and third core ARM Cortex-M4 for real time) C++ together with template libraries (STL or Boost) is providing much higher level of abstraction - which enabling writing such application in shorter time. Of course I will never use C++ aplication on small MCU, like for example ARM Cortex-M0 to M3 because it has no sense, but this scenario is different.

Best Regards
 

OK, no need to pull out the insult bag. Limited time, under pressure, high risk and etc. lead to bad results. Since you want, use the easier approach and good luck. I have only written ECU software with CAN for the automotive industry, I cant think of anything else complex with CAN. To me this device can be simplified a lot, but since you are developing over an old one and I don't know your market, then maybe its the right way. I don't know. Take your pick and see what will happen.
 

OK, no need to pull out the insult bag. Limited time, under pressure, high risk and etc. lead to bad results. Since you want, use the easier approach and good luck. I have only written ECU software with CAN for the automotive industry, I cant think of anything else complex with CAN. To me this device can be simplified a lot, but since you are developing over an old one and I don't know your market, then maybe its the right way. I don't know. Take your pick and see what will happen.

Hi, every module of this sytem (measuring and executive modules) is taking measurement from several canals (devices) using ADC in DMA mode and sending them to control module (by CAN bus) which work out answers and send it to the same module (control devices connected to executive modules). The main module otherwise steering these devices is making a visualisation of state of all system. The system is flexible and scalable (the number of executive modules). It is working fine in production for more than two years now. I just want only to change the way the system is control from dedicated panels (for each instance of system) to touch monitor.

Regards
--- Updated ---

Hello, @"Carry for cents bazar",

I wouldn't like to say that you are not right. The best example is Windows 10 which currently is not usable for commercial activity (most drivers for hardware debuggers or programmers are nor working correctly). Because I work as much as it is possible on Linux operating system, but unfortunately not all needed aplications exists for Linux OS (many CADs etc.). I remember my first access to PC computer in 1987 year (with intel 8086 CPU) and DOS 2.0 operating system. Hard drive of this PC had 10 MB in size. I also have "Nintendo Wii" console and after hacking it (software way) I tried to write simple graphic application for it and them have taken small memory. I agree with you that nowadays software is very badly optimized (or not optimized at all) - the best example is the size of new computer games: new "Cyberpunk 2077" game occupy 200 GB on hard disk.

But today we are always on hurry - you get very limited time for writting complicated application from your boss, and you haven't many options.
I just considered in case of this application to use just not object C instead of C++, but C++ have many advanteges over C language - for example some of the screens in application will be similiar, then I will be able to use inheritance. Also using data structures from template libraries like STL or Boost gives more opportunities to programmer (belive me I tried to write my own implementation of a list or dictionary data structure in C - It wasn't neither easy nor efficient). So we are living in evil time and not have big impact on such situation (of course only in my humble opinion).

Best Regards
 
Last edited:

Hi, every module of this sytem (measuring and executive modules) is taking measurement from several canals (devices) using ADC in DMA mode and sending them to control module (by CAN bus) which work out answers and send it to the same module (control devices connected to executive modules). The main module otherwise steering these devices is making a visualisation of state of all system. The system is flexible and scalable (the number of executive modules). It is working fine in production for more than two years now. I just want only to change the way the system is control from dedicated panels (for each instance of system) to touch monitor.

Regards
You can use both systems of control, but make the monitor primary or allow the user to choose which should be primary. It should simplify your work, just send the data to the control monitor via CAN and the control monitor program in what ever you think is best. There is no need to remove the control part from all units, leave it as a manual override or something.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top