T48: Difference between revisions

From Proghq
Jump to navigation Jump to search
No edit summary
No edit summary
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=== WCH-link ===
[[Category:Hardware]]
[[Category:Programmer]]
 
==WCH-link==


Debug header
Debug header
# BO
# 3V3
** no 3.3V on PCB. I guess connect to WCH-Link 3V3?
# SWDCLK
# SWDIO
# ground
# BOOT
** BOOT1?


#BO
#*94 BOOT0
#3V3
#*no 3.3V on PCB. I guess connect to WCH-Link 3V3?
#SWDCLK
#*PA14/SWCLK
#SWDIO
#*PA13/SWDIO
#ground
#BOOT
#*Drives SM16306SJ (shift register) latch enable (LE) Z to prevent bus contention with programmer
#**SR output is shared with one of the WCH-Link pins (SWDCLK/SWDIO, forget which)
#**U5 pin 4
#**SM16306SJ - serial to parallel shift register / LED driver? Datasheet: [https://datasheet.lcsc.com/lcsc/2105241639_Shenzhen-Sunmoon-Micro-SM16306S_C2830324.pdf] Product page: [https://www.lcsc.com/product-detail/LED-Drivers_Shenzhen-Sunmoon-Micro-SM16306S_C2830324.html]
#**4 => LE
#**BOOT1 ???
#*
boot to high pin => seems to enable USB even with SWD plugged in
  ID 4348:55e0 WinChipHead
This is USB bootloader mode


Package pin assignment
Document at https://raw.githubusercontent.com/openwch/ch32v307/main/EVT/PUB/CH32V30xEVT%20Evaluation%20Board%20Manual.pdf indicates that for USB bootloader mode: "(1) BOOT0 to VCC, BOOT1 to the ground, connect to PC via serial port or USB"
* PA13/SWDIO
* PA14/SWCLK


WCHISPStudio/WCHISPTool (the separate programming tool, accessible via Tools->WCH In-System Programmer in the IDE) sees the device when jumpered this way. The IDE doesn't, so it might be necessary to use this tool to do the programming.


boot to high pin => seems to enable USB even with SWD plugged in
== Dev flow ==
https://github.com/davidcarne/t48-dummy-c-program


Sample flow for Linux doing LED blink


=== Unbrick ===
==Unbrick==


In theory we have all firmware (system ROM, bootloader, main firmware) and should be able to unbrick devices. However, I was unable to restore my devices
In theory we have all firmware (system ROM, bootloader, main firmware) and should be able to unbrick devices. However, I was unable to restore my devices

Latest revision as of 07:46, 16 April 2024


WCH-link

Debug header

  1. BO
    • 94 BOOT0
  2. 3V3
    • no 3.3V on PCB. I guess connect to WCH-Link 3V3?
  3. SWDCLK
    • PA14/SWCLK
  4. SWDIO
    • PA13/SWDIO
  5. ground
  6. BOOT
    • Drives SM16306SJ (shift register) latch enable (LE) Z to prevent bus contention with programmer
      • SR output is shared with one of the WCH-Link pins (SWDCLK/SWDIO, forget which)
      • U5 pin 4
      • SM16306SJ - serial to parallel shift register / LED driver? Datasheet: [1] Product page: [2]
      • 4 => LE
      • BOOT1 ???


boot to high pin => seems to enable USB even with SWD plugged in

 ID 4348:55e0 WinChipHead

This is USB bootloader mode

Document at https://raw.githubusercontent.com/openwch/ch32v307/main/EVT/PUB/CH32V30xEVT%20Evaluation%20Board%20Manual.pdf indicates that for USB bootloader mode: "(1) BOOT0 to VCC, BOOT1 to the ground, connect to PC via serial port or USB"

WCHISPStudio/WCHISPTool (the separate programming tool, accessible via Tools->WCH In-System Programmer in the IDE) sees the device when jumpered this way. The IDE doesn't, so it might be necessary to use this tool to do the programming.

Dev flow

https://github.com/davidcarne/t48-dummy-c-program

Sample flow for Linux doing LED blink

Unbrick

In theory we have all firmware (system ROM, bootloader, main firmware) and should be able to unbrick devices. However, I was unable to restore my devices

Theory: unrick issue is firmware is not at correct .hex location. Things that didn't seem to work to get firmware .hex file:

 objcopy --input-target=binary --output-target=ihex --set-start 0x08000000 t48_bootrom_2022-06-30.bin t48_bootrom_2022-06-30.hex
 objcopy --input-target=binary --output-target=ihex --change-addresses 0x08000000 t48_bootrom_2022-06-30.bin t48_bootrom_2022-06-30.hex  
 objcopy --input-target=binary --output-target=ihex t48_bootrom_2022-06-30.bin temp.hex
 objcopy --change-addresses 0x08000000 temp.hex t48_bootrom_2022-06-30.hex