
STMicro MPU Supports Linux and Android - conductor
https://www.cnx-software.com/2019/02/21/stmicro-stm32mp1-cortex-a7-m4-mpu/
======
magicalhippo
ST is pushing hard it seems. They bought Atollic and made their TrueSTUDIO IDE
free, and while it's Eclipse based it's pretty easy to set up and get going at
least. They've got a plugin for it, STM32CubeMX, which helps you configure and
generate initialization code* for the peripherals and clock.

Having started out with Arduino I've lately been having fun with the STM32F103
"Blue Pill" boards. Like with this STM32MP1, ST have put a lot of interesting
analog stuff in with the digital in their STM32 chips.

Both the STM32MP1 and STM32F103 has dual 12-bit ADCs, so you can do
simultaneous sampling or interleaved for increased speed. The STM32F303 series
has up to four. The STM32FMP1 has dual DACs as well (the STM32F103 series has
at most one, but the Blue Pill has none due to using a low pin-count package).

Now, I've just been dabbling with this embedded stuff in my spare time for a
wee while now, but it seems ST is pushing hard and on the rise.

*: now their hardware abstraction layer, the HAL library, leaves quite a bit to be desired, but it's nice to get a starting point for newbies.

~~~
TickleSteve
ST is quite probably the market leader for embedded micros (though NXP may be
getting there). They're hardly the up and coming underdog, they're the 800lb
gorilla in the market and the things you mention are pretty much par for the
course.

This combined A7+M4 device is unusual, but is simply a cost saving over what
would simply be an A7 device serially attached to an M4 (for example). There
does not seem to be any new features here other than the cost saving from
combining them.

~~~
zokier
> ST is quite probably the market leader for embedded micros (though NXP may
> be getting there).

This report from 2016 puts NXP at twice the marketshare over STmicro who are
sitting steadily in the fifth place:

[https://epsnews.com/2017/05/01/nxp-tops-microcontroller-
supp...](https://epsnews.com/2017/05/01/nxp-tops-microcontroller-supplier-
ranking/)

Although at least part of the sales volume difference can be explained by NXP
having had more expensive i.MX range available (and others), so in terms of
chips sold they might be closer to each other.

> This combined A7+M4 device is unusual

I'm not sure if I'd say that, previously NXP did the exact same thing with
i.MX7, and TI with their AM5x. And of course don't forget the classic AM3x
which had PRUs filling part of the same role.

~~~
solarkraft
I can anecdotally say that I'm hearing a lot more about STMs than about NXP
microcontrollers.

~~~
stefan_
Because you're in the wrong industry. Very big in automotive.

~~~
rvense
I take apart prosumer audio/music gear quite often, and STM32s seem quite
popular there. Not sure where that is in volume, though.

------
TD-Linux
The (optional) GPU is a Vivante core, which is great because it's supported by
free software drivers and Mesa support. Given the generally good free software
support that ST gives, plus the mainline Linux support landing over a year
early, this looks like a pretty fun part to play with.

------
kbumsik
The Discovery dev board [1] is pretty rich for the official $69 baord. Gigabit
eth, audio, HDMI, 4 USB-A + 1 USB-C, Arduino/RPi expansion connectors, and of
course a ST-Link (can it debug multicore Cortex-A7 btw?)

I hope it would get a great open-source support.

[1]:
[https://www.st.com/resource/en/data_brief/stm32mp157c-dk2.pd...](https://www.st.com/resource/en/data_brief/stm32mp157c-dk2.pdf)

------
joezydeco
"Supports" Android is not the same as "running it without wanting to throw it
out a window".

~~~
pjmlp
In any case a device able to run a standard Linux distribution is much better
using OpenJDK than having to deal with Android J++.

~~~
monocasa
Last time I checked, it was such an early port OpenJDK for AArch32 didn't even
support a JIT yet.

~~~
pjmlp
Then check again, as OpenJDK has a much better ARM support nowadays.

In any case, the beauty of standard Java is that the OpenJDK is not the only
option available for targeting ARM, there are other vendors offering Java
compliant solutions.

And by being regular Linux distributions, there are also other programming
languages available for those that don't like coffee based languages.

~~~
monocasa
> Then check again, as OpenJDK has a much better ARM support nowadays.

I just checked, and it by default ships with Zero in interpreter mode, with
Azul's AArch32 work still being pre beta and not even fully integrated into
master yet.

> In any case, the beauty of standard Java is that the OpenJDK is not the only
> option available for targeting ARM, there are other vendors offering Java
> compliant solutions.

I'm not going to pay for a solution for a $5 chip.

~~~
pjmlp
Then you get what you pay for.

~~~
monocasa
Going back to your original comment then, Android supports Java development on
this chip much better than OpenJDK.

~~~
pjmlp
Except that Android is Google's J++, thus pretty useless to Java developers
that care about compliant code and modern Java features.

The market failure of Android Things, while companies like PTC, IBM and Aicas
thrive on embedded deployments proves just that.

------
dvfjsdhgfv
See their official press release here:

[https://www.st.com/content/st_com/en/about/media-
center/pres...](https://www.st.com/content/st_com/en/about/media-center/press-
item.html/p4140.html)

------
dmitrygr
If it has their insanely broken i2c implementation, it wouldn't matter if it
cures cancer.

Look into the linux driver for stm32 i2c driver. more curses per comment than
any other driver. they are ALL deserved.

~~~
ohazi
iirc, their SPI hardware is also a little wonky. The designer seems to have
assumed that the only thing you'd ever want to read from in receive-only mode
is an SPI flash chip, so it eagerly tries to fill the receive buffer every
time you read. So you might be trying to do a single word read from some
device, but you'll see a dozen reads on a scope trace.

The only way that I've found to get around this is to run a dummy transmitter.
Transmit as many zero bytes as you'd like to read, and then it'll run the
receiver in lock-step.

This would have all been reasonable if it were documented, but it wasn't at
the time.

~~~
scoutt
While I agree that I2C is mostly broken and filled with workarounds (at least
in the STM32F103x family), the SPI in master mode (as I understand you are
referring to) works fairly well. To receive data you have to send clock
pulses. Sending clock pulses also means that you are transmitting (zeroes in
your case), but there is no way to escape from that since it's the way SPI
works.

SPI in STM32 is very precise with timings and general behavior. Take a look on
how some seasoned users implement SPI to do VGA graphics:
[https://www.artekit.eu/vga-output-using-a-36-pin-
stm32/](https://www.artekit.eu/vga-output-using-a-36-pin-stm32/)

~~~
dmitrygr
I think the parent was talking about using SPI in bidirectional mode (one
shared wire for both tx and rx). In that case indeed it is hard to only read a
fixed small number of bytes

------
ChuckMcM
Ok then, that is pretty cool. Can't wait to get the Discovery kit [1]. Pretty
much a 'super chumby' :-). Next up the 1K price point for these things.

[1] [https://www.st.com/content/st_com/en/products/evaluation-
too...](https://www.st.com/content/st_com/en/products/evaluation-
tools/product-evaluation-tools/mcu-mpu-eval-tools/stm32-mcu-mpu-eval-
tools/stm32-discovery-kits/stm32mp157c-dk2.html)

~~~
duskwuff
> Next up the 1K price point for these things.

$9.80 @10ku for the part on the Discovery. Not shipping yet, but other parts
in the STM32MP family are.

[https://www.st.com/content/st_com/en/products/microcontrolle...](https://www.st.com/content/st_com/en/products/microcontrollers-
microprocessors/stm32-arm-cortex-
mpus/stm32mp1-series/stm32mp157/stm32mp157c.html)

~~~
zokier
And the cheapest part is $4.848, that is pretty damn affordable. Many of
STM32F4 are more expensive than that!

------
jeshwanth
MPU supports Linux? Can somebody explain how they are doing this without MMU?
Is it a security issue or complex compared to MMU?

~~~
aceperry
They're calling the MPU: Microprocessor Unit, not a memory protection unit.
The Cortex A7 has the MMU. BTW, there are some linux distros that are made to
run on processors without mmu's. Look at uClinux and NOMMU Linux.

------
monocasa
I should hope so. The RPi2 is a quad core A7.

~~~
kbumsik
You should know that the computation capabilities is not the only factor of
the industrial embedded system and that chip does not even look at it.

It much more focused on real-time capabilities and hardware control. Notable
examples are 1. Built-in Cortex M4 microcontroller 2. RPi doesn't have ADCs
but STM32MP1 got 16-bit ADCs and a sigma-delta modulator. 3. It's got
5V-tolerant GPIO whereas RPis are not 4. Best-in-class timers for PWM and
quadrature encoders.

~~~
monocasa
The title has changed since I posted. It was something to the effect of "ST
Micro Cortex-A7 supports Linux and Android".

Which is sort of 'no shit, of course an A7 is easy to port Linux to.'

Yes, I know that an RPi isn't the best microcontroller. My last job had me as
the lead for a proprietary RTOS for a custom robotics system. In fact if you
go into the STM32F docs for the SSI controller where it calls the busy flag
"unreliable", that was my contribution.

