Debug Options on C091 Custom Board
I made a custom board using a C091KCT6. I assumed I would be able to figure out a way to display data in real time using printf. Unfortunately, I did not make provision to expose PA2 and PA3 (or indeed any pins other than the ones used by my board). PA2 is in any case in use as SPI1 MOSI. So I have pretty much accepted that I need to make a new custom board, and I am keen to ensure that I will be able to use printf this time!
I believe that two good solutions are to buy the STLINKV3-SET and either a) re-design the board to expose the PA2 / PA3 UART to that ST-LINK or b) re-design the board with an MCU that has a SWO pin and expose that to the STLINK-V3.
I would like two kinds of help, please: if I do not need to buy a new debugger or re-design the board, it would be great to hear how I can use printf with the setup I have, or avoid one of i) buying a new debugger and ii) re-designing the board.
If I do need to buy a new de-bugger and re-design the board, it would be great to have confirmation that both a) and b) above are options for me.
I have seven ST-LINK options available to me, one standalone and 6 dev kits:
| Board | ST-LINK type |
| Nucleo-C092RC | ST-LINK/V2EC |
STM32VLDISCOVERY | ST_LINK/V1 |
| STM32F407G-DISC1 | ST-LINK/V2-A |
| Nucleo-H753ZI | STLINK-V3E |
| Nucleo-C031C6 | ST-LINK/V2-1 |
| STM32F4-DISCOVERY | ST-LINK/V2-A |
| NA | standalone ST-LINK V2 |
I believe that none of these options is suitable (I would love it if someone can persuade me I'm wrong, of course). The promising ones are the V2-1 and V3E ST-LINKs, but in order to use these I would need either i) to expose the SWO pin of the C091KCT6, or ii) connect PA2 & PA3 on the C091KCT6 to the ST-LINK/V2-1 or ST-LINK/V3E.
Option i) doesn't work because, I think, there is no SWO pin on the C091KCT6.
Option ii) doesn't work because, I think, there is no provision for connecting UART pins to the ST-LINKs ON THE BOARDS from a custom board, only from the MCU on the dev kit board.
If I get the STLINKV3-SET, then I can either connect PA2 & PA3 of the C091KCT6 to it (and do my SPI stuff elsewhere on the chip) or replace the C091KCT6 with a chip that has a SWO pin. (I am not concerned about BoM cost, this is a low volume project. But I am concerned about the cost of buying a J-link :) ).
I think I need printf specifically - I am driving a mechanical oscillator close to its resonant frequency, so I need the whole system to run without interruption in order to be able to assess how well the control system is functioning. So breakpoints are great, but the oscillation will die each time I halt execution.
Thanks for reading, apologies for the newbie questions and the long post!
