Hacker News new | past | comments | ask | show | jobs | submit login
STMicro MPU Supports Linux and Android (cnx-software.com)
91 points by conductor on Feb 21, 2019 | hide | past | favorite | 39 comments



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.


> 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.

libopencm3 is a very good alternative with a much better license if you're looking to open source your work [0]. They give you some nice examples [1], and a project template [2]. The documentation is okay, but like most doxygen projects, I find it easier to just read the headers myself.

[0] http://libopencm3.org [1] https://github.com/libopencm3/libopencm3-examples.git [2] https://github.com/libopencm3/libopencm3-template


ST fixed their STM32Cube licenses so that most of it is BSD licensed, but yeah I also agree that libopencm3 is great. ST has good datasheets that allow anyone to easily create their own HAL or set things up directly if needed. There's also HALs for other language, such as Rust.


Yes, I love ST reference manuals. Sometimes it's easier to poke registers directly using the definitions in the CMSIS headers when you're doing something more complicated with the ST reference manual as your reference. The layer of indirection introduced by a HAL makes working off the ref manual more difficult, and sometimes impossible without poking at least a couple of registers directly. Typically I'd do that as a first cut, and look to add some abstraction once it's already working.

I haven't gone down the Rust rabbit hole so far, mostly due to lack of time. Hopefully the embedded support will have matured nicely by the time I do. I see there are a couple of viable looking RTOSs making good progress.


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.


> 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...

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.


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

To be fair that is largely because they aqquired Freescale, the year before they had almost the same market share.


> I'm not sure if I'd say that, previously NXP did the exact same thing with i.MX7

And before that, they had their Vybrid line that's a A5 paired with an M4.


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


Hobbyists and tinkerers like us are somewhere between completely irrevelevent and mostly irrevelent when it comes to market share.


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


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


Likely true. In Automotive and likely also some other industries also Renesas is huge. However in hobby circles one never hears about them.


> They're hardly the up and coming underdog

Didn't mean they're an underdog as such, one can still be up the top and push hard. Many just don't.

> the things you mention are pretty much par for the course

As I said my background was Arduino, and the ARM offering from Atmel is a lot more expensive from what I can gather. I don't know too much about the others. Coming from the Arduino, the peripherals of most STM32s are something else.

edit: of course the price point is also a big factor in this, with the "Blue Pill" and similar dev boars in the <$2 delivered range.


A background of arduino gives you a view of the microcontroller world that is like climbing a minaret in the smog in delhi gives you a view of the himalayas.


I haven't looked around, but the 10x10mm form factor seems quite small for an A7 product. And they have some shared memory which should be an advantage over a serial interface between two separate processors.


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.


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...


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


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


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


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.


> 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.


Then you get what you pay for.


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


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.



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.


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.


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/


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


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...


> 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...


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


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


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.


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


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.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: