1.6.14 CAN-FD 数据段 2Mbps→5Mbps:CONFIG_CAN_DATA_PRESCALER 9→3、BS1 3→4TQ (90MHz/(3×6TQ),采样点 80%→83.3%),仲裁段仍 1M。TDC filter/offset 维持 4 不做 等比缩放(TDCMOD=CALC_AND_OFFSET 下硬件已自动测回路延时;放到 12 会让本节点回采 错开约 6 个数据位,自发热帧被判错误帧)。配套电机 APP/BOOT data_prescaler=2。 1.6.15 段4 批量接收由"环形队列 + 变长紧排排空"改为 5×44B 定长覆盖窗口,输入 PDO 496→600(75×64bit),段5 诊断区 484→584。动机两条:现场 4000 帧/s 超旧容量 3 帧/拍 恒丢 1 帧;更关键是排空赤字把队列长期压在饱和态,而 1.6.9~1.6.13 追的错标/拼接竞态 正是饱和态喂出来的(判满用的 tail 滞后→生产者写进消费者刚读过的槽)。定长消灭 tail/判满/pending,边界越界写在结构上不可能再犯。每槽带 u32 seqlock:buildInput 在 PDI_Isr(preempt=0) 抢占主循环写侧,无它则主站会拿到"新 ID + 旧数据"拼出的假帧。 out+in=984 ≤ 1024 硬上限,DPRAM 留 120B。语义变更:批量区从"不丢的事件流"变"最近 N 帧窗口",去重与丢帧判据移交主站按 seq 归一。三端同步 size.h/bridge/dc_app/ gen_eeprom/DCU_ESI.xml,必须重烧固件 + 烧 EEPROM + 断电冷启动,只烧一边 SAFEOP 报 AL 0x001A/0x0011。 1.6.16 段1/段3 快照 drop 计数口径修复(纯判据,PDO 布局逐字节不动):旧判据 s_rxValid 置位后永不清零 ⇒ 开机首帧后每帧都算丢弃,drop ≡ rx−1,是零灵敏度假仪表 且把网页状态栏刷成 ERR。新增 s_rxPublished,判据改 s_rxValid && !s_rxPublished。 1.6.17~19 [DIFF-STATS] 差分写取证仪表,零行为变更,只加 0x2000 sub13..23(11 个只读 UINT32) ⇒ 不动 PDO 长度/映射,无需重生成 SII。实测:每拍 27.4% 字节真变化(164B)、 run 峰值 12~13、段2 占变化量 ~53%、段4 ~25%。 1.6.19 推翻 1.6.18 的自我诊断:比对开销虚报不是 -Oz 把 memcpy 编成调用(手拼移位 反而 21.3µs→41µs),真根因是 alignas(4) 到 const uint8_t* 形参处丢失,优化器无法 证明 4 字节对齐。__builtin_assume_aligned + memcpy 后循环体缩成 ldr/ldr/cmp/bne、 bl 归零。教训:测量工具自身的开销会直接变成结论。 1.6.20 基线对照版(当前提交状态 CONFIG_ECAT_DIFF_STATS=0):同工况(电机在线无指令) 实测 load 49.1% vs 仪表开的 51.6% ⇒ 仪表自身成本 2.4 个点,差分改造收益 = 0。 按实测变化量推算 A1(段粒度条件写) 只值约 1 点(段2/段4 每拍都变,必然整块重写), 仅 A2(8B 块粒度 + run 上限退化为整写) 有空间 —— 推算值,未做 A/B 实测不作为结论。
179 lines
6.6 KiB
YAML
179 lines
6.6 KiB
YAML
# A project translates into one executable or library.
|
||
project:
|
||
|
||
groups:
|
||
- group: Source Files
|
||
files:
|
||
- file: ./main.h
|
||
- file: ./main.cpp
|
||
- group: sys
|
||
files:
|
||
- file: ./sys/initial.h
|
||
- file: ./sys/initial.cpp
|
||
- file: ./sys/systick.h
|
||
- file: ./sys/systick.cpp
|
||
- file: ./sys/task_manager.h
|
||
- file: ./sys/task_manager.cpp
|
||
- file: ./sys/task_runner.h
|
||
- file: ./sys/task_runner.cpp
|
||
- file: ./sys/cpu_load.h
|
||
- file: ./sys/cpu_load.cpp
|
||
- file: ./sys/ota_boot_request.h
|
||
- file: ./sys/ota_boot_request.cpp
|
||
- file: ./sys/aes128.h
|
||
- file: ./sys/aes128.cpp
|
||
- file: ./sys/motor_ota_relay.h
|
||
- file: ./sys/motor_ota_relay.cpp
|
||
- file: ./sys/hardfault.cpp
|
||
- file: ./sys/cpp_stubs.cpp
|
||
- file: ./sys/config.h
|
||
- group: device
|
||
files:
|
||
- file: ./device/adc.h
|
||
- file: ./device/adc.cpp
|
||
- file: ./device/canfd.h
|
||
- file: ./device/canfd.cpp
|
||
- file: ./device/timer.h
|
||
- file: ./device/timer.cpp
|
||
- file: ./device/usart0.h
|
||
- file: ./device/usart0.cpp
|
||
- file: ./device/watchdog.h
|
||
- file: ./device/watchdog.cpp
|
||
- file: ./device/motor_state.h
|
||
- file: ./device/motor_state.cpp
|
||
- file: ./device/motor_version.h
|
||
- file: ./device/motor_version.cpp
|
||
# GigaDevice DFP 未把 EXMC 注册为 CMSIS 组件(仅有 FMC=片内 Flash),
|
||
# 但外设源文件存在于 Pack;LAN9252 并行总线需要 EXMC,故本地编入。
|
||
- group: device_exmc
|
||
files:
|
||
- file: ./RTE/Device/GD32E508VE/gd32e50x_exmc.c
|
||
- file: ./RTE/Device/GD32E508VE/gd32e50x_exmc.h
|
||
- group: device/spi
|
||
files:
|
||
- file: ./device/spi/app_spi_command.h
|
||
- file: ./device/spi/app_spi_command.cpp
|
||
- file: ./device/spi/spi_command_handler.h
|
||
- file: ./device/spi/app_spi_command_defs.h
|
||
- file: ./device/spi/app_spi_cmd_boot_request.cpp
|
||
- file: ./device/spi/app_spi_cmd_ota_wait.cpp
|
||
- file: ./device/spi/app_spi_cmd_ping.cpp
|
||
- file: ./device/spi/app_spi_cmd_init_status.cpp
|
||
- file: ./device/spi/app_spi_cmd_can_bridge.cpp
|
||
- file: ./device/spi/app_spi_cmd_can_burst.cpp
|
||
- file: ./device/spi/app_spi_cmd_can_feedback.cpp
|
||
- file: ./device/spi/app_spi_cmd_id_snapshot.cpp
|
||
- file: ./device/spi/app_spi_cmd_adc_feedback.cpp
|
||
- file: ./device/spi/app_spi_cmd_motor_state.cpp
|
||
- file: ./device/spi/app_spi_cmd_motor_version.cpp
|
||
- file: ./device/spi/app_spi_cmd_motor_ota.cpp
|
||
- file: ./device/spi/app_spi_cmd_exmc_diag.cpp
|
||
- group: spi_link
|
||
files:
|
||
- file: ../../spi_link/spi_link_v2.cpp
|
||
- group: comm
|
||
files:
|
||
- file: ./comm/esc_exmc_bus.h
|
||
- file: ./comm/esc_exmc_bus.cpp
|
||
- file: ./comm/esc_lan9252.h
|
||
- file: ./comm/esc_lan9252.cpp
|
||
- file: ./comm/ethercat_slave.h
|
||
- file: ./comm/ethercat_slave.cpp
|
||
- file: ./comm/ethercat_sync.h
|
||
- file: ./comm/ethercat_sync.cpp
|
||
- file: ./comm/ethercat_can_bridge.h
|
||
- file: ./comm/ethercat_can_bridge.cpp
|
||
- file: ./comm/ethercat_pdo.h
|
||
- file: ./comm/ethercat_pdo.cpp
|
||
# [DIFF-STATS] 临时仪表:差分写取证,删除时连同本两行与 comm/ethercat_diff_stats.* 一并移除
|
||
- file: ./comm/ethercat_diff_stats.h
|
||
- file: ./comm/ethercat_diff_stats.cpp
|
||
- group: comm/ssc
|
||
files:
|
||
- file: ./comm/ssc/inc/ecatslv.h
|
||
- file: ./comm/ssc/inc/ecatappl.h
|
||
- file: ./comm/ssc/inc/mailbox.h
|
||
- file: ./comm/ssc/inc/ecatcoe.h
|
||
- file: ./comm/ssc/inc/sdoserv.h
|
||
- file: ./comm/ssc/inc/objdef.h
|
||
- file: ./comm/ssc/inc/coeappl.h
|
||
- file: ./comm/ssc/inc/esc.h
|
||
- file: ./comm/ssc/inc/applInterface.h
|
||
- file: ./comm/ssc/inc/el9800hw.h
|
||
- file: ./comm/ssc/src/ecatslv.c
|
||
- file: ./comm/ssc/src/ecatappl.c
|
||
- file: ./comm/ssc/src/mailbox.c
|
||
- file: ./comm/ssc/src/ecatcoe.c
|
||
- file: ./comm/ssc/src/sdoserv.c
|
||
- file: ./comm/ssc/src/objdef.c
|
||
- file: ./comm/ssc/src/coeappl.c
|
||
- file: ./comm/ssc/port/hw_gd32exmc.cpp
|
||
- file: ./comm/ssc/port/dc_app.c
|
||
- file: ./comm/ssc/port/dc_app.h
|
||
- file: ./comm/ssc/port/ecat_def.h
|
||
|
||
# List components to use for your application.
|
||
# A software component is a re-usable unit that may be configurable.
|
||
components:
|
||
- component: ARM::CMSIS:CORE
|
||
- component: Device:Startup
|
||
- component: Device:GD32E50x_StdPeripherals:ADC
|
||
- component: Device:GD32E50x_StdPeripherals:CAN
|
||
- component: Device:GD32E50x_StdPeripherals:CRC
|
||
- component: Device:GD32E50x_StdPeripherals:DBG
|
||
- component: Device:GD32E50x_StdPeripherals:DMA
|
||
- component: Device:GD32E50x_StdPeripherals:EXTI
|
||
- component: Device:GD32E50x_StdPeripherals:FMC
|
||
- component: Device:GD32E50x_StdPeripherals:GPIO
|
||
- component: Device:GD32E50x_StdPeripherals:MISC
|
||
- component: Device:GD32E50x_StdPeripherals:PMU
|
||
- component: Device:GD32E50x_StdPeripherals:RCU
|
||
- component: Device:GD32E50x_StdPeripherals:SPI_I2S
|
||
- component: Device:GD32E50x_StdPeripherals:TIMER
|
||
- component: Device:GD32E50x_StdPeripherals:USART
|
||
- component: Device:GD32E50x_libopt
|
||
- component: Device:GD32E50x_StdPeripherals:FWDGT
|
||
|
||
# List executable file formats to be generated.
|
||
output:
|
||
type:
|
||
- elf
|
||
- hex
|
||
- map
|
||
|
||
misc:
|
||
- for-compiler: AC6
|
||
C-CPP:
|
||
- -DGD32E508
|
||
- -DGD32E50X
|
||
- -DHXTAL_VALUE=8000000U
|
||
- -gdwarf-5
|
||
- -D__MICROLIB
|
||
- -fshort-enums
|
||
- -fshort-wchar
|
||
# EXMC 未作为 CMSIS 组件分发;头文件在 RTE 本地目录
|
||
- -IRTE/Device/GD32E508VE
|
||
- -Wno-register
|
||
- -IG:/Robot_v2/DCU/spi_link
|
||
C:
|
||
- -std=gnu11
|
||
CPP:
|
||
- -std=gnu++17
|
||
# 全工程零使用 RTTI/异常(grep 验证),关闭以剥离 libcppabi 运行时(约 2.5 KB Flash)
|
||
- -fno-rtti
|
||
- -fno-exceptions
|
||
ASM:
|
||
- -DGD32E508
|
||
- -DGD32E50X
|
||
- -DHXTAL_VALUE=8000000U
|
||
- -gdwarf-5
|
||
- -D__MICROLIB
|
||
# 启动文件经 legacy armasm 汇编:消 armclang 驱动"参数未使用"告警 + armasm 弃用告警(A1950W)
|
||
- -Wno-unused-command-line-argument
|
||
- -Wa,armasm,--diag_suppress=A1950W
|
||
Link:
|
||
- --library_type=microlib
|
||
- --entry=Reset_Handler
|
||
# 输出未引用段与总量报告,用于 Flash 尺寸归因
|
||
- --info=unused,totals
|