diff --git a/docs/skills/c2000-idea/references/device-migration.md b/docs/skills/c2000-idea/references/device-migration.md index 8657954..bfda4a8 100644 --- a/docs/skills/c2000-idea/references/device-migration.md +++ b/docs/skills/c2000-idea/references/device-migration.md @@ -40,6 +40,7 @@ Call `list_migration_devices()` from IDEA MCP immediately after collecting input **idea-mcp** (required): - `get_projects()` — detect projects, current device, configured migration devices - `list_migration_devices()` — supported migration device families +- `set_project_migration_folder_exceptions()` — set folder/file exclusions for the project migration report. Called once in Phase 4 before `get_project_migration_report()` to exclude the build output folder. Paths are relative to the project root. - `get_project_migration_report()` — run migration analysis across the whole project in one call. Called **once** at the start of Phase 4 to size the work and report total scope. - `get_device_migration_report()` — run migration analysis on a single source file. Called diff --git a/docs/skills/c2000-idea/references/device-migration/phase-1-import.md b/docs/skills/c2000-idea/references/device-migration/phase-1-import.md index a8ee4ec..4a656e8 100644 --- a/docs/skills/c2000-idea/references/device-migration/phase-1-import.md +++ b/docs/skills/c2000-idea/references/device-migration/phase-1-import.md @@ -113,6 +113,12 @@ The starter project location depends on the target device: (e.g., `myApp_f28003x` → `myApp_f28p55x`, not `myApp_f28003x_f28p55x`). - This gives the target project a stable, unique name. +## 1.7a Copy target configuration files + +- If the renamed project has no `targetConfigs` folder: create it, then copy all `.ccxml` files from `/device_support//common/targetConfigs/` into it. +- If `targetConfigs` already exists: check if any `.ccxml` file inside it has the target device name in its filename. If yes, skip. If no such file exists, copy all `.ccxml` files from `/device_support//common/targetConfigs/` into it. +Do not ask the user — perform both cases automatically. + ## 1.8 Rebuild after rename - Call `buildProject` again on the **renamed** project. diff --git a/docs/skills/c2000-idea/references/device-migration/phase-2-settings.md b/docs/skills/c2000-idea/references/device-migration/phase-2-settings.md index 895205d..b051d86 100644 --- a/docs/skills/c2000-idea/references/device-migration/phase-2-settings.md +++ b/docs/skills/c2000-idea/references/device-migration/phase-2-settings.md @@ -66,6 +66,12 @@ found (source value vs. target value) and what you plan to apply. that component with the target device name and verify the resulting path exists on disk. - Apply settings from the source to the target, after confirmation. +**After applying include paths — macro resolution check (required):** + +For every `${MACRO_NAME}` referenced in the applied include paths, check if that macro is defined in the target project. If missing, copy its definition from the source project, replace the source device name in the value with the target device name, and add it to **all build configurations** in the target project. Record each added macro in `c2000-migration.md`. + +> **Example:** Source defines `C2000WARE_DLIB_ROOT = ${COM_TI_C2000WARE_INSTALL_DIR}/driverlib/f28003x/driverlib/`. The universal target starter does not have this macro, so the include path `--include_path="${C2000WARE_DLIB_ROOT}"` would expand to nothing. Add it to the target project as `C2000WARE_DLIB_ROOT = ${COM_TI_C2000WARE_INSTALL_DIR}/driverlib/f28p551x/driverlib/`. + ## 2.4 Linker flags - Use `getToolFlags` with toolType of `linker` to get all of the linker settings. @@ -139,7 +145,12 @@ Port user customizations from the source cmd onto the target device's cmd file: **Write the final CMD file:** -After all decisions are made, write one linker cmd file to the target project: +After all decisions are made, write exactly one linker cmd file to the target project — +the one matching the active build configuration from step 2.0. Do NOT write a second cmd +file for the other configuration; reading both reference files for context does not mean +writing both. Delete any other `_generic_ram_lnk.cmd` or `_generic_flash_lnk.cmd` files +already present in the target project directory — the imported starter ships with both, +and leaving them causes duplicate MEMORY region errors at link time. - For the name of the cmd file created in the target project, match the name with the source project's linker cmd file name (replace any device name mentions with the target device name). diff --git a/docs/skills/c2000-idea/references/device-migration/phase-4-migrate-code.md b/docs/skills/c2000-idea/references/device-migration/phase-4-migrate-code.md index 49641d5..0d7a228 100644 --- a/docs/skills/c2000-idea/references/device-migration/phase-4-migrate-code.md +++ b/docs/skills/c2000-idea/references/device-migration/phase-4-migrate-code.md @@ -15,8 +15,93 @@ skip the step. Precondition: user application files are already copied into the target project (Step 2.7). +--- + +## Step 4.pre — Download migration guide collateral HTML + +Download the full driverlib diff-report HTML for this migration pair to the **target +project directory** once, so every sub-agent (4A, 4B, 4C) can read it from disk instead +of making a separate network request per symbol. + +### 4.pre.1 — Compute URL and local path + +Read `c2000-migration.md` to get `sourceDevice` and `targetDevice` in **lowercase** +(e.g. `f28003x`, `f28p65x`). Compute SDK version labels based on device families using +the same logic as the IDEA extension: + +| Migration type | `FROM_SDK` | `TO_SDK` | Base URL version | +|---|---|---|---| +| F28x → F28x | `C2000Ware_26_01_00_00` | `C2000Ware_26_01_00_00` | `C2000Ware_26_01_00_00` | +| F28x → F29x | `C2000Ware_26_01_00_00` | `F29H85X-SDK_26_00_00` | `C2000Ware_26_01_00_00` | + +Construct the values: +``` +BASE_URL = https://dev.ti.com/tirex/content//docs/_Migration_Guides/html_pages/ +FILENAME = __vs___driverlib.html +FULL_URL = diff_reports/ +LOCAL_OUT = / +``` + +**Example** (F28003x → F28P65x): +``` +FILENAME = C2000Ware_26_01_00_00_f28003x_vs_C2000Ware_26_01_00_00_f28p65x_driverlib.html +FULL_URL = https://dev.ti.com/tirex/content/C2000Ware_26_01_00_00/docs/C2000Ware_26_01_00_00_Migration_Guides/html_pages/diff_reports/C2000Ware_26_01_00_00_f28003x_vs_C2000Ware_26_01_00_00_f28p65x_driverlib.html +LOCAL_OUT = /C2000Ware_26_01_00_00_f28003x_vs_C2000Ware_26_01_00_00_f28p65x_driverlib.html +``` + +### 4.pre.2 — Run the download + +Run this PowerShell command with the computed values substituted: + +```powershell +powershell -Command " +\$url = '' +\$out = '' +if (-not (Test-Path \$out)) { + Invoke-WebRequest -Uri \$url -OutFile \$out -UseDefaultCredentials -TimeoutSec 60 + Write-Host 'Downloaded' +} else { Write-Host 'Already cached' }" +``` + +`-UseDefaultCredentials` passes the current Windows user's credentials to TI's server +(required when on a corporate network / VPN). `-TimeoutSec 60` aborts on a slow response. + +### 4.pre.3 — Record in c2000-migration.md + +**On success** (prints `Downloaded` or `Already cached`): add this line to `c2000-migration.md`: +``` +Migration guide HTML: +``` + +**On failure** (network error, 404, timeout): the automated download was blocked +(common on corporate networks). Ask the user to download it manually: + +> "The migration guide HTML could not be downloaded automatically. Please open the +> following URL in Chrome or Edge, save the page as: +> +> **URL:** `` +> +> **Save as (exact filename and location):** `` +> +> Once saved, type **done** to continue." + +Wait for the user's confirmation, then verify the file exists at ``. + +- **File found:** record `Migration guide HTML: ` in `c2000-migration.md` and proceed. +- **File not found or user skips:** record `Migration guide HTML: DOWNLOAD FAILED — URL: ` + in `c2000-migration.md`. Sub-agents will fall back to fetching the URL directly. + +Pass the recorded line verbatim in the `Migration guide HTML` field of every sub-agent briefing +(4A, 4B, 4C). Sub-agents use the local file when available and fall back to the URL when not. + +--- + ## Step 4.0 — Strategy and pre-migration report +> **Prerequisite:** Step 4.pre must be complete and `Migration guide HTML` must be +> recorded in `c2000-migration.md` before asking for the migration approach. Every +> sub-agent briefing requires this path. + ### 4.0a Ask the user for migration strategy **Before modifying any files, ask the user:** @@ -59,8 +144,7 @@ branch**, not the source device branch. Do not remove or alter existing markers. all argument reordering, added/removed parameters, and type changes. Do not re-derive arguments. -Record the choice in `c2000-migration.md` **under a dedicated section immediately after the -Phase 4 file list**, formatted exactly as follows — the sub-agents read this exact string: +Record the choice in `c2000-migration.md` in a dedicated section. This section MUST be placed BEFORE the Phase 4 file list section. Formatted exactly as follows — the sub-agents read this exact string: ``` ## Phase 4 — Migration Strategy Strategy: Approach 1 (shared #ifdef) diff --git a/docs/skills/c2000-idea/references/device-migration/phase-4-sub-agent-briefing.md b/docs/skills/c2000-idea/references/device-migration/phase-4-sub-agent-briefing.md index 01bc22f..808c01e 100644 --- a/docs/skills/c2000-idea/references/device-migration/phase-4-sub-agent-briefing.md +++ b/docs/skills/c2000-idea/references/device-migration/phase-4-sub-agent-briefing.md @@ -39,6 +39,7 @@ Briefing: SDK version : Active build config : ← copy verbatim from c2000-migration.md sysConfigOutputLocation : + Migration guide HTML : ← copy verbatim (path or "DOWNLOAD FAILED — URL: ") Files to migrate (in order): 1. @@ -78,6 +79,7 @@ Briefing: SDK version : Active build config : ← copy verbatim from c2000-migration.md sysConfigOutputLocation : + Migration guide HTML : Deferred-errors context : @@ -112,6 +114,7 @@ Briefing: SDK version : Active build config : sysConfigOutputLocation : + Migration guide HTML : All migrated files (from 4A and 4B): .h files: diff --git a/docs/skills/c2000-idea/references/device-migration/phase-4a-headers.md b/docs/skills/c2000-idea/references/device-migration/phase-4a-headers.md index 39714cb..a84f262 100644 --- a/docs/skills/c2000-idea/references/device-migration/phase-4a-headers.md +++ b/docs/skills/c2000-idea/references/device-migration/phase-4a-headers.md @@ -98,22 +98,22 @@ The agent must fix **every** issue — easy or complex: ## Reading Migration Collateral links Each issue may include a `Migration Collateral` URL with a `#` anchor. When -no `Suggested fix` is provided, retrieve and parse it: - -1. Fetch the URL directly. -2. If that fails, try `curl`, then `wget`, then download to a temp file. -3. Save the content locally — do not stream large HTML pages. -4. Strip `