2024-04-03 03:57 AM
Hello everyone!
After some more studying on STM32 ecosystem and how the programming of those boards work I've come to a blunder:
I am designing a project with an STM32 Microcontroller that I need to program (of course), and I don't know what method should I use. Initially I thought it would be perfect to go with the USB, but then I realised that the development board that I used to program via plug'n'play USB (where the idea of USB programming came), has an ST-Link debugger included that allowed me to do so.
This means that I either have to include a debugger in my schematic and PCB design (more space, more components, bigger board etc), or buy a separate one and get the JTAG/SWD pins out with a connector. I also understand that with BOOT0 hooked to power, via a switch, the MCU is programmable with USB, but I don't understand what other tools do I need to make the USB programming possible.....
1. What is the best way to have a smooth programming experience with my board (it might need several trial and error with the code until its working and complete - I am also a noobie regarding the STM32 programming)?
Regarding the MCU model, initially I chose STM32F103, but some guy told me it's quite primitive and has no DFU which makes it harder to program/debug via USB. In the past I worked with STM32L010RB dev board, maybe I should switch to that one??? My application is about measuring some currents and transferring the values to my PC - the values are transferred via I2C to the MCU, and we are talking about 46 measurements values that are in the form of Voltage and corresponding current. It is USB-powered.
2.What MCU should I choose??
3. Can someone enlighten me on this path of working with and STM32 on a more advanced manner than "dev board light the LED blink blink"??
2024-04-03 04:07 AM - edited 2024-04-03 04:11 AM
Yes, the Standard way is to provide an SWD connection.
At a minimum, it's just 3 pins - SWDIO, SWCLK, and GND - but it's best to also include Reset and VDD.
https://documentation-service.arm.com/static/5fce6c49e167456a35b36af1
Recent thread on debug connections:
https://community.st.com/t5/stm32-mcus-boards-and-hardware/st-link-with-jst-adapter/m-p/653685
note that you don't necessarily have to provide an actual connector - could be just "test points" on the PCB.
Another common practice is to provide the footprint for a connector, but not fit it in production.
2024-04-03 04:36 AM
Thank you very much for the insights.
2024-04-03 08:21 AM - edited 2024-04-03 02:05 PM
@AlexB99 This depends very much on your product requirements. Ability to use the debugger is a great support & recovery option. Note that the SWD connector has several good variants, from a miniature header with pins to holes & needles. But this ability is also a security breach. A secure debugger interface is available only in recent STM32 MCUs. Most of older STM32s such as your F1 do not have secure debugging. If you choose to enable read-out protection (RDP), the debug interface will be useless.
> I am also a noobie regarding the STM32 programming
Then please see here.
2024-04-03 09:06 AM
Any Nucleo 1. cut upper debuger and on your board only CN counterpart required.
BOOT0 isnt used with SWD, but what other tools do I need to make the USB programming possible = CubeProgrammer sw
2.you ask MCU as minimum you need choice one with USB when USB com is your plan without debuger.
3. CubeIDE ...