跳转至内容
  • 版块
  • 最新
  • 标签
  • 热门
折叠
品牌标识

YunTu Forum

YTMicro.com
  1. 主页
  2. Announcements
  3. YCT_CLI 命令行 AGENT-SKILL

YCT_CLI 命令行 AGENT-SKILL

已定时 已固定 已锁定 已移动 Announcements
1 帖子 1 发布者 44 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • FrankieF 离线
    FrankieF 离线
    Frankie YunTu
    编写于 最后由 Frankie 编辑
    #1

    用此SKILL, 方便AI操作yct_cli,对工程进行校验,测试,代码生成。

    ---
    name: yct-cli
    description: >-
      Operate yct_cli to check, test, and generate code for YTMicro .yct projects
      (SDK, MCAL, MCAL_EB / EB Tresos). Use when the user mentions yct_cli, a .yct
      file, SDK, MCAL, MCAL_EB, EB Tresos, tresos_cmd, TRESOS_BASE, 校验, 测试, or 代码生成.
    ---
    
    # yct_cli
    
    用此SKILL, 方便AI操作yct_cli,对工程进行校验,测试,代码生成。
    
    `yct_cli` reads an existing `.yct` and the installed SDK or MCAL package. It does not create the `.yct`. Prefer `yct_cli` on PATH. From this repo, after `npm run cli:build`, use `node cli/cli.min.js`.
    
    ## Pick a command
    
    Read `project.type` from the `.yct`, then run that command.
    
    | Project type | Command |
    |---|---|
    | sdk | `yct_cli sdk` |
    | mcal | `yct_cli mcal` |
    | mcal_eb | `yct_cli mcal_eb` (alias of `mcal`) |
    
    Check with `-c`. Generate code with `-g`. Write the IDE project with `-P` (needs `-g` for MCAL and MCAL_EB). Compile a CMake project only after generate succeeds.
    
    ## Package root
    
    Resolution order:
    
    1. `-p` install root
    2. YT Config Tool settings file: Windows `%APPDATA%/yt_config_tool/config.json`, macOS `~/Library/Application Support/yt_config_tool/config.json`, Linux `~/.config/yt_config_tool/config.json`. Keys: `sdkPath`, `mcalPath`, `mcalEbPath`
    3. `userDataPath` plus the project type directory
    
    Family folder under that root:
    
    - `sdkVersion` is `dev`, or settings `withoutVer` is true: `root/family`
    - otherwise: `root/family_sdkVersion`
    
    `--sdkVer` or `--mcalVer` overwrites the version in the `.yct` before that lookup. The family folder must contain `sdk.json`, `mcal.json`, or `mcal_eb.json`.
    
    CLI copies `env` entries from that config, including `TRESOS_BASE`, into the process environment when the variable is not already set.
    
    ## SDK
    
    Check:
    
        yct_cli sdk -i app.yct -c
    
    Generate the IDE project:
    
        yct_cli sdk -i app.yct -P --ide CMakeGCC
    
    `-c` validates the project. `-P` writes IDE files. `--ide` is one of `EWARM`, `KEIL`, `CMakeGCC`, `CMakeEWARM`, `CMakeKEIL`, `CMakeGHS`.
    
    | Flag | Required | Meaning |
    |---|---|---|
    | `-i, --input` | yes | `.yct` path |
    | `--verbose` | no | Verbose log |
    | `-c, --check` | no | Validate the `.yct` |
    | `-p, --path` | no | SDK install root |
    | `--ide` | no | IDE name, list above |
    | `-O, --optimization` | no | CMake optimization. Must be legal for the toolchain |
    | `--link` | no | Overwrite link file |
    | `--sdkVer` | no | Overwrite `sdkVersion`, for example `1_0_3` |
    | `-o, --output` | no | Output path. Default is the `.yct` directory |
    | `-n, --name` | no | Overwrite project name |
    | `-P, --project` | no | Also generate IDE files |
    
    ## MCAL
    
    Check, including stub modules:
    
        yct_cli mcal -i app.yct -c -S
    
    Generate code, copy MCAL sources, and write the IDE project:
    
        yct_cli mcal -i app.yct -g -P --copyMcal --ide CMakeGCC
    
    `-c` validates loaded modules. Stub modules such as `EcuM` and `CanIf` are skipped unless `-S`. `-g` generates config code, including `Mcal.h`. `-gm Mcu Dio` limits generation to those modules. `--copyMcal` copies MCAL sources. `-P` needs `-g`.
    
    ## MCAL_EB
    
    An MCAL_EB `.yct` has `type` `mcal_eb`. Module configuration lives in the EB Tresos project. `.yct` data is usually only `ytlink`.
    
    Tresos project directory:
    
    - `project.eb.projectPath` when set (absolute, or relative to the `.yct` directory)
    - otherwise the `.yct` directory
    
    That directory must contain `.prefs/pref_general.xdm`. Enabled modules and `GenerationPath` (often `output`) come from that file. `project.eb.stubModules` lists extra stub modules to pull in.
    
    Generate, then the IDE project is ready to compile:
    
        yct_cli mcal_eb -i Dio_Demo.yct -g -P --copyMcal --ide CMakeGCC
    
    - `-g` writes `board/Mcal.h`, or `project.generate.folder`
    - `--copyMcal` copies driver sources from `plugin.json` move entries. Required before a link. Without it the build only has Tresos `output` and `Mcal.h`
    - `-P` writes the IDE project. CMake toolchains also write `cmake/ebGenerate.cmake`
    - `--ide` uses the same list as SDK. Omit it when the `.yct` toolchain is already correct
    - `-c` does not run XDM validation on MCAL_EB
    
    Compile a CMake project from the `.yct` directory:
    
        cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=../cmake/gcc.cmake -B build
        cmake --build build
    
    Configure runs Tresos when `TRESOS_BASE` points at an install that contains `bin/tresos_cmd.bat` (Windows) or `bin/tresos_cmd.sh`. The YT Config Tool env value is written into `CMakeLists.txt`. Tresos C and H files stay in `GenerationPath`. CMake globs them together with the copied MCAL sources.
    
    `mcal_eb` is an alias of `mcal`. The `.yct` `project.type` selects the flow. Shared flags:
    
    | Flag | Required | Meaning |
    |---|---|---|
    | `-i, --input` | yes | `.yct` path |
    | `--verbose` | no | Verbose log |
    | `-c, --check` | no | Validate. MCAL_EB skips XDM validation |
    | `-S, --stub` | no | Include stub modules such as `EcuM` and `CanIf` |
    | `-p, --path` | no | MCAL or MCAL_EB install root |
    | `-g, --generate` | no | Generate config code, including `Mcal.h` |
    | `--copyMcal` | no | Copy MCAL sources from plugin move entries |
    | `--ide` | no | Same IDE list as SDK |
    | `-O, --optimization` | no | CMake optimization |
    | `-gm, --generateModule` | no | Only these modules, for example `-gm Mcu Dio` |
    | `--mcalVer` | no | Overwrite `sdkVersion`, for example `2_0_0` |
    | `-P, --project` | no | IDE files. Needs `-g` |
    | `-s, --save` | no | Write the loaded project back to the `.yct`, with a `.yct.bak` backup |
    
    CMake optimization values:
    
    - `CMakeEWARM`: `-On -Ol -Om -Oh -Ohs -Ohz`. Default `-Ol`.
    - `CMakeKEIL`: `-O0 -O1 -O2 -O3 -Oz -Omin -Ofast -Omax -Os`. Default `-O1`.
    - `CMakeGCC`: `-O0 -O1 -O2 -Os -Ofast`. Default `-O1`.
    - `CMakeGHS`: `-Omaxdebug -Omoredebug -Odebug -Ogeneral -Osize -Ospeed -Onone`. Default `-Ogeneral`.
    
    
    
    1 条回复 最后回复
    0

  • 云途开发生态介绍

    快速上手云途开发生态

  • 云途论坛规则/Yuntu Forum Rules

    发帖前请查看

  • YT CONFIG TOOL调查问卷

    帮助改进和优化YT CONFIG TOOL,有机会抽取YTM32B1ME0 EVB哦...

  • can
    29
    demo
    26
    uds
    14
    lin stack
    13
    fbl
    6
    md14
    6
    yt-link
    6
    adc模块
    4
    Online Users
    • 登录

    • 登录或注册以进行搜索。
    • 第一个帖子
      最后一个帖子
    0
    • 版块
    • 最新
    • 标签
    • 热门