2021-12-29 07:54 AM
How to develop an Embedded System around STM32 MCU from scratch efficiently on the first attempt? For Eg. Developing a system with ADC, CAN, RS232, SPI, I2C, UART around an ST Controller efficiently?
Developing a system according to the product requirement standard.
2021-12-29 08:08 AM
This is quite the generic question. Hard to give specific advise with no knowledge of your background or skill, but I will try:
Read and understand documentation, have solid programming skills, understand hardware design and read relevant ST-specific guides, have solid debugging skills in software and hardware, be or get familiar with the IDE you are using, understand and be familiar with the library you are using (e.g. HAL or direct register access), understand the requirements and work through them with the customer to address and/or revise ambiguous/impossible/unnecessary ones, understand the big picture of what you're trying to accomplish, develop in steps starting from getting small examples working to incorporating everything into the same project.
Edit: Oh and decide which MCU you're using and purchase it a year in advance of when you will need it, along with all other long lead components.
2021-12-29 08:33 AM
Thank you for your valuable inputs. One small request, I am above average at C programming but still want to improve to a level where I can say that I rate myself at 10/10. How can I achieve this rating?
2021-12-29 09:07 AM
If you want to get better at C programming, do C programming.
You could, for example, do the first 50-100 problems at projecteuler.net.
https://projecteuler.net/archives
There are plenty of coding type puzzles on the internet if that's your thing. For example:
https://www.codewars.com/?language=c
Or create your own project that aligns with your interests and bring it to fruition.
2021-12-29 09:38 AM
Much of the work in developing a new product lies in the design for manufacturing and testing. Sure, we can all produce a working prototype, but how do we build in the functionality to manufacture it in large quantities?
Start with component procurement. There's some cool new part that replaces 50% of the discretes...except can you buy it in quantity, and is there a reliable distributor? Nothing worse than getting a call from production that they ran out of parts, and procurement can't find any. The assembly line sists idle for weeks, and customer orders aren't filled.
Then there's board stuffing. Are the PCBs optimized for the pick and place machines? What's the rejection rate after they go through soldering? If you're throwing away 20% of the boards the profit margin is going to head for negative territory.
Ok, assembled PCB, but does it work? How do you test for bad solder joints, especially if there are BGAs? What's the procedure for the assembly line to verify functionality before the PCB goes into the case? If a unit goes out with only 85% working the return cost is enormous. So part of that original design and programming has to go into self-test support and assembly line test jigs.
What about returns? If there's an inherent design flaw this is where it shows up. What's in place to track testing of returns? Or just throw them away? Ok, but then how do you know if it's a simple failure or a batch of defective/counterfeit components?
All this is done by someone else? Well, no. The design engineer is responsible for all of it, to some degree. If all you want is to be a junior team member that's fine, but some or all of this will be delegated your way. Contract it out? Yes, but if the product fails in the field it's still your reputation, your company's customer goodwill that suffers.
The fun part is coming up with the schematics and programming the result, but it's only a very small part of the whole.
Jack Peacock
2021-12-30 01:49 AM
- Buy a cheap bluepill, blackpill (or similar board) and "ST-LINK V2" from China.
- Install STM32CubeProgrammer
- Check that ST-Link can commuincate with your device, something like this:
~/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer.sh -c port=SWD mode=UR
(you might need to upgrade the firmware in ST-LINK)
- I'm an experianced programmer and don't want any new IDE or so. Would like to have control of the development environment. So I only used a toolchain (and no IDE or debugger). So I get gcc-arm-none-eabi-10.3-2021.07 from here:
https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads
(for serious development, you need to use a debugger)
- Install STM32CubeMX
- Create a new project for your device and generate source
- Build and download it
- Now you can expreminent with the stuff you shall design and see that it is possible to do. Hardware and software.
- Since many STM32 devices are similar to each other. It doesn't matter if these first steps are done on another device than the final one.
From this to a ready product... is long and hardwork :)
PS. For me it was real fun to get a working device up and running as an USB device in short time.
2021-12-30 05:04 AM
Although there's always the temptation to get things as elegant / efficient as possible, I think it much more important that what you make is 100% reliable. Embedded items are not like consumer products - often it's impossible to get to them to turn them off and back on again if things start to go wrong. And if/when it stops working, how might you find out what went wrong in order to prevent it from happening again?
When things are simple, it is possible to hold the entire design in your mind and think through consequences.
But stm32 are so powerful that they are quite capable of doing extremely complicated things. Certainly more than I can hold in my mind. That's where one might consider C++ rather than C so that one part of the project may be protected from unintended interference by another part of the project. (I understand there are better languages to use, such as Ada and Rust, but it's much harder to make a start as all examples are C).
So perhaps ask yourself what should the product do? How would people use it? How do I make it better than what's already on the market?
Don't be surprised if part-way through the design you realise that there's a better way to do things.
And do enjoy what you're doing. Remember to play. That's the only way to get a true mastery of it.
Danish
2021-12-30 01:09 PM
If you really want to make a product and sell it, you have to go up against the standards. And there are many:
REACH, CE, TÜV ... for the most common.
DO-178 for aeronautics ...
If your product is close to medical, there are still others ...
All of this takes a long time to complete the files, and sometimes money to pay the laboratory that does the tests.
The technical development part is often the easiest and fastest part.
2022-01-12 07:37 PM
> Buy a cheap bluepill, blackpill (or similar board) and "ST-LINK V2" from China.
There is no point in buying that badly designed crap with fake MCUs and less features when there are genuine Nucleo boards with integrated ST-LINK for the same price.
> So I only used a toolchain (and no IDE or debugger).
If you're on Windows, try EmBitz. It's a small and fast native code based no-nonsense IDE, which uses the same GNU Arm Embedded Toolchain you gave a link to. One can manually update the toolchain to the newer (or older) version by just replacing a single folder. It's not a Java based slow giant monster with terrible ergonomics like all of those Eclipsoids... ;)
2022-01-12 07:43 PM
Just take a note that Project Euler exercises will train the mathematical and logical thinking (which, of course, is necessary), but will not train software architecture and real-life product design skills. And for 99% of projects that is the hardest part...