-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmipi_vp1902_bringup.tcl
More file actions
79 lines (68 loc) · 2.67 KB
/
Copy pathmipi_vp1902_bringup.tcl
File metadata and controls
79 lines (68 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# ============================================================
# PPro-RT8 bring-up — S8-100S VP1902 MIPI 相机验证
# CLI: ppro_rt.exe -f docs/s2c/player_file/mipi_vp1902_bringup.tcl
# ============================================================
set script_dir [file dirname [file normalize [info script]]]
set repo_root [file normalize [file join $script_dir .. .. ..]]
set BOARD_NAME "s8_mipi"
set PDI_PATH [file join $repo_root fpga vivado mipi_vp1902.runs impl_1 mipi_platform_wrapper.pdi]
set GCLK_INDEX 1
set GCLK_FREQ_KHZ 100000
# 首次安装时设置 S2C PlayerPro Runtime 许可证路径(或通过环境变量 PPRO_LICENSE)
if {[info exists ::env(PPRO_LICENSE)]} {
set LICENSE_PATH $::env(PPRO_LICENSE)
} else {
set LICENSE_PATH ""
}
proc section {t} { puts "\n=== $t ===" }
section "Connect board (USB)"
if {[catch {add_board -name $BOARD_NAME -usb} err]} {
puts "add_board FAIL: $err"
puts "Check USB Type-B, power ON, close other PPro-RT8 sessions."
return
}
if {[catch {set_current_board $BOARD_NAME} err]} {
puts "set_current_board FAIL: $err"
return
}
catch { puts [get_board_info] }
section "Power on"
set_power 1
catch { puts "get_power: [get_power]" }
section "License (first-time SCM install)"
if {$LICENSE_PATH ne "" && [file exists $LICENSE_PATH]} {
catch { install_license -f $LICENSE_PATH }
} elseif {$LICENSE_PATH eq ""} {
puts "Tip: set env PPRO_LICENSE to rt_basic.lic path for first-time install"
}
section "Power cycle + clear config"
catch { set_power 0 }
after 3000
set_power 1
after 2000
catch { clear_fpga_config 1 }
catch { generate_reset_pulse 1 }
section "VCCO J4=1.2V (MIPI), J38=1.5V (GPIOE 子卡仅支持 1.5V)"
set_connector_voltage -name F1_J4 -voltage 1.2v
catch { puts "F1_J4 -> [get_connector_voltage F1_J4]" }
catch { puts "F1_J38 (fixed 1.5v card) -> [get_connector_voltage F1_J38]" }
section "GCLK1 = 100 MHz"
catch { set_clock_source -src internal -index $GCLK_INDEX }
set_clock_freq -index $GCLK_INDEX -freq $GCLK_FREQ_KHZ
catch { puts "GCLK$GCLK_INDEX readback: [get_clock_freq $GCLK_INDEX] KHz (expect $GCLK_FREQ_KHZ)" }
section "Download PDI"
if {![file exists $PDI_PATH]} {
puts "ERROR: PDI not found: $PDI_PATH"
puts "Run: vivado -mode batch -notrace -source fpga/scripts/build_all.tcl"
exit
}
puts "PDI: $PDI_PATH"
if {[catch {config_fpga -i 1 -f $PDI_PATH} err]} {
puts "config_fpga FAIL: $err"
puts "fpga_config_status: [get_fpga_config_status 1]"
return
}
catch { puts "fpga_config_status: [get_fpga_config_status 1] (1=OK)" }
section "Done"
puts "Bring-up complete. UART: GPIOE Micro-USB, 921600 8N1"
exit