I want to start "playing" with ARM micros - Page 1
Forum section: electronics / general

author: davep238
author_rank: Contributor
timestamp: December 20, 2024, 03:27:44 pm
content: I'm 69, retired, and bored. In the past I've done embedded programming on 8-bit micros using C and assembler. The MC6809 is my favorite 8-bitter. A long time ago, I also programmed on PCs using Turbo C and Turbo Pascal. More recently, I've fooled around with Arduino, creating simple holiday light displays. I've also been doing some Xilinx CPLD and FPGA designs using VHDL. Lately, I've written Windows 10 console apps using C and compiling with mingw and gcc.I'd like to get into working with ARM micros. I don't have anything in mind at all, thus "playing". It seems like ST is a big player, but I see people griping about HAL and the tools. Is ST still good to start with, or should I be looking at other vendors and tools?Thanks.-Dave Pollum

author: Dazed_N_Confused
author_rank: Contributor
timestamp: December 20, 2024, 03:33:21 pm
content: Quote from: davep238 on December 20, 2024, 03:27:44 pmYou don't have to use HAL they have LL and you can also breakout the reference manual if you like and do bare metal.STM also has cheap Nucleo boards that can be had for 10 to 15 bucks

author: Siwastaja
author_rank: Super Contributor
timestamp: December 20, 2024, 03:58:33 pm
content: ST is fine, everyone else is fine too. Continue the PIC way, don't use manufacturer's bullshit libraries.

author: brucehoult
author_rank: Super Contributor
timestamp: December 20, 2024, 09:53:08 pm
content: Quote from: davep238 on December 20, 2024, 03:27:44 pmArm is everywhere outside of PCs and servers! As someone said in the 1970s (about IBM) "Arm isn't the competition, it's the environment".If you're wanting to do bare metal programming, as you were on everything you mention except Windows 10 console apps, then I'd suggest the best "toe in the water" approach right now is the RaspberryPi Pico, or better the Pico 2 which has twice the speed, twice the RAM, and lets you try RISC-V as well as Arm.Raspberry Pi hardware is not the cheapest -- though the Pico 2 is only $5 -- but they have superb documentation of the chip (which they designed themselves, using an Arm Cortex-M33 Arm core and their own RISC-V core (which is itself open source)), example code and tutorials, and a huge community.Physically programming the Pico is simplicity itself. You compile your program to a ELF file, plug the Pico into your PC/Mac/Linux, it appears as a disk drive, and you simply drag your Arm or RISC-V program on to the disk (or use a command line file copy command) and then reboot the Pico.Take a look at the documentation here:https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html

author: mwb1100
author_rank: Frequent Contributor
timestamp: December 20, 2024, 10:05:22 pm
content: Many of ST's Nucleo boards are extremely cheap. I'd suggest looking around for books or a blog with a tutorial that you like - especially if there's an active community/forum - then buy the devkit they are using.Espressif ESP8286 and ESP32 gadgets are also super cheap and have a lot of online tutorials and examples. They aren't ARM chips though.Personally, I'd go for an STM32 ARM Nucleo devkit for starters. But I'm probably biased from having done STM32 stuff for a long time.

author: Dazed_N_Confused
author_rank: Contributor
timestamp: December 21, 2024, 12:08:05 am
content: Quote from: mwb1100 on December 20, 2024, 10:05:22 pmIt should be noted that all Nucleo's come with a builtin ST-Link V2 programmer that you can easily break off (by design) and use with all STM32 and STM8 micros.

author: luiHS
author_rank: Frequent Contributor
timestamp: December 21, 2024, 02:09:26 am
content: MCU; RT1024 or RT1064 from NXP, any STM32 from ST.Programmers; Stlink V3 for STM32, MCU-LINK for NXP.Development environments; MCUXpresso for NXP, STM32CubeIDE for STM32.There are very cheap evaluation boards for all these microcontrollers, I have them for STM32H747, RT1024, RT1064 and RT1176, you can buy them at Mouser.

author: betocool
author_rank: Regular Contributor
timestamp: December 21, 2024, 02:49:11 am
content: I've gone the STM32 way and haven't looked back!I started compiling under Linux when you had to build your own compiler, these days ST offers the whole suite of IDEs and board configurators in one place, which makes it very easy. Some people complain about the configurator and the libraries, I use a mix and match approach. Configure the chip in the configurator and then add or change peripherals manually (especially interrupts!). To each their own I guess.I started with an STM32F103 and built a small guitar effects processor out of it, it worked ok for 72MHz. Last I built was an audio spectrum analyzer using an STM32H7 that sends live audio data to a PC over Ethernet. I guess it depends on what your application is. Best way to start with a microcontroller is a blinky, and then think of something that would be fun for you. You may have to build a bit of hardware around, but that's part of the fun.Cheers,Alberto

author: NorthGuy
author_rank: Super Contributor
timestamp: December 21, 2024, 08:43:16 pm
content: Quote from: davep238 on December 20, 2024, 03:27:44 pmARM covers everything from primitive MCUs with M0 cores, through very fast MCUs, through MPUs capable of running Linux and Single-Board-Computers, through Mac and high end Windows Surface laptops, to very expensive servers with enormous amount of cores.STM manufactures devices from the bottom half of the spectre."HAL" and tools are roughly the same across all the manufacturers. Luckily, you do not have to use any of the tools except the compiler chain.

author: Warhawk
author_rank: Frequent Contributor
timestamp: December 21, 2024, 11:26:20 pm
content: Quote from: davep238 on December 20, 2024, 03:27:44 pmST Micro has by far the biggest funclub. There are also plenty of STM32 copies from China. If you want to try something different then TI has recently released a new MSPM0 family that is, in my opinion, interesting. Also, packages are not bad. Most importantly, there are libraries that work well and plenty of simple examples as a part of the MSPM0 SDK. (Software development kit). My favorite part for now is MSPM0L1306.You should be ready with just the launchpad:https://www.ti.com/tool/LP-MSPM0L1306PS: I am a TI employee thus I might be biased

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 22, 2024, 12:56:45 am
content: There is so much available that it's hard to recommend anything - we'll all be biased. For sure STM32 are popular and pretty good, with a wide range of MCUs, from ultra-low power to "high-performance" Cortex-M7 stuff, with a wide range of peripherals too. But there are tons of alternatives.Also, although there are still not as many available for now, I would suggest looking at RISC-V MCUs.You can find dev boards of either for just a few bucks these days, so if you have time and even if your means are limited, you can experiment with various vendors and see what you like best!

author: westfw
author_rank: Super Contributor
timestamp: December 22, 2024, 01:20:17 am
content: If you didn’t hate Arduino, there are a bunch of ARM-based arduino-compatible boards.. Adafruit has a good range.

author: WillTurner
author_rank: Regular Contributor
timestamp: December 22, 2024, 01:23:43 am
content: How about the (printed) book :-Smith, Stephen "RP2040 Assembly Language Programming", Apress, 2022?I hope there is an RP2350 version on the way.

author: brucehoult
author_rank: Super Contributor
timestamp: December 22, 2024, 01:25:04 am
content: Quote from: SiliconWizard on December 22, 2024, 12:56:45 amAs I said before, for $5 a Raspberry Pi Pico 2 lets you look at both Arm and RISC-V in one board, using all the same peripherals, and with some of the best documentation around. The only real asymmetry is they put an Arm with FPU, but integer-only RISC-V.

author: brucehoult
author_rank: Super Contributor
timestamp: December 22, 2024, 01:28:44 am
content: Quote from: WillTurner on December 22, 2024, 01:23:43 amCortex-M0 / Thumb1 (RP2040) is a bit of a PITA in assembly language because access to the upper 8 registers (5 GP after removing PC, LR, SP) is so restrictive -- you can only do MOV, ADD, CMP, and BX using them.RP2350 (Pico 2) has a much more natural and flexible instruction set on the M33 .. and on the RISC-V Hazard3 too.

author: cfbsoftware
author_rank: Regular Contributor
timestamp: December 22, 2024, 02:44:12 am
content: Quote from: brucehoult on December 22, 2024, 01:28:44 amI don't see it as being a huge problem if you are writing assembly language by hand. Still having access to the 8 lower general purpose registers is still a bit of a luxury compared to the 'good old days'.In our Astrobe Oberon language compilers we use the best of both worlds. Initially we only used the 32-bit Thumb-2 instruction set for M3, M4 and M7 as it was much simpler than having to contend with a mixed 16-bit/32-bit instruction set. However, after we had to tackle the (mostly) 16-bit Thumb-1 instructions for Cortex-M0 we introduced these as optional instructions for M3. M4 and M7. It was surprising how much of the code could use these and save code space. Having only the lower 8 registers generally available in Thumb-1 in the Oberon compiler was only really a limitation when using registers for local variables and for passing parameters. There are more than enough registers available for complex expressions using array indexing, record field addressing etc. etc.All of this work was initially done on STM microcontrollers. The M33 is very similar to M4 so when the RP2040 and RP2350 came along the main work we had to do was to port the initialisation code and peripheral libraries. SPI was very similar, I2C had the most differences. Once that was done it was an easy job to get our STM Nucleo board application examples working on the Raspberry Pi Pico and Pico 2 boards.There are other performance advantages when using Thumb-2 over Thumb-1. We have described these in a simple performance comparison between the RP2040 and RP2350:https://www.astrobe.com/forum/viewtopic.php?f=19&t=803

author: wilfred
author_rank: Super Contributor
timestamp: December 22, 2024, 03:07:52 am
content: I found this course available on YT channel Quantum Leaps. It seemed good to me and is well presented, clear and logically organised. It started out using the IAR toolchain but by this video switched to more freely (and free) open source compiler along with Code Composer Studio from Texas Instruments.For this and no other reason I suggest the TI TIVA Launchpad used in the course. Available from Mouser.https://au.mouser.com/ProductDetail/Texas-Instruments/EK-TM4C123GXL?qs=TB%2FQ0sBK%2FGefKGr%252BQsiJWQ%3D%3DTI also sold it and that was where I bought them. Back then TI had various special offers and I got them so nearly free I couldn't resist.Ultimately I think for someone like me who was a complete beginner the course was it and the chip platform was a secondary consideration. I'd like to say price was a distant third but I got them very cheap. But even for 20-30 dollars it is still hours of fun and education.

author: ocelot
author_rank: Contributor
timestamp: December 22, 2024, 04:10:53 pm
content: After years of wallowing about with Eclipse based IDEs that are sluggish and sometimes inconsistent when it comes to setting up projects, I switched to using VS Code, as I also use that professionally for developing C/C++ at work.There are a few plugins for VSCode that allows you to talk to ARM debuggers, both STLINK style and CMSIS/DAP style (via OpenOCD)I use STM32 Blue Pill boards in a lot of small projects, mostly around my old VW camper van, things like an ECU controlling the ignition, a sensors computer and a dashboard display computer.I think that I may switch to the Raspberry PI 2040 boards soon, but I have worked with STM32 for years as a hobbyist and at work (biggest system having 14 MCUs, seven running ChibiOS, seven supervisors using bare metal, all networked over CANBUS on a one-off project)I have used STM32 ever since being made redundant by Philips, and so never again specifying any of the Philips/NXP parts in revenge...

author: davep238
author_rank: Contributor
timestamp: December 22, 2024, 04:46:49 pm
content: Quote from: westfw on December 22, 2024, 01:20:17 amI don't hate Arduino. I've used the UNO, and although very limited, was fine for my simple projects. I'll take a look at the ARM Arduino compatible boards. Thanks for the suggestion.-Dave

author: davep238
author_rank: Contributor
timestamp: December 22, 2024, 04:59:10 pm
content: Quote from: mwb1100 on December 20, 2024, 10:05:22 pmSince I don't have any projects in mind, finding a blog or tutorial sounds like a good idea. Thanks.I already have a bunch of obsolete FPGA dev boards, and don't want to repeat that with micros, although I know that the microcontroller devkits are waaay cheaper.I am looking for something more powerful than an 8-bitter. Thus, ARM. However, I know that RISC-V is starting, too.It seems like the industry spent little time on 16-bitters and just jumped to 32-bitters.-Dave

author: Siwastaja
author_rank: Super Contributor
timestamp: December 22, 2024, 06:20:13 pm
content: Well, microcontrollers don't go obsolete in the performance sense; if they are good for task X now, they are good for task X in 20 years, too. Of course with new micros, scope widens, but computationally "simple" projects are not disappearing. (And that "simple" can be quite astonishing for today's $2-3 32-bitter; they are overkill for 95% of projects today, and will be overkill for many projects still in 2035.)But keep in mind that a devboard/demoboard with a discontinued MCU isn't that useful; you can use it to do one-off hobby projects but can't then order the MCU from Digikey and make a PCB for it.Your best bet is to look which MCU is very popular (like in top-10) and has been there for a few years. Like, ATMega328 was very popular in 2010, and consequently, you can get ATMega328(P(B)) today even though it's much less popular now, and many other Atmel MCUs from the same era has been discontinued (or are to be discontinued in near future), and even though 8-bitters in general are in decline. So those old Arduino boards are still just as useful they were when shiny and new, thanks to them being popular.Same with 32-bit ARM. Just because a chip is ARM and 32-bit doesn't mean it's going to be here forever. But if you pick some of the most popular chips chances are better than with some esoteric part randomly picked from Digikey's parametric search only because it seems to fit your requirements best now. Manufacturers like ST have some commitment how long they produce the part, but those (quite a) few parts that sell really well obviously get extended.Then again - remember, a devboard is not an absolute necessity! I have been using devboards for FPGAs because of their relative PCB complexity, but last time I used MCU devboard was in early 2000's (Atmel STK200 bought in 1999). After that, for quick testing, I have just taken an MCU, glued it dead-bug on a piece of copper clad or even plastic, and soldered some wires. For 0.5mm pitch QFP packages, an adapter PCB might make your life easier (still optional, you can dead-bug+air-wire these, too). If you then so wish, the prototype becomes a permanent one-off by applying some glue to hold things together, or you can desolder the few IOs that are different in the next project.

author: tooki
author_rank: Super Contributor
timestamp: December 22, 2024, 07:14:09 pm
content: Quote from: Dazed_N_Confused on December 21, 2024, 12:08:05 amAll the Nucleos have some version of ST-LINK built in, but there are several versions, and not all are designed to be separated. (For example, the Nucleo U575ZI-Q board I have has a built-in STLINK-V3E, which is not removable.https://www.st.com/resource/en/data_brief/nucleo-u575zi-q.pdf)

author: TomS_
author_rank: Frequent Contributor
timestamp: December 22, 2024, 09:14:46 pm
content: Quote from: davep238 on December 20, 2024, 03:27:44 pmYou can read horror stories all day about vendor X, Y or Z's tools. But what you often don't read are the countless other stories from people who are just getting on with the job with a set of tools that works for them.Me personally? I use PIC microcontrollers, and I use MPLABX and Microchip compilers to do my development for them - just as Microchip intended. Depending on who you ask, this combination is a steaming pile of junk. But I must somehow be lucky, because I don't seem to have any major issues with it. Is it perfect? No, surely not. There are occasional little niggling issues, but nothing that is a complete show stopper like some people seem to claim. Or maybe my use cases just don't bring me into the same territory as these other people. I'm still writing, compiling, and debugging code with the same tools as them though... But what ever the circumstances, I feel like I've got a "good news story" to tell about Microchips tools.IMO forums tend to be biased towards negative reviews because people have to vent when things aren't working the way they want it to. However, consider all of the projects that have been completed successfully, and if these tools really didn't work then would any of them have been completed at all?So the basic gist of what I'm trying to say is, you wont know about something until you try it yourself and form your own opinion. Dev boards are cheap, and a lot of the software development tools are free. If you're just tinkering, give a couple of them a try and see how you go. You'll gravitate towards what works or feels best for you.

author: __george__
author_rank: Contributor
timestamp: December 23, 2024, 01:24:50 am
content: If you are interested in exploring different chips a good approach in my opinion is to get a cheap DAPLINK debugger for a couple of dollars and then get cheap small dev boards from different manufacturers.Most of the popular enough companies (ST/NXP/TI/Nordic/Silabs/Atmel etc) have a lot of educational material (even online courses!) which you can use to have some funIf checking different options is not interesting for you, I would also go for an Nucleo board. Keep in mind that there is an (unofficial) Arduino core called stm32duino which supports a good selection of Nucleo boards, they keep a list of the supported boards here:https://github.com/stm32duino/Arduino_Core_STM32/blob/main/README.mdSo with a Nucleo you can both experiment with ST's ecosystem and with the Arduino ecosystem as well.ST is not the only one which has this of course, Arduino actually keeps a list of all the third party cores:https://github.com/arduino/Arduino/wiki/Unofficial-list-of-3rd-party-boards-support-urls

author: westfw
author_rank: Super Contributor
timestamp: December 23, 2024, 02:33:23 am
content: QuoteI agree. In addition to the register limitations (which aren't THAT bad - you still have 8x 32bit registers), you have other annoyances like:Lack of the Thumb2 instructions, including the "flexible second operand." That means only a couple instructions have "immediate" operand modes.Very limited ranges on Immediate operands, including offsets for index addressing and such. None of the "8bit value shifted by N bits) (which is part of the "flexible 2nd operand.")Limited conditionals. Missing "set flags" or "don't set flags" modes for instructions.

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 23, 2024, 02:36:17 am
content: Yep, I'm probably biased here, but definitely RISC-V assembly, even in its lowest common denominator (RV32E) is a LOT nicer.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: December 23, 2024, 03:24:06 am
content: How serious do you want to play this?If you like "arduino", you can just stick with it, as already mentioned there are plenty of Arm Cortex boards which work with arduino. Mostly ATSAM, but others too. There are some STM chips supported, and that Raspberry thing (which is a dual core processor, with nifty I/O). Another "easy entry" may be with Teensy boards. Teensy uses NXP. There is a big hobby community around those.If you want to go C on bare processors, (or the simplest breakout boards). Apparently the tools around NXP are of better quality then STM. From Atmel / Microchip, I only use the old Mega's. I've been programming them for years before "arduino" existed and put a lot of effort in my own libraries. I find Atmel / Microchip very annoying, It seems like they make a new and incompatible line of micro's every 5 years or so.

author: brucehoult
author_rank: Super Contributor
timestamp: December 23, 2024, 03:33:41 am
content: Quote from: Doctorandus_P on December 23, 2024, 03:24:06 amTeensy was all originally AVR. It's only the 4.0/4.1 that use the big grunter 600-960 MHz NXP Cortex-M7.They all support the Arduino IDE and libraries. Teensy 4 has a very slick OOBE with the Arduino IDE.The only thing is $20+ Teensy 4 with just 1 MB RAM looks expensive these days compared to cheaper full-Linux boards such as the Pi Zero & Zero 2 with 512 MB RAM (and quad core on the Zero 2) or the $5 Milk-V Duo with 64 MB RAM and 1 GHz Linux CPU plus 700 MHz 64 bit microcontroller CPU which supports Arduino.

author: brucehoult
author_rank: Super Contributor
timestamp: December 23, 2024, 03:40:54 am
content: Quote from: SiliconWizard on December 23, 2024, 02:36:17 amThat's CH32V003 (actually RV32EC).The RISC-V CPU in the Pi Pico 2 / RP2350 is pretty full on other than lacking FPU. A full set of 32 GPRs, plus lots of (standards-conforming) extensions for things such as register-plus-shifted-register for address generation -- not an addressing mode as in Thumb2 but more like an LEA instruction. Also lots of extra bit manipulation instructions including single bit operations (handy on a microcontroller) and multiple-register push/pop for function entry/return.

author: richnormand
author_rank: Unknown
timestamp: December 23, 2024, 04:09:02 am
content: "I'd like to get into working with ARM micros. "https://www.edx.org/learn/embedded-systems/the-university-of-texas-at-austin-embedded-systems-shape-the-world-microcontroller-input-outputTook it a while back and it was was excellent. Used ARM micro from TI.At the time it was free with graded exams and such.I am sure EDX has similar offerings now. Taking the course real time with exams is much nicer than an archive course with Q/A support from the profs.

author: wilfred
author_rank: Super Contributor
timestamp: December 23, 2024, 04:29:04 am
content: Quote from: richnormand on December 23, 2024, 04:09:02 amI didn't want to register a new account and tried to sign in with my microsoft email account. It didn't let me use a personal email account and suggested I use a school account email address.It also says it costs $200 if you want the graded exams and the certificate. But I see Jonathan Valvano listed and I have seen some good videos on YT on his channel.https://www.youtube.com/@JonathanWValvano/videosBut I want to commend you for actually suggesting something directly on target with the OP's desire to learn ARM architectue and programming.

author: westfw
author_rank: Super Contributor
timestamp: December 23, 2024, 06:42:55 am
content: QuoteThat's MOST of the STM chips, these days. (Since ST took ownership of the main "core", and built it on top of the LL libraries.) There is also an older core that support just a couple of chips (Blue Pill with STM32F103, mostly), but do so on VERY bare metal (IIRC, not using ANY ST IP, due to fear of licensing issues back then.)Also ARM based are a bunch of Nordic Semiconductor boards, aimed at IoT stuff. In addition to the "Arduino layer" these also add an OS (MBed, I think) to support the network stacks.)QuoteThat's unfortunate. I took the class the first time it was offered (when it was free), and it is indeed quite good, and closer to bare metal than most "intro" choices. On the plus side, they put a lot of work into making the grading work on live hardware that YOU run, which is pretty cool. Also, the same TI board is (was?) also supported by Arduino.On the minus side, the chip they were using is getting a bit outdated WRT TI's current lineup. (Hmm. The development board is still sold, though.https://www.ti.com/tool/EK-TM4C123GXL)QuoteIMO, that's the wrong way to look at it. $20 isnotexpensive. It may be less powerful compared to similarly priced boards from elsewhere, but a closer-to-bare-metal board has advantages if you're trying to learn ARM Architecture, instead of "linux." Only the heavily mass-produced boards (from RPi or China) are likely to hit less than $20 for a full development board.

author: Siwastaja
author_rank: Super Contributor
timestamp: December 23, 2024, 07:34:47 am
content: Quote from: TomS_ on December 22, 2024, 09:14:46 pmIt works because 8-bit PIC microcontrollers are relatively simple and projects are at most medium complexity, also Microchip has been pretty conservative in changing their software offerings compared to some others (people complain about any change, but people complain anyway; but writing C for PIC, compiling and flashing has basically stayed the same). Being low to medium complexity, PIC projects tend to have one developer. Also those who use PICs are also likely to use PICs for everything. Therefore just having a Windows machine and MPLAB installed on it to do the job works just fine.Things get different with larger projects; teams working on them; external libraries; possibly many different microcontroller families involved. Now you suddenly need real software development practices, including versioning, tool standardization, using scripting instead of pointy-clickys, using actual code instead of code generation, ... And now, imagine that exactlydueto this complexity of projects, manufacturers think they can create business value by monetizing this need, and provide tools that manage all this, yet these tools doexact opposite, drive the situation worse. When code generation needs to be get rid off, they addmorecode generation. When pointy-clicking needs to be replaced with code, they create a library which makes writing codeeven more difficultandthenadd a pointy-clicky code generator to generate this impossible-to-write-by-hand code. This is what ST Cube et al really are.It is an unsustainable equation: it still workswhenthe use case is as simple as PIC. When you still develop on a single computer. When you still don't use anything else than one microcontroller family (e.g. STM32). When reliability and maintainability doesn't really matter; gettingsomethingquickly suffices. And when you are a young and eager hobbyist for whom transitioning into new paradigm every few years is fine. But as soon as you break out of these constraints, everything falls apart. This is why we see frequent threads describing the pain of installing, maintaining and updating three different IDEs and development frameworks, one of each going obsolete and transitioning into new framework every year, and creating instruction manuals with screenshots of what to click on pointy-clickys, and so on.It ismucheasier in the long run to just adopt normal software development practices: use classic tools; write code and scripts to do things, avoid pointy-clickys and code generation. Luckily, with ARM microcontrollers none of this shit is needed. (Compare this to 8-bit PIC, where Microchip's own compiler is the only option.)This is also why I think the moment you go from PIC to ARM is exactly the right point of getting rid of the manufacturer tools. They maybe covered 99% of PIC use. Same isn't true for ARM anymore.

author: Kjelt
author_rank: Super Contributor
timestamp: December 23, 2024, 07:55:24 am
content: get an nucleo board, get an st.com account, login.Then goto the STM32 Youtube MOOC and follow the course.Expect 40 - 60 hours of studying and playing along with the board.the MOOC is one of the best courses for ST environment covering basics to detailed peripheral configuration as ARM microcontroller manufacturers make.It is as following a paid two week course for free. After that you can choose to go different manufacturers, go bare metal low level or stick to Cube or perhaps back to the Arduino depending on what you like. At least you will have a solid foundation.

author: tooki
author_rank: Super Contributor
timestamp: December 23, 2024, 04:32:45 pm
content: Quote from: __george__ on December 23, 2024, 01:24:50 amThat began as an unofficial core, but it later came under ST’s stewardship and is now the official STM32 core for Arduino. (The link you posted of the list of cores even calls it out as “official”.)I agree that the Nucleo boards are a great approach due to supporting both the OEM and Arduino frameworks. I also found the stm32duino people to be extremely responsive: I found a bug in a board definition (LED pin assigned wrong) and they fixed it within hours.The MCU family I have used the most is ESP32. Compared to that, Nucleo boards have a much better debugger, and the compiler is also much faster. (It’s remarkable how slow the ESP32 (Xtensa) compiler is. The compilers for STM32, AVR, and RISC-V are way faster.)

author: __george__
author_rank: Contributor
timestamp: December 23, 2024, 04:47:57 pm
content: Quote from: tooki on December 23, 2024, 04:32:45 pmHm, that's interesting, because I saw the statement that it is not officially supported in the STM32duino organizations page which says:QuoteBut good to know anyway

author: tooki
author_rank: Super Contributor
timestamp: December 23, 2024, 04:51:16 pm
content: Yeah, I saw that too. But nonetheless, it’s the one that has ST’s blessing. I think by “not part of the official ecosystem supported by ST”, they mean that ST won’t help if you contact them for support the same way they would if you find a problem in their HAL.

author: __george__
author_rank: Contributor
timestamp: December 23, 2024, 04:58:24 pm
content: Yeah, that makes sense. They just don't want to get "official" support requests about the core, that's all it seems.

author: DavidAlfa
author_rank: Super Contributor
timestamp: December 23, 2024, 07:41:20 pm
content: I'd try a basic mcu like the Stm32G0 series, higher end models are quite complex and overwhelming.HAL is ok for starting or simple projects, you'll learn a lot by checking the generated code.Unless you really like that, going baremetal without any libs is kinda time consuming, LL is really good.

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 23, 2024, 08:43:23 pm
content: ST's LL is pretty bare and if you only use its header files (it also has some higher-level, albeit not as high-level as the HAL, in its C files, but you absolutely don't need them), it's only a very thin layer above registers, and unless you have a very good reason for doing so (and enough experience for that), rolling your own, which is probably going to be pretty similar, may make little sense. Contrary to the HAL, it does very little else than encapsulate registers access.One nasty thing with ST is that they have removed all makefile-based projects from their SDKs (they used to provide some), which makes finding out the right compiler options and defines much more annoying than it used to, and is further pushing people to use those stoopid point-and-click IDEs instead of using their own makefiles (or cmake stufff).For those interested, here are CPU/arch GCC options for a few of the STM32 series I've worked with:Code:# STM32 L4 & F4:-mthumb -mthumb-interwork -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard# STM32 G0:-mthumb -mcpu=cortex-m0plus -mfloat-abi=soft# STM32 U5:-mthumb -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hardTo avoid linking unused code/data, you can also use these more general options:Code:-ffunction-sections -fdata-sectionsAnd finally, typical linker options are:Code:--specs=nosys.specs --specs=nano.specs -Wl,-T<linker script>,-Map=<map file>,-o<elf file> \-Wl,--gc-sections,--no-warn-rwx-segment,--print-memory-usage

author: ocelot
author_rank: Contributor
timestamp: December 23, 2024, 08:50:59 pm
content: Quote from: SiliconWizard on December 23, 2024, 08:43:23 pmAnd with the later GCC versionsCode:-fltofor Link Time Optimization - the compiler additionally effectively saves the program source after initial parsing in an ELF section, and then when you link the code again with -flto, it actually does the call optimization.So you find that functions get inlined, or partially or completely deleted from call hierarchy, because global optimisation can take place. Difficult to debug/trace but can reduce code size by an extra few percent..This is further optimisation than just using/not using functions and code- by using theCode:-ffunction-sections -fdata-sections. That leverages the linker's rule that if nothing from a named section of the ELF file is used, it is not included in the final binary. So by putting every function and data block in a different section, it can eliminate the unused sections.If libraries are also compiled with LTO, even the library code gets optimized into your code.The price you pay is much larger ELF ".a" files before linking, but you gain final linked program space.If on the other hand you link one of the ".a" ELF files containing the LTO data, without the Link Time Optimization option in future, it just uses the original machine code also stored in the usual place in that same ELF file, so that can be debugged fairly sensibly - it will preserve all the function names and call hierarchy.

author: DavidAlfa
author_rank: Super Contributor
timestamp: December 23, 2024, 10:04:44 pm
content: -flto can cause weird issues, so use with care.

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 23, 2024, 11:53:44 pm
content: Quote from: DavidAlfa on December 23, 2024, 10:04:44 pmI wouldn't recommend it either, especially for embedded stuff.

author: peter-h
author_rank: Super Contributor
timestamp: December 24, 2024, 01:11:57 pm
content: I come from a similar background to the OP, even down to doing Xilinx FPGA work. I am of a similar age but not retiredNow working on STM32 (32F417/437). Cube IDE. A bit of a learning curve but it's OK. The Cube MX "code generator" gets you started with trivial projects and after that it is, as always, real workMX generates the "HAL" code fragments and they are handy for seeing how stuff works at low level but is best avoided for any real functionality.But this stuff is pretty complex (especially when you get into LWIP, FATFS, MBEDTLS, FREERTOS, ETH, USB, etc) and I hope this hardware platform will do me for the rest of my life expectancyST do not support their chips unless you are a huge user. So you are on your own. I've learnt a lot by posting Qs here.There is also the ST forum but is it full of "my LED does not blink - HELP" posts and almost nobody on there helps you. Just sometimes they do...

author: NorthGuy
author_rank: Super Contributor
timestamp: December 24, 2024, 03:12:27 pm
content: Quote from: Siwastaja on December 23, 2024, 07:34:47 amMicrochip tools are similar to STM. They have MCC which does the same as Cube. Much more similarities than distinctions.

author: Siwastaja
author_rank: Super Contributor
timestamp: December 24, 2024, 04:29:23 pm
content: Quote from: NorthGuy on December 24, 2024, 03:12:27 pmI was specifically commenting on 8-bit PICs. It is different from ARM development in two important ways:* Project complexity is limited by limited hardware anyway;* There is unavoidable vendor lock-in anyway because C compiler choice is limited due to the esoteric ISAWith ARM, there are similarities (CPU core, SWD, ...) between even different manufacturers - something you didn't have e.g. between PIC18F and ATMega. These similarities give a new opportunity oftool sharing. For example, I use same compilers, same flashing tools, same debugger, same code editors, same startup files and very similar linker files for STM32 and nRF52. Therefore, I avoid vendor lock-in in two senses: locking into manufacturer, and locking into their specific workflow (which changes every few years).As a result, if and when one transitions from simple 8-bit microcontrollers into more complex ARM projects, in my opinion it is a excellent opportunity to get rid of vendor lock-in, vendor specific software, and code generation, and start adopting software development practices like version control and expressing programming intent as code (instead of graphical code generation suites). I'm very happy that I did.

author: NorthGuy
author_rank: Super Contributor
timestamp: December 24, 2024, 05:29:38 pm
content: Quote from: Siwastaja on December 24, 2024, 04:29:23 pmI use a text editor with various compilers to write code for PC, Mac, Linux, various MCUs. There are many different compilers, which get invoked depending on the target. This doesn't bother me a bit. If necessary, I can add new compilers, which may take may be an hour to set up. The only IDE I still use is Vivado, mostly because of its graphical FPGA editor.

author: fchk
author_rank: Frequent Contributor
timestamp: December 25, 2024, 11:35:02 pm
content: Quote from: davep238 on December 22, 2024, 04:59:10 pmThere is also PIC32. If you know 8-bit PICs you will feel at home very quickly. And some of them even come in DIL packages, e.g. PIC32MX270F256B-50I/SPhttps://www.microchip.com/en-us/product/pic32mx270f256bVery easy to use on a perfboard, much less complicated then STM32 from a software side of view..PIC32M* uses MIPS, PIC32C* uses ARM. MIPS and ARM are like Coke and Pepsi. MPLABX will take care of the differences, if you want.And: using MPLABX doesn't prevent you from using command line, make, svn/git etc.

author: hans
author_rank: Super Contributor
timestamp: December 25, 2024, 11:58:58 pm
content: I still think the Raspberry Pico is amost funplace to start (especially the v2, perhaps with Wireless, which will be released soon).., especially if you don't have a particular goal in mind yet.It can be programmed with PlatformIO or Arduino. Has onboard bootloader for just uploading programs, or SWD pins for debugging.PlatformIO and Arduino has a large catalog of libraries for sensors, displays, motors. The wireless version has WiFi/BT as well.The hardware is still quite simple and easy to use. The HAL isn't overly complicated. Registers are still friendly to DIY. I'm aware STM32 (or other ARM parts) often have more advanced peripherals and features, but at some points its hobby..The PIO's invite experimentation too and can also bridge some digital gaps..This is basically the largest span from ease of use (uploading the first blinky program shouldn't take more than 10 minutes including IDE installation&setup) all the way up towards advanced usage.

author: MathWizard
author_rank: Super Contributor
timestamp: January 02, 2025, 05:39:27 am
content: So far as a noob to ARM/STM32, I bought a few STM32 Blue Pill clones, and used the ArduinoIDE, to program some basic things onto it. The most frustrating part was getting the USB to connect properly, or getting all the drivers/settings for that.Quote from: betocool on December 21, 2024, 02:49:11 amHi did you make threads for some of those projects ? Now that I know some op-amp circuits, and some assembly and C programming, I have a few audio projects in mind. Maybe a thing or 2 for guitars, but also I have soundcards and mobo "soundcard IC's", and various digital audio IC's I've salvaged. Hopefully some of them can be erased and programmed, if I can find the full datasheets for them.I also have an old mid-1990's guitar effects processor that's getting a bit twitchy, and I'd love to try to watch what a few chips do, and reproduce it if possible w/ AVR or STM32 chips, and mod on my own versions, w/ new parts.I'm just about finished upgrading my Keithley 5.5d DMM to 7-seg LED's, and I'll try and make a continuity tester with it too. Today I'm modding my stereo w/ a ATtiny44A, in the hopes of fixing a digital problem it's having.I have a few things I'd like to add some MCU's to.

author: betocool
author_rank: Regular Contributor
timestamp: January 02, 2025, 07:22:51 am
content: Hey, I don't have a thread here in the forum, but I did publish the details for the hardware on my blogspot way way back in the day. I had a look just now and I updated the links for the images, files, etc, so feel free to use as much or as little as you wish.This is waaaay before my github days, I may have the code somewhere in my backups, let me know if you're still interested and I will look it up and upload it somewhere.The audio dev board I built is here:http://betocools.blogspot.com/2014/02/the-stm32f103-audio-test-board.htmlThe example guitar effects processor is here:http://betocools.blogspot.com/2016/03/the-first-arm-based-guitar-amp-in-world.htmlHope it helps.Cheers,Alberto

author: MathWizard
author_rank: Super Contributor
timestamp: January 02, 2025, 07:48:31 am
content: Wow just looking at your FX processor, that's a proper project, and you even include some math, nice! I very well may make a version. My FX processor is a ZOOM9000. Sometimes even when it has power, it won't turn on, but I never found a power issue. Someday, I'll have to start probing the IC's.Compared to the few AVR projects I've done from scratch, I really don't know how much more complex something like an FX pro. must be, or how fast it would have to be for audio and everything else to be done.1 of the 1st digital audio things I want to make is a timer for my stove, and I'll make it with the piezo from a microwave. I suppose I could mod my microwave, but I don't want to take that apart.

author: ahsrabrifat
author_rank: Regular Contributor
timestamp: January 15, 2025, 08:52:10 am
content: You can start with STM32F103C8T6 blue pill. That is the easiest option coming to my mind.