2021-08-11 01:31 AM
I want to write my own custom bootloader program so I want to communicate with MCU using SWD data & clk pins but how can I use this pins?
2021-08-11 03:08 AM
MCUs have an on-chip boot ROM which helps programming devices easily via UART, I2C, SPI, ... but not SWD. See AN2606 "STM32 microcontroller system memory boot mode". Take a look at open source SWD boot loaders like OpenOCD or stlink-org to grasp an idea of the complexity of that task and if possible, use them.
See also https://community.st.com/s/question/0D53W00000DJKotSAH/how-to-program-flash-directly-thru-swd
hth
KnarfB