Use AI Agent to port PRU Academy projects#128
Conversation
Review Summary by QodoAI-Assisted Porting of PRU Academy Projects to Multiple Processors with Enhanced Build System
WalkthroughsDescription• **AI-assisted porting of PRU Academy projects to multiple processors**: Successfully ported 4 PRU Academy labs (intc, crc, mac, mac_multiply) to AM243x-evm, AM243x-lp, AM64x-evm, and AM62x-sk platforms • **Comprehensive build system improvements**: Enhanced pru_rules.mak with better linker flag handling, improved makefile patterns with order-only prerequisites, and automatic variable usage • **FreeRTOS integration for MCU+ SDK**: Added FreeRTOS main entry points and complete build infrastructure for AM243x and AM64x R5F cores with syscfg configuration, boot image generation, and CCS project specifications • **Extensive linker command files**: Added 60+ PRU linker configuration files for all ported projects across different processor variants and core types (PRU, RTU, TX_PRU) • **Runtime debugging support**: Added 70+ ROV (Runtime Object View) configuration files for FreeRTOS debugging across all ported firmware variants • **Project specification updates**: Modernized 50+ CCS project specifications with simplified compiler options, removed MCU_PLUS_SDK dependencies where appropriate, and standardized build configurations • **Header dependency simplification**: Replaced TI-specific driver includes with standard stdint.h in AM62x SOC base address definitions • **Build system enhancements**: Updated intc_mcu makefile to support AM243x and AM64x processors with separate PRU firmware and host code build targets • **Path corrections**: Fixed relative paths in multicore scheduler and FFT example makefiles to accommodate new directory structure • **Validation completed**: All projects build successfully with top-level make, all example.projectspec files import and build in CCS, no errors found in intc_mcu and crc implementations Diagramflowchart LR
A["PRU Academy<br/>Projects<br/>intc, crc, mac"] -->|"AI Agent<br/>Porting Logic"| B["Multi-Processor<br/>Support<br/>AM243x, AM64x,<br/>AM62x"]
B -->|"Linker Configs"| C["60+ Linker<br/>Command Files"]
B -->|"FreeRTOS Integration"| D["R5F MCU+<br/>Build System"]
D -->|"Syscfg & Boot"| E["CCS Project<br/>Specifications"]
B -->|"Debug Support"| F["70+ ROV<br/>Configuration Files"]
G["Build System<br/>Improvements"] -->|"Enhanced<br/>pru_rules.mak"| H["Optimized<br/>Compilation"]
I["Validation"] -->|"Build Success"| J["Ready for<br/>Testing"]
File Changes1. academy/intc/intc_mcu/am243x-evm/r5fss0-0_freertos/main.c
|
Code Review by Qodo
|
manojKoppolu
left a comment
There was a problem hiding this comment.
Changes from PR 125 & PR 127 are not taken into account while porting.
350cb0e to
ec39e51
Compare
Review Summary by QodoAI-Assisted Porting of PRU Academy Projects to Multiple TI Processors
WalkthroughsDescription• AI-assisted porting of 4 PRU Academy projects (intc, crc, mac, mac_multiply) to multiple TI processors (AM243x EVM, AM243x LaunchPad, AM64x EVM, AM62x SK) • Added comprehensive build infrastructure including linker configurations, makefiles, SysConfig files, and CCS project specifications for all target platforms • Implemented FreeRTOS main entry points for R5F cores on AM243x and AM64x platforms with system initialization and task scheduling • Extended top-level makefiles to support multi-processor builds with proper firmware compilation for PRU, RTU, and TX-PRU cores • Added Runtime Object View (ROV) configuration files for FreeRTOS debugging support across all firmware targets • Successfully validated that all projects build with top-level make and import/build in Code Composer Studio (CCS) • Verified AI agent correctly identified that MCU+ project cannot be ported to AM62x (TI only supports PRU loading from Linux A53 on AM62x) • Note: Ported code has not been tested on silicon; board-level configuration requirements (pinmuxing) not yet validated Diagramflowchart LR
A["Original Academy Projects<br/>intc, crc, mac, mac_multiply"] -->|"AI Agent Port"| B["Multi-Processor Support"]
B --> C["AM243x EVM"]
B --> D["AM243x LaunchPad"]
B --> E["AM64x EVM"]
B --> F["AM62x SK"]
C --> G["PRU/RTU/TX-PRU Firmware<br/>+ R5F FreeRTOS"]
D --> G
E --> G
F --> H["PRU Firmware Only<br/>No MCU Support"]
G --> I["Build Artifacts<br/>Linkers, SysConfig, CCS Projects"]
H --> I
I --> J["Validated: CCS Import & Build"]
File Changes1. academy/intc/intc_mcu/am243x-evm/r5fss0-0_freertos/main.c
|
|
Persistent review updated to latest commit ec39e51 |
ec39e51 to
2bf6784
Compare
Review Summary by QodoAI-assisted porting of PRU Academy labs to multiple processor variants
WalkthroughsDescription• AI-assisted porting of 4 PRU Academy labs (UART loopback, MAC operations, CRC, and interrupt controller) to multiple processor variants (AM243x EVM, AM243x LaunchPad, AM64x EVM, and AM62x SK) • Added comprehensive firmware implementations for PRU cores including UART loopback test, MAC (multiply-accumulate) operations, and MCU+ R5F FreeRTOS integration • Generated platform-specific linker configurations for all PRU core types (PRU, TX_PRU, RTU) across supported processors • Added FreeRTOS main entry points and task initialization for AM243x and AM64x MCU R5F cores • Created CCS project specification files and build makefiles for all ported projects • Added Runtime Object View (ROV) configuration files for FreeRTOS debugging support across all cores • Updated academy makefile to include new mac_c and uart_loopback projects • Enhanced documentation with training section, improved build instructions, and simplified example readmaps • All projects successfully build with top-level make and import into CCS • Validated code review of intc_mcu and crc implementations with no errors found • Note: Ported code has not been tested on silicon; AI agent not yet tested on projects requiring board-level configuration like pinmuxing Diagramflowchart LR
A["PRU Academy Labs<br/>UART, MAC, CRC, INTC"] -->|"AI Agent<br/>Port Action"| B["Platform Variants<br/>AM243x/AM64x/AM62x"]
B -->|"Generate"| C["Firmware Code<br/>main.c implementations"]
B -->|"Generate"| D["Linker Configs<br/>PRU/TX_PRU/RTU cores"]
B -->|"Generate"| E["Build System<br/>Makefiles & SysConfig"]
B -->|"Generate"| F["CCS Projects<br/>example.projectspec"]
C --> G["Build & Validate"]
D --> G
E --> G
F --> G
G -->|"Success"| H["All projects build<br/>and import to CCS"]
File Changes1. academy/uart/uart_loopback/firmware/main.c
|
|
Persistent review updated to latest commit 2bf6784 |
| | am261x | TODO | MCU PLUS SDK TODO, OpenPRU TODO | | ||
| | am263px | TODO | MCU PLUS SDK TODO, OpenPRU TODO | | ||
| | am263x | TODO | MCU PLUS SDK TODO, OpenPRU TODO | |
There was a problem hiding this comment.
1. todo markers in readmes 📘 Rule violation ⚙ Maintainability
New documentation adds TODO markers, which are forbidden by the repo compliance style rules. Leaving TODO in merged docs makes tracking and auditing pending work inconsistent.
Agent Prompt
## Issue description
Documentation added in this PR contains `TODO` markers, but the repo style requires using `FIXME` only.
## Issue Context
This affects newly added/modified readmes that include placeholder validation tables.
## Fix Focus Areas
- academy/intc/intc_mcu/readme.md[35-37]
- academy/getting_started_labs/assembly_code/solution/readme.md[20-25]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| /* 6 KB TX_PRU Instruction RAM */ | ||
| TX_PRU_IMEM : org = 0x00000000 len = 0x00001800 | ||
|
|
||
| PAGE 1: | ||
| /* Data RAMs */ | ||
| /* 8 KB PRU Data RAM 0; use only the first 4 KB for PRU0 and reserve | ||
| * the second 4 KB for RTU0 and Tx_PRU0 */ | ||
| PRU0_DMEM_0 : org = 0x00000000 len = 0x00001000 |
There was a problem hiding this comment.
2. Tabs in linker.cmd 📘 Rule violation ⚙ Maintainability
The new linker command file uses tab characters for indentation and alignment. This violates the whitespace standard requiring spaces-only formatting and can cause inconsistent rendering across tools.
Agent Prompt
## Issue description
A newly added linker command file uses tab characters for indentation/alignment, violating the repo whitespace standard.
## Issue Context
Tabs appear in the `MEMORY`/`SECTIONS` formatting and comment indentation.
## Fix Focus Areas
- academy/intc/intc_mcu/firmware/am243x-evm/icss_g0_tx_pru0_fw/ti-pru-cgt/linker.cmd[12-19]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
|
||
| - Build the R5F project using the CCS project menu. For more details, refer to **the MCU+ SDK documentation > Using SDK with CCS Projects** linked above. | ||
| - For more information about using MCU+ SDK projects with CCS, refer to the | ||
| MCU+ SDK documentation: **Developer Guides > Using SDK with CCS Projects** |
There was a problem hiding this comment.
3. Trailing whitespace in readme 📘 Rule violation ⚙ Maintainability
A modified documentation line includes trailing whitespace. This violates the documentation style requirement to eliminate trailing whitespace for stable diffs and consistent formatting.
Agent Prompt
## Issue description
Documentation includes trailing whitespace on an added line.
## Issue Context
Trailing spaces create unnecessary diffs and can break style checks.
## Fix Focus Areas
- README.md[122-122]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Import PRU Software Support Package (PSSP) project https://git.ti.com/cgit/pru-software-support-package/pru-software-support-package/tree/examples/am62x/PRU_MAC_Multiply_Accum https://git.ti.com/cgit/pru-software-support-package/pru-software-support-package/tree/examples/am64x/PRU_MAC_Multiply_Accum into the OpenPRU repository. This is a test of new documentation to guide AI agents to perform specific actions in the OpenPRU project. This project tested the action "create a new OpenPRU project", when the project does not require any pinmux, SysConfig, etc. The project creation was done by claude code. However, I had to code quite a few manual fixes after the initial project creation. Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
Import PRU Software Support Package (PSSP) project https://git.ti.com/cgit/pru-software-support-package/pru-software-support-package/tree/examples/am62x/PRU_Hardware_UART into the OpenPRU repository. This is a test of new documentation to guide AI agents to perform specific actions in the OpenPRU project. This project tested the action "create a new OpenPRU project", when the project does not require any pinmux, SysConfig, etc. The project creation was done by claude code. However, I had to code quite a few manual fixes after the initial project creation. Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
Add the new mac_c and uart projects to the academy/makefile & academy/readme.md files. Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
Update the readme based on the latest documentation and code. Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
These projects are used as the template for most new projects created in the OpenPRU repository. Update the README template to look the way we expect new project README files to look. Additionally, point to central documentation for creating a new project or building a project, instead of replicating that information per-project. Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
Standardize the README format to match examples/empty. Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
Standardize the README format to match examples/empty. Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
Port academy/crc/crc to all currently supported processors in the OpenPRU repo. This is a test of new documentation to guide AI agents to perform specific actions in the OpenPRU project. This project tested the action "port an existing project to other processors". This code change was 100% written by claude code, though I manually inspected every modified file to ensure correctness. Passing build tests with 0 human intervention: * All core makefiles successfully build and clean from a top-level make * All example.projectspec files successfully import into CCS and build through CCS Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
Port academy/mac/mac to all currently supported processors in the OpenPRU repo. This is a test of new documentation to guide AI agents to perform specific actions in the OpenPRU project. This project tested the action "port an existing project to other processors". This code change was 100% written by claude code. I have not yet inspected all of the code to ensure that it is correct, but I expect it to match the patterns of correctness I saw in the academy/crc/crc project. Passing build tests with 0 human intervention: * All core makefiles successfully build and clean from a top-level make * All example.projectspec files successfully import into CCS and build through CCS Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
Port academy/mac/mac_multiply to all currently supported processors in the OpenPRU repo. This is a test of new documentation to guide AI agents to perform specific actions in the OpenPRU project. This project tested the action "port an existing project to other processors". This code change was 100% written by claude code. I have not yet inspected all of the code to ensure that it is correct, but I expect it to match the patterns of correctness I saw in the academy/crc/crc project. Passing build tests with 0 human intervention: * All core makefiles successfully build and clean from a top-level make * All example.projectspec files successfully import into CCS and build through CCS Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
Port academy/intc/intc_mcu to all processors in the OpenPRU repo that support initializing the PRU cores from an MCU+ core. This is a test of new documentation to guide AI agents to perform specific actions in the OpenPRU project. This project tested the action "port an existing project to other processors". The AI agent successfully recognized that the project could be ported to AM243x & AM64x, but not to AM62x, since TI only supports loading PRU cores from Linux A53 on AM62x. This code change was 100% written by claude code, though I manually inspected every modified file to ensure correctness. Passing build tests with 0 human intervention: * All core makefiles successfully build and clean from a top-level make * All example.projectspec files successfully import into CCS and build through CCS Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
After porting crc/crc, mac/mac, mac/mac_multiply, and intc/intc_mcu to all possible processors, the AI agent properly updated academy/readme.md > Supported processors per-project to reflect the successful porting effort. 0% of this code change was written by me, though I read the document to verify the successful changes. Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
2bf6784 to
65918c8
Compare
Review Summary by QodoAI-Assisted Porting of PRU Academy Projects to Multiple Processor Variants
WalkthroughsDescription• AI-assisted porting of 4 PRU Academy labs (UART loopback, MAC operations, interrupt controller, CRC) to multiple processor variants (AM243x EVM/LP, AM64x EVM, AM62x SK) • Comprehensive firmware implementations for PRU cores including UART loopback with 115200 baud configuration, multiply-accumulate (MAC) operations, and FreeRTOS integration on MCU R5F cores • Multi-core support across PRU, TX_PRU, and RTU cores with proper memory layout and linker configurations for each processor variant • FreeRTOS initialization and task management for AM243x and AM64x MCU cores with proper stack allocation and error handling • Runtime Object View (ROV) configuration files for debugging support across all firmware variants • CCS project specification files for seamless IDE integration and building • Updated documentation with training resources, simplified getting started guides, and improved build process instructions • All projects successfully build with top-level make and import into CCS • Validated on multiple processor variants; silicon testing and board-level configuration (pinmuxing) remain non-validated Diagramflowchart LR
A["PRU Academy Labs<br/>UART, MAC, INTC, CRC"] -->|"AI Agent Porting"| B["Multi-Processor Support<br/>AM243x/AM64x/AM62x"]
B -->|"Firmware"| C["PRU/TX_PRU/RTU Cores<br/>with FreeRTOS MCU"]
B -->|"Build Config"| D["Linkers, Makefiles,<br/>SysConfig, ProjectSpec"]
B -->|"Debugging"| E["ROV Configurations<br/>for CCS Integration"]
C -->|"Validated"| F["Builds & CCS Import"]
D -->|"Validated"| F
E -->|"Validated"| F
File Changes1. academy/uart/uart_loopback/firmware/main.c
|
|
Persistent review updated to latest commit 65918c8 |
| ifeq ($(OS), Windows_NT) | ||
| PYTHON=python | ||
| else | ||
| PYTHON=python3 | ||
| endif |
There was a problem hiding this comment.
1. Tabs in ti-arm-clang/makefile 📘 Rule violation ⚙ Maintainability
The newly added makefile contains tab characters (e.g., before PYTHON=...). This violates the whitespace restriction that disallows tabs and nonstandard whitespace.
Agent Prompt
## Issue description
The makefile includes tab characters, which are disallowed by the whitespace compliance rule.
## Issue Context
GNU Make traditionally uses tabs for recipe lines; if this repository requires no tabs, consider using `.RECIPEPREFIX` and a non-tab prefix (or otherwise removing tabs while keeping make semantics intact).
## Fix Focus Areas
- academy/intc/intc_mcu/am243x-evm/r5fss0-0_freertos/ti-arm-clang/makefile[19-23]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| ifeq ($(SYSTEM_FLAG), false) | ||
| syscfg: ../example.syscfg | ||
| @echo Generating SysConfig files ... | ||
| $(SYSCFG_NODE) $(SYSCFG_CLI_PATH)/dist/cli.js --product $(SYSCFG_SDKPRODUCT) --product $(SYSCFG_MCU_PLUS_SDK_PRODUCT) --context r5fss0-0 --part ALV --package ALV --output generated/ ../example.syscfg |
There was a problem hiding this comment.
2. Makefile line exceeds 129 📘 Rule violation ⚙ Maintainability
The added SysConfig command line in the makefile is far longer than the 129-column hard limit. Overlong lines reduce readability and violate the documented line-length limits.
Agent Prompt
## Issue description
A makefile command exceeds the 129-column hard limit.
## Issue Context
Long command lines should be wrapped using `\` line continuations and indentation to keep lines within limits.
## Fix Focus Areas
- academy/intc/intc_mcu/am243x-evm/r5fss0-0_freertos/ti-arm-clang/makefile[257-257]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| export OPEN_PRU_PATH?=$(abspath ../../../../../..) | ||
| include $(OPEN_PRU_PATH)/imports.mak | ||
| include $(MCU_PLUS_SDK_PATH)/devconfig/devconfig.mak |
There was a problem hiding this comment.
3. open_pru_path depends on cwd 📘 Rule violation ☼ Reliability
OPEN_PRU_PATH is derived from a relative path via $(abspath ../../../../../..) which depends on the caller's working directory. This can break includes like include $(OPEN_PRU_PATH)/imports.mak when make is invoked from a different directory.
Agent Prompt
## Issue description
`OPEN_PRU_PATH` is computed in a way that can depend on the working directory, which can break `include` statements.
## Issue Context
Compute the root path relative to the makefile location (e.g., using `$(lastword $(MAKEFILE_LIST))` and `$(dir ...)`) rather than assuming the current directory.
## Fix Focus Areas
- academy/intc/intc_mcu/am243x-evm/r5fss0-0_freertos/ti-arm-clang/makefile[5-7]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
This is a test of new documentation to guide AI agents to perform specific actions in the OpenPRU project. This project tested the action "port an existing project to other processors". The AI agent successfully ported all 4 PRU Academy labs to all possible projects, including recognizing that the MCU+ project could not be ported to AM62x, since TI only supports loading PRU cores from Linux A53 on AM62x.
Completed tests:
Non-validated behavior:
This PR relies on PR132, so it must be merged AFTER that pull request is merged.