St-link v2 usage with CW308 targets

Hello all,

I just want to ask if there is any tutorial related to use st-link v2 with CW308 targets like STM32F0/F3?

thanks a lot

I use it with PyOCD which is rather easy to integrate with programmatically.

After installing PyOCD (pip3 install pyocd), you’ll also need to download the CMSIS packages for the targets you want to program. In your case, you’ll need to run the following commands:

$ pyocd pack -i stm32f303rctx
$ pyocd pack -i stm32f071rbtx

To program a target, you need to create a session (look at pyocd.core.helpers.ConnectHelper class for that) and then use pycod.flash.file_programmer.FileProgrammer class to actually program the chip.

I unfortunately can’t share code yet, although it’s fully written and working. But it will be released (hopefully this year) on Github as part of our SCAAML repository with all the custom widgets and Jupyterlab notebook I’m currently designing.

1 Like

And just for completeness, here is the mapping between all the PyOCD compatible CW308 targets (unless I missed one) and the corresponding device reference to give to PyOCD to install the required CMSIS pack:

  • CW308-EFM32TG11B: efm32tg11b340f64gq48
  • CW308-EFR32MG21A: efr32mg21a020f1024im32
  • CW308-IMXRT1062: mimxrt1062dvl6a
  • CW308-K24F: mk24fn1m0vll12
  • CW308-K82F: k82f25615
  • CW308-NRF52: nrf52840
  • CW308-PSOC62: cy8c6247bzi-d44
  • CW308-SAM4L: atsam4lc2a
  • CW308-STM32F0: stm32f071rbtx
  • CW308-STM32F1: stm32f100rb
  • CW308-STM32F2: stm32f215retx
  • CW308-STM32F3: stm32f303rctx
  • CW308-STM32F4: stm32f415rgtx
  • CW308-STM32L4: stm32l443rctx
  • CW308-STM32L5: stm32l562retx
1 Like

thanks for your reply.
it would be great if you can let me know how I can create a session exactly using helpers.

best regards