-
Notifications
You must be signed in to change notification settings - Fork 2
project migration enhancement, migration guide collateral usage #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b0d09aa
targetconfigs ccxml file addition in phase1
madyshashank c6c80cc
all mcp related commands along with registering with agent - added i…
madyshashank 228b4b0
C2000WARE_DLIB_ROOT warning corresponding fix
madyshashank e4ab2f5
Wire folder exclusion to IDEA MCP, fix 6 migration scan bugs, add Reg…
madyshashank bc6b376
Lnk cmd issue fix while agent gets deviated
madyshashank cea7ab8
Migration approach confusion which need to be listed very prior to fi…
madyshashank 0a2b716
Merge branch 'main' of https://github.com/TexasInstruments/C2000-IDEA…
madyshashank 0f5579a
Download html migration link into targte project
madyshashank cf6b518
Added rengering migration guide html feature into mcp and integrated …
madyshashank f883d3c
added the six necessary fixes
nimaEskandariTI e963d8d
SDK versions updated
nimaEskandariTI ae557cb
updated in the skill file the version for c2000ware
nimaEskandariTI File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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/`. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of f28003x |
||
|
|
||
| ## 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 — | ||
|
nimaEskandariTI marked this conversation as resolved.
|
||
| 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). | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,7 @@ import { | |
| } from './idea-mcp-config'; | ||
| import { deployIdeaSkills } from '../skills/idea-skills'; | ||
| import { isDeviceF29x } from '../deviceData'; | ||
| import { renderMigrationGuideMarkdown } from '../migrationGuide'; | ||
| import { normalizeMigrationExceptionPath } from '../utilities/utils'; | ||
|
|
||
| let httpServer: http.Server | null = null; | ||
|
|
@@ -71,7 +72,7 @@ export function checkMcp() { | |
| const SERVER_INSTRUCTIONS = `${IDEA_MCP_PLATFORM} development assistant. Provides project discovery, device-to-device migration analysis, and bitfield-to-driverlib migration analysis for ${IDEA_MCP_PLATFORM} MCU projects. | ||
|
|
||
| AVAILABLE TOOLS: | ||
| - get_projects() — Discover projects in the workspace with their device info and paths. | ||
| - get_projects() — Discover projects in the workspace with their device info, paths, and current folder exclusions (migrationFolderExceptions). | ||
| - set_project_current_device() — Manually set a project's current (source) device for migration when the auto-detected device is wrong. | ||
| - set_project_migration_devices() — Set a project's target (migration) device list for device-to-device migration. | ||
| - update_project_file_folder_exceptions() — Read, add, remove, or replace a project's list of file/folder paths excluded from migration checks. | ||
|
|
@@ -81,12 +82,13 @@ AVAILABLE TOOLS: | |
| - get_bitfield_to_driverlib_migration_report() — Run a bitfield-to-driverlib migration check on a source file. Scans for legacy bitfield register accesses and suggests driverlib function replacements. | ||
|
|
||
| RECOMMENDED FLOW: | ||
| 1. Call get_projects() to discover projects, their current devices, and migration targets. If the list is empty or the project you are looking for is missing, call get_projects(rescan: true) once to re-scan the workspace. | ||
| 1. Call get_projects() to discover projects, their current devices, migration targets, and current folder exclusions (migrationFolderExceptions). | ||
| 2. For device-to-device migration (project level — preferred): | ||
| a. Call list_migration_devices() if you need to verify or select device names. | ||
| b. Call get_project_migration_report() with the project name to analyze all files at once. | ||
| c. Issues marked "Auto-fixable" have a concrete code replacement you can apply directly. Issues marked "Needs manual review" require reading the linked migration guide. | ||
| d. After fixing files, call get_device_migration_report() on individual files to verify the fixes are clean. | ||
| b. Check migrationFolderExceptions from get_projects(). If the build output folder and SysConfig-generated folder are not already excluded, call update_project_file_folder_exceptions() with operation "add" and those relative paths before running the report. | ||
| c. Call get_project_migration_report() with the project name to analyze all files at once. | ||
| d. Issues marked "Auto-fixable" have a concrete code replacement you can apply directly. Issues marked "Needs manual review" require reading the linked migration guide. | ||
| e. After fixing files, call get_device_migration_report() on individual files to verify the fixes are clean. | ||
| 3. For bitfield-to-driverlib migration: | ||
| a. Use get_projects() to get the project's currentDevice. | ||
| b. Call get_bitfield_to_driverlib_migration_report() with the file path and sourceDevice. | ||
|
|
@@ -154,6 +156,7 @@ function createMcpServerInstance(): McpServer { | |
| deviceVariant: p.deviceVariant, | ||
| currentDevice: p.migrationState.currentDevice, | ||
| migrationDevices: p.migrationState.migrationDevices, | ||
| migrationFolderExceptions: p.migrationState.migrationCheckFolderExceptions || [], | ||
| hasResumeLog: fs.existsSync(resumeLogPath), | ||
| }; | ||
| }); | ||
|
|
@@ -444,6 +447,35 @@ Pass the sourceDevice from get_projects() to identify the device family for regi | |
| ); | ||
| } | ||
|
|
||
| server.registerTool( | ||
| 'get_migration_guide_section', | ||
| { | ||
| description: `Get a section of a downloaded TI driverlib migration-guide HTML report as Markdown. | ||
|
|
||
| Given the local path to the HTML file (downloaded in the migration workflow) and a symbol anchor (the fragment from a Migration Collateral URL, e.g. "CMPSS_configFilterHigh"), returns a structured Markdown block describing the change: old/new function signatures, argument changes, removed/added parameters, and the full diff body. | ||
|
|
||
| Use this instead of reading the raw HTML — the tool navigates the anchor, strips difflib markup, and reconstructs function bodies automatically. | ||
|
|
||
| If the anchor is not found in the report, the result contains "_ERROR: section not found._" — treat this as a fallback signal and try ti-asm-mcp or the local SDK header instead.`, | ||
| inputSchema: { | ||
| htmlPath: z.string().describe('Absolute path to the downloaded migration-guide HTML file (the Migration guide HTML value from c2000-migration.md).'), | ||
| anchor: z.string().describe('Symbol name to look up (e.g. "CMPSS_configFilterHigh"). Matches the #fragment in the Migration Collateral URL.'), | ||
| } as any, | ||
| }, | ||
| async ({ htmlPath, anchor }: any) => { | ||
| if (!fs.existsSync(htmlPath)) { | ||
| return { content: [{ type: 'text' as const, text: `Error: File not found: ${htmlPath}` }] }; | ||
| } | ||
| try { | ||
| const md = renderMigrationGuideMarkdown(htmlPath, anchor); | ||
| return { content: [{ type: 'text' as const, text: md }] }; | ||
| } catch (err) { | ||
| const msg = err instanceof Error ? err.message : String(err); | ||
| return { content: [{ type: 'text' as const, text: `Error getting migration guide section: ${msg}` }] }; | ||
| } | ||
| } | ||
| ); | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are still missing the TRIGGER for downlaod. |
||
| return server; | ||
| } | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how would we do this?