5 ms·
Ada and Spark on ARM Cortex-M – A Tutorial with Arduino and Nucleo Examples
- addaon 7mo agoAt a lower level in the formal verification stack than this, it's on the one hand awesome that ARM has published a machine readable architecture specification for the more recent A architectures in ASL... and on the other hand extremely frustrating that they haven't done the same for M.
- topspin 7mo agoLooks as though ARM is doing ASL for Armv8-M. "For example, the ASL code published through the A-Profile Arm Architecture Reference Manual, Exploration Tools downloads for A-Profile, or the Armv8-M Architecture Reference Manual." https://developer.arm.com/architectures/architecture%20specification%20language https://developer.arm.com/architectures/architecture%20speci...
- addaon 7mo agoI hadn't noticed that... wonder if it's new. Just downloaded the Armv8-M ARM (nice acronym) and... this might be helpful, but man extracting this stuff from a PDF seems error-prone and the wrong way to do it.
- topspin 7mo agoThey first published the Armv8-M ASL around 2017. I suspect you've believed that this didn't exist due to the predominance of pre-Armv8-M devices in the market: there is no ASL for Armv7-M and earlier, and devices based on these older cores remain extremely common (STM32F1x, etc.) The good news is this is changing as new devices appear. The bad news is there probably will never be ASL published for older cores.
- addaon 6mo agoI doubt you'll see this but... any chance you know if and where the XML files of the ASL are available for Armv8-M (or Armv8.1-M)? The ASL is embedded in the reference manual PDF, but for Arm*-A there's a structured XML that's way less nasty to work with…
- Neywiny 7mo agoI'll read more later but just keep in mind nucleo is a series of form factors. There's even M33 on a -144 which is ARMv8-M
- cestith 7mo agoI always enjoy stories about Ada, Pascal, Object Pascal, Prolog, Perl, OCaml, Standard ML, Forth, Pike, Fortran, Scheme, Common Lisp, or some APL derivative in use in the wild. It’s especially good to see a story about a recent project on a smaller system using Ada.
- varispeed 7mo agoCortex-M is a lovely platform. Shame it has stagnated. Both STM32H7 (or N6) or NXP RT1170/80 beg for a major update - more performance, inclusion of NEON (or equivalent), support for DDR3 at least, PCIe? It would be amazing for doing some more complex DSP. Otherwise using those platforms is a bit like programming on 8086 today. Fun. You get basic stuff done and then you hit a wall. Only option is to jump on SoM stuff or FPGA which is another can of worms in itself.
- maximusdrex 7mo agoST seems to consistently put out faster chips [1]. I think the better question is why bother though? The real reason to use a Cortex-M is determinism in hard real-time systems. I'm sure DDR3 and PCIe would be cool in an MCU and people would certainly make some interesting things with it, but at that point you either aren't making a hard real-time system and would benefit greatly from an MPU, allowing you to run Linux and benefit from the wealth of drivers available for these interfaces, or your real-time deadlines are so tight an FPGA would be a better choice. The real advantage of the Cortex-Ms is that they can be manufactured on ancient process nodes for next to nothing. The moment you don't care about that, why not upgrade to an i.MX8? [1] https://www.st.com/content/st_com/en/campaigns/stm32v8-high-performance-cortex-m85-mcu-z11.html https://www.st.com/content/st_com/en/campaigns/stm32v8-high-...
- varispeed 7mo ago> ST seems to consistently put out faster chips [1]. They have not released anything in years, only modest incremental updates. STM32V8 is a welcome update, but it is nothing ground breaking and not available yet. > The real reason to use a Cortex-M is determinism in hard real-time systems. Correct. > but at that point you either aren't making a hard real-time system and would benefit greatly from an MPU Why not? > allowing you to run Linux and benefit from the wealth of drivers available for these interfaces It is precisely to avoid running Linux and the "wealth of drivers". > or your real-time deadlines are so tight an FPGA would be a better choice When MCUs were not good enough, the FPGA was a sensible choice. That said you won't get Cortex-M7 core on FPGA and other cores might be available, though there is not going to be any substantial performance improvement, unless you want to spend unreasonable amount of money (talking 5 figures at least). What I am trying to point out is that there is a huge market gap. i.MX8 is not realtime and the support for running bare metal code is very much non existent.
- MisterTea 7mo agoGood to see Ada on the front page. I played with it years ago and just recently decided to start learning Ada again. So far I am just using Gnat on Linux writing small programs and packages. I like how the syntax is expressive and reads naturally while relying heavily on types. edit: should add that is has its warts. Things like Wide and WideWide Character and String objects for unicode. And the interesting attribute syntax: Object'Attribute was built-in and not available to the user until Ada 2022.
- ajxs 7mo agoSome of my first experiments with Ada were based on this tutorial series! Great to see it on the front-page of HN. Since this was published, it's become a lot easier to set up an ARM toolchain using Alire, Ada's package manager. AdaCore have also created some new tools for auto-generating the startup code for ARM systems: https://www.adacore.com/blog/ada-on-any-arm-cortex-m-device-in-just-a-couple-minutes https://www.adacore.com/blog/ada-on-any-arm-cortex-m-device-...
- SwuduSusuwu 6mo ago[dead]