Electronics > Microcontrollers

How many pins are required to program an STM32 chip?

<< < (3/4) > >>

Siwastaja:
I usually develop using the internal UART bootloader only until I have finished my own in-application flasher or bootloader, at that point I start flashing using that, in many projects I don't bring SWD out at all.

Rolling your own has the benefit of being able to use any interface, obviously usually the one you have already connected for whatever reason.

For example, if you develop an application which normally communicates to a host PC through UART, you can use the same UART to flash with ST bootloader, all you need is a pushbutton / jumper on BOOT0. Then, you can write your own flasher to make the reflash process faster/better (and not require BOOT0 pin) still using the same UART, while retaining the ST's bootloader as a backup procedure.

Debug features rarely needed, in some rare cases they save time, in such cases I lose a little bit of time (for example: store ten interesting peripheral registers in temporary variables, print out later, takes 2 minutes instead of 10 seconds in a debugger register view) but save it elsewhere.

Yansi:

--- Quote from: Siwastaja on June 05, 2021, 06:05:50 am ---Debug features rarely needed, in some rare cases they save time, in such cases I lose a little bit of time (for example: store ten interesting peripheral registers in temporary variables, print out later, takes 2 minutes instead of 10 seconds in a debugger register view) but save it elsewhere.

--- End quote ---

Awww... the classic siwastaja mantra.  |O

This is how you program an arduino, not a complex application for a 32bit MCU. And you are again even speaking against yourself: You say debug features rarely save time and then proceed wasting time to program lines of println shit in the code. That a) Does not save machine time, as it is useless code for the application b) spend time writing your own debug, instead using the debug interface and proper tools to display values of variables.

Also note, that the debug interfaces are not only for displaying variables, you can do much more with then then your UART Printing "time saver".

Siwastaja:
As always, I have provided arguments and I have a good track record of succeeding with my methodology.

As always, your main argument is "you just do it this way, period", and you are unable to show me being wrong with actual arguments replying to my claims.

I respect your opinion and workflow and not saying it doesn't work, it's also a good default because it's the usual one, so lot of help and tutorials are available. I also do sometimes use gdb, add breakpoints and singlestep and there's nothing wrong with it.

The fact, not an opinion, is that my workflow works fine, but it's also possible it doesn't work for everyone. I want to offer an alternative viewpoint that is rarely seen publicly; this is because your viewpoint is easily available everywhere already.

Fundamentally all of this is a question between building your own tools versus using existing one-size-fits-all general purpose tools. I just prefer the former. In the end, the importance of understanding the tools and how to use them is what's important. And no tool is perfect of everything, regardless of workflow you have some inefficient moments. The total productivity is what counts.

Reducing my viewpoint into "arduino printf" is a typical strawman argument; in reality you can do a lot more. I could build a similar strawman and accuse you of singlestepping through your program logic inefficiently, but I'm sure you can use debuggers better than that.

radiolistener:

--- Quote from: AQUAMAN on May 23, 2021, 07:54:35 pm ---Do I just need 3 pins? SWDIO, SWCLK and GND?

--- End quote ---

yes, but you're needs also 4'th pin - Vcc (3.2V power supply)

evb149:
The target Vcc can be needed if the debugger / loading host device supports different logic levels / power supply than the target device.
If you have a connection to the target where say the SWCLK or SWDIO is driven to the target while the target Vcc is off then you could harm the target,
similarly if the host has Vcc = 3.3V and the target has Vcc=1.8V or whatever different.

Anyway saying you need only 3 wires must also be considered wrt. signal integrity.  SWCLK should have an adjacent return path to ground, so should SWDIO,
and ideally they'd be different return wires if it is a long enough run that using a common ground lead for the two data signals could lead to SI issues.
But for the most part in short links you could probably use (CLK, GND, IO) particularly if CLK has good SI.


Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version