Repository navigation
Conversation
PR Summary by QodoAdd mirror_input PRU example for AM263Px
AI Description
Merge Risk
|
0df4aed to
ff14d4c
Compare
|
Code review by qodo was updated up to the latest commit ff14d4c |
ff14d4c to
d93c48d
Compare
|
Code review by qodo was updated up to the latest commit d93c48d |
d93c48d to
46898dd
Compare
|
Code review by qodo was updated up to the latest commit 46898dd |
46898dd to
854597b
Compare
|
Code review by qodo was updated up to the latest commit 854597b |
854597b to
2e08a95
Compare
|
Code review by qodo was updated up to the latest commit 2e08a95 |
pratheesh
left a comment
There was a problem hiding this comment.
Thanks for the example. The PRU firmware is sound: it assembles cleanly with clpru 2.3.3 and the result is bit-for-bit identical to the committed array. The R5F app also builds clean locally with -Wall -Werror (SDK 11.00.00.19; I don't have the 26.00.00.06 SDK that CI uses). A few things need fixing before merge, and the first two must go in together.
Branch. 7f40a0a3 (PRU-EQEP) is already on main as 36ad4709, and git diff origin/main HEAD -- examples/pru_eqep is empty. Please rebase onto main and drop that commit, so the PR is just the mirror_input change. As it stands, the diff against main also reverts four unrelated files that landed on main after you branched.
Must fix
- CI root cause:
examples/makefile:4-7doesn't listmirror_inputinSUBDIRS. Top-level make never goes into the example, so no.outis produced. The "Verify all makefiles were built" step (.github/workflows/makefile.yml:179-205) then reports both core makefiles as "never built". The CCS builds pass because they import the projectspecs directly. examples/mirror_input/makefileis an unedited copy ofexamples/empty's. It still hasPROJECT_NAME := emptyandSUPPORTED_PROCESSORS := am243x am261x am263px am263x am62x am64x, and the targets call 13 core directories, of which only 2 exist. If you fix (1) on its own, CI fails in a different way. I reproduced that locally:Fix: setgmake[1]: *** firmware/am263px-lp/icss_m0_pru1_fw/ti-pru-cgt: No such file or directory. Stop. gmake: *** [makefile:135: am263px] Error 2PROJECT_NAME := mirror_inputandSUPPORTED_PROCESSORS := am263px, keep only theam263px-lpPRU0 and R5F lines, and delete the other SoC targets.firmware/pru0_load_bin.his a committedhexpruoutput. No other example commits one. It has no license header (best_practices.md:402,:612), and the make flow never reads it because it isn't on any include path. The PRU projectspec does copy it into the CCS project, though (example.projectspec:78, an entryemptydoesn't have), and that is exactly the folder the R5F project includes. So in CCS, building only the R5F project after editingmain.asmsilently runs the committed array. It matches today, so nothing is broken yet. Please delete the file and that<file>entry.
Should fix
TIMING_ANALYSIS.md:42-74. Afterwbssees the edge, two more instructions run before R30 is written, so execution adds 2 cycles (10 ns), not 3.wbsalso samples R31 once per cycle, which adds 0–5 ns of sampling jitter, so the firmware term is 10–15 ns and not constant. The derived "15 ns hardware delay" therefore becomes 15–20 ns. Please also cite the source for the 200 MHz PRU clock, since every number in the file scales with it.readme.mdis still the template. The title is "Empty Project", the HW/SW table at line 19 saysFIXME, andexamples/readme.mdhas nomirror_inputrow even though the readme points readers to it. There is also no pin or wiring table: EPWM goes onPR0_PRU0_GPIO2, the comparator onPR0_PRU0_GPIO0, and the output comes out onPR0_PRU0_GPIO1.- Name and semantics. The loop samples CMP once per EPWM edge (
main.asm:37-62), so a CMP change between edges isn't propagated until the next edge. For an inrush-current-limit gate that's probably what you want, but it isn't a "mirror". Either rename the example or state the edge-sampled behaviour clearly in the readme. That covers qodo's "not mirrored live" finding, which I'd treat as a naming/doc issue rather than a firmware bug. example.syscfgcarries an unrelated 10BASE-T1S/PLCA setup. That includes the ETHPHY, I2C,PLCA_DEBUG_GPOonEPWM8_B,WAKE_PIN,iepSyncMode, an IEP EDIO pin, and several PRU GPIOs the firmware never uses (PR0_PRU0_GPIO4is configured as an output). The three pins the firmware does use are configured correctly. Please strip it down to what the example needs, and keep the IO-expander mux only if it's required (and say why).
Nits
main.asm:1-20: the header is still theemptytemplate ("halt instruction",gmake -all). Line 38's comment saysGPI00and doesn't mention the GPI2 gate.main.asm:40:zero &r0, 124also clears R30, which drives every PRU0 GPO low. That's fine here, but worth a comment;120would leave R30 alone.mcuplus/empty_example.candempty_example_main: consider renaming to match the example.- PR title and body: the title is the branch name and the body is empty. The sign-off is free text rather than a
Signed-off-by:trailer.
qodo findings
- Agree with: broken makefile targets, stale header copied into CCS (I'd rate this one higher), missing supported-hardware row, placeholder readme, project-name string (same root cause as item 2), pin comments (the bot misquoted the lines, but the point stands).
- Partly agree with "host-only builds cannot compile". That's true of every example, and the fix is to delete the committed header, not move it.
PRUICSS_open()handle unchecked: valid, but inherited unchanged fromexamples/empty, so not a blocker here.- The
pru_eqepfinding is out of scope; that code is already on main.
signed off by: Ayushman <a-ayushman@ti.com>
4fede67 to
de768e1
Compare
de768e1 to
6541783
Compare
6541783 to
ddc7f20
Compare
ddc7f20 to
f6990c4
Compare
-> fix build failures -> follow rules from docs_ai/task_create_project.md Signed-off-by: Ayushman <a-ayushman@ti.com>
f6990c4 to
c5a2e3d
Compare
No description provided.