Programming the K82F (CW312 Target)

Fast, cheap and reliable option to burn your firmware into the flash.

  1. Pull the PTA4 pin to the ground. Just connect the low-side (close to MCU input) of the pull-up R5 resistor to the ground. It is safe with 10k resistor.
  2. Plug in your CW Husky/Lite device to the USB port.
  3. Release connection to ground in 2-3 seconds. Your MCU will be in the ISP mode.
  4. Install the python package by pip install spsdk (if not installed)
  5. Connect your UART adapter to the RX/TX/GND of the main CW308/CW313 board
  6. Erase the flash by python -m spsdk.apps.blhost -p /dev/cu.usbserial-A5069RR4,115200 flash-erase-all
  7. Burn firmware by python -m spsdk.apps.blhost -p /dev/cu.usbserial-A5069RR4,115200 write-memory 0x0 /path/to/simpleserial-aes-CW308_K82F.bin

You should see something like this

bash-3.2$ python -m spsdk.apps.blhost -p /dev/cu.usbserial-A5069RR4,115200 flash-erase-all
Response status = 0 (0x0) Success.

bash-3.2$ python -m spsdk.apps.blhost -p /dev/cu.usbserial-A5069RR4,115200 write-memory 0x0 simpleserial-aes-CW308_K82F.bin
Writing memory  [####################################]  100%          
Response status = 0 (0x0) Success.
Response word 1 = 13720 (0x3598)

Done!