A
A
Alexander2019-01-03 23:07:22
Python
Alexander, 2019-01-03 23:07:22

Raspberry Pi + Python or STM32 - which is faster?

I wonder who is faster - Python on Raspberry Pi 3b+ or STM32F4 with C firmware?
A task without strict realtime, packet exchange between the ethernet, SPI and UART. The total heap is no more than 10 Mbps. Well, to a lesser extent, the processing of these data and the collection of statistics.
But you need the flexibility of settings, a web muzzle and the ability to configure everything remotely. In raspberries, it's all there out of the box, but on stm you have to invent it yourself.
On the other hand, DMA is available in stm and the task of transferring packets between interfaces is greatly simplified.
In general, what to choose? And where to look at the performance tests of raspberries with python?
(I don’t consider the option to write a program in C for raspberries yet, I still need to learn it)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
VoidVolker, 2019-01-03
@VoidVolker

Take it and check it: write a test of your task in two versions and compare the speed of work.

R
rPman, 2019-01-03
@rPman

Definitely, the raspberry will be faster if, of course, you manually disassemble the packets not byte by byte. Because the data itself will be transmitted by native methods (the uart port will be a file, which means it will just have a data block write syskol).
If you have a data transformation, then it all depends on this transformation and how you implement it, but even in this case, the raspberry will often be an order of magnitude faster, because there is at least a frequency 10 times faster, 4 cores instead of one, etc. .

C
Coocos, 2019-01-03
@coocos

In vain do not consider the C option for raspberries, since development in C for STM32 is even more difficult, because resources are very limited and you will have to implement the OS.
Here it is appropriate to think in which direction the project will develop. If you need flexibility, a web face and remote control, you need to take raspberries and cut them until the required performance is reached.

M
MaxEpt, 2019-02-21
@MaxEpt


Definitely, the raspberry will be faster if, of course, you manually disassemble the packets not byte by byte. Because the data itself will be transmitted by native methods (the uart port will be a file, which means it will just have a data block write syskol).

Ok, so you're saying that it's much faster to use the operating system abstraction layer than writing directly to a register in stm32 ?
The person wrote that he needs ethernet and with the periphery (the number of which, as I understand it, is not large) to communicate. What is the OS for?
Raspberry also has DMA.
Alexander, you are comparing different things. Single board computer and microcontroller.
Although I do not know the details, but according to my premonitions, stm32 will suit you.
You need some kind of parallelism, organization of tasks, etc. - take free rtos.
You don't want to take a steam bath, and if the tasks are not specific (for example, there is no 9-bit uart and some other rare garbage) - take a raspberry.
But STM32 will allow you to gain knowledge and understand how it all works at the lowest level. I.E. will pump you))) Good luck!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question