2019-03-09 06:27 AM
I've got a MCBSTM32F400 development board. Every "getting started" thing I've found (blinky, for example) has like 900 files in the project, and 150,000 lines of code. This is so disheartening. I got into microcontrollers because of their simplicity.
2019-03-09 04:14 PM
Remember for simple projects you may be better off using the STM32 version of Arduino. Then many of the constructs will be familiar to you and you won't even know it;s an ARM apart from running 40 times faster.
2019-03-09 05:44 PM
I need to quickly move to porting over my dsPIC motor controller code. I had just wanted to get the basic motor control stuff like complementary pwms with programmable dead time, A/Ds synchronizing to the center of the pwms, and a single interrupt where all time critical stuff goes (this chip will be plenty fast for that). I'm feeling much better about it now thanks to everyone's help on here. It was just like drinking out of a fire-hose when I first opened the "blinky" project and saw around 100 files.
2019-03-09 05:53 PM
Yes I think things have got a bit out of hand. It can take minutes on an i7 to compile quite a simple program - slower than it used to be in the 1980s on an 8088 !
As all my embedded work is time critical, normally repeating at 96kHz, I usually start by stripping out the bits I actually might need from the libraries into a single personal header file so that the thing compiles quickly.
2019-03-10 03:32 AM
Look ma, no libraries...
It's really not a program, but rather executable bunch of notes. All put in a single file for easy search with a text editor.
https://github.com/turboscrew/blue_pill_init/blob/master/FirstTry.c
2019-03-10 03:41 AM
Yes that looks a good starting point for newcomers to base their first STM32 program on. I had a quick look so maybe it's there but I couldn't see the option for turning the debug port off so that PB4 works. I remember that caused me a couple of days of frustration with my first Blue Pill.
2019-03-10 06:40 AM
But, please, tell me, why do you reinvent the wheel? What's wrong with the CMSIS-mandated device headers?
JW
2019-03-10 06:58 AM
I wanted to learn the HW, not some library. Also, the header-tree tends to be big when the modules depend on each other (GPIO-pin configuration).
Also, the libraries don't seem to support everything that the HW does.
2019-03-10 07:00 AM
Sorry about that. I just didn't use PB4 for anything. And I used ST-LINK V2 mini as the POD.
2019-03-10 02:53 PM
I'm not talking about any library, just one single header (e.g. [CubeL4]\Drivers\CMSIS\Device\ST\STM32L4xx\Include\stm32l476xx.h), defining symbols for the registers.
JW
2019-03-12 11:12 AM
Why would I want an include-file with over 20 000 lines?
Especially when they try to hide the handling of the bits.
Note that I'm talking about learning the HW here.