STM32F7 - RTOS vs. Embedded Linux - Page 1
Forum section: electronics / general

author: braden_sun
author_rank: Newbie
timestamp: March 11, 2020, 01:13:10 am
content: Hi everyone,I am trying to build a digital motorcycle speedometer using the STM32F7 how best to go about it. I don't have much experience with embedded linux or RTOS but am trying to determine what would be best. I know I don't really need a hard RTOS but I am having a hard time thinking of how I would use linux. For example, I'm not sure how all the different sensors would connect. Also, how does embedded linux interact with things such as the build in LCD Display Controller? I think I have a more clear picture of what an RTOS would look like for this but could see it getting very complicated once you add in driving an LCD, reading speed sensors, talking with a phone over bluetooth, etc.I would really appreciate any good resources for learning about embedded linux.

author: capt bullshot
author_rank: Super Contributor
timestamp: March 11, 2020, 07:39:53 am
content: STM32F7 won't run Linux. Use that MCU series with your favourite RTOS (e.g. FreeRTOS that is supported by the STM32Cube tool, this also provides kind of driver support for the internal LCD controller) or no OS at all. If you've never worked with an embedded MCU like that, it'll be a mess ... At least you have all the driver support for I2C, SPI, UART available from the Cube tool (although this doesn't always work as expected and you'd have to deal with DMA / IRQ channel assignment manually).For embedded Linux, have a look at the STM32MP1 series, here you'd get all the typical Linux stuff. You'd have a working TCP/IP stack, display drivers, mass storage drivers and most probably working serial comms (UART) through the usual Linux devices. For connecting sensors through SPI / I2C I don't know if or how well implemented drivers (kernel modules) are available.

author: Psi
author_rank: Super Contributor
timestamp: March 11, 2020, 07:55:51 am
content: You could make a digital speedometer by interfacing a LCD that includes its own HMI/graphicalAPI with any generic micro-controller like an Arduino or STM32Fx.The graphical API removes the need to use a super fast MCU because the LCD handles most of the complex 2D drawing stuff itself.It also means you don't have to write all that drawing and font code yourself.You simply tell the LCD module to draw you a box or a line at position x,y with width and height for example.Or the text "KPH" at position x,y etc..Some of those LCDs with GUIs built in will even draw you meters, dials and gauges with touchscreen support etc...

author: andersm
author_rank: Super Contributor
timestamp: March 11, 2020, 01:20:27 pm
content: Quote from: capt bullshot on March 11, 2020, 07:39:53 amYou can run nommu Linux them. The mainline kernel has support for some STM32F4 and F7 boards. See eg.here.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 12, 2020, 04:03:52 pm
content: An RTOS just to implement a cute speedometer? That's way overkill IMO.But Linux? It would be more than overkill here. It will be hard to configure, it won't be close to real-time unless you put great effort into it, and even a very stripped-down Linux will take much longer to boot. Annoying. (And those are general considerations - good luck with Linux on the STM32F7 anyway.)Why do you want an OS for this project to begin with?

author: blacksheeplogic
author_rank: Frequent Contributor
timestamp: March 13, 2020, 12:34:04 am
content: Quote from: SiliconWizard on March 12, 2020, 04:03:52 pmWhat an absurd statement to make, for a start, this implies that a speedometer does not need to be IOT enabled. How would you remotely telnet into it? What if you want to quickly check your email? web browser? The list of missing (and essential functionality) is endless..... Personally, I think this is going need a custom ASIC to off-load work from the applications processor (handle data acquisition) and I would certainly be looking at running Linux if I could get away with it to save licensing fees especially if licensing is per core.

author: ralphrmartin
author_rank: Frequent Contributor
timestamp: March 13, 2020, 04:41:20 pm
content: Quote from: SiliconWizard on March 12, 2020, 04:03:52 pmIndeed, a few mechanical bits should do the job. Why use electronics at all?

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 13, 2020, 05:55:37 pm
content: Quote from: blacksheeplogic on March 13, 2020, 12:34:04 am

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: April 08, 2020, 09:10:44 pm
content: http://www.ganssle.com/articles/toastallessons.htm

author: jeremy
author_rank: Super Contributor
timestamp: April 09, 2020, 01:12:15 am
content: FreeRTOS will do fine if you are interested in using an OS. LittleVGL if you want to make a nice GUI.

author: SiliconWizard
author_rank: Super Contributor
timestamp: April 11, 2020, 02:21:30 pm
content: Quote from: Sal Ammoniac on April 08, 2020, 09:10:44 pmGood one.

author: TomS_
author_rank: Frequent Contributor
timestamp: May 01, 2020, 09:07:01 am
content: And if something like FreeRTOS is too heavy you could look at something like TinyRTX. I think it has mostly been written to work on PIC microcontrollers, and lacks some synchronisation features like semaphores and mutexes, but is probably small enough that you could re-work it for some other platform, and shoe horn in any features that are missing.I'm considering it for some projects because it looks incredibly light weight in comparison.

author: Siwastaja
author_rank: Super Contributor
timestamp: May 01, 2020, 01:38:43 pm
content: Neither.Bare metal.Put a Raspberry Pi or Android tablet there if you need a computer. Develop a small low-level bare metal module (a small Cortex-M0 likely works) if you need something such a computer can't do.