From fe93d9ec99d0284ad34b4fe4b4051b286305483e Mon Sep 17 00:00:00 2001 From: Ayushman Date: Mon, 26 Oct 2026 16:46:02 +0530 Subject: [PATCH 01/10] Fix issue for PR8 - Move driver (pru_i2s_drv.c/h, pru_i2s_config.h) to source/i2s/ and add source/i2s/makefile with all/clean targets - Rewrite 8 per-core firmware makefiles to use pru_rules.mak (PRU_VERSION=3, outputs in ti-pru-cgt/generated/) - Update example.projectspec files: -v4 -> -v3 - Add firmware/I2S/generated/ and firmware/TDM4/generated/ for array header outputs; update app include paths accordingly - Restructure top-level makefile: guard pru/host inside BUILD_PROJECT check, all: calls - Update README to reflect new directory structure and build flow Signed-off by Ayushman a-ayushman@ti.com --- examples/pru_i2s/README.md | 20 +-- .../ti-pru-cgt/example.projectspec | 4 +- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 101 +++-------- .../ti-pru-cgt/example.projectspec | 4 +- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 103 +++--------- .../ti-pru-cgt/example.projectspec | 4 +- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 102 +++-------- .../ti-pru-cgt/example.projectspec | 4 +- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 102 +++-------- .../pru_i2s/firmware/I2S/pru_i2s_pru0_array.h | 155 ----------------- .../pru_i2s/firmware/I2S/pru_i2s_pru1_array.h | 142 ---------------- .../ti-pru-cgt/example.projectspec | 4 +- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 103 +++--------- .../ti-pru-cgt/example.projectspec | 4 +- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 103 +++--------- .../ti-pru-cgt/example.projectspec | 4 +- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 102 +++-------- .../ti-pru-cgt/example.projectspec | 4 +- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 102 +++-------- .../firmware/TDM4/pru_i2s_tdm4_pru0_array.h | 159 ------------------ .../firmware/TDM4/pru_i2s_tdm4_pru1_array.h | 152 ----------------- examples/pru_i2s/makefile | 100 +++-------- .../ti-arm-clang/example.projectspec | 15 +- .../r5fss0-0_freertos/ti-arm-clang/makefile | 9 +- .../ti-arm-clang/example.projectspec | 12 +- .../r5fss0-0_freertos/ti-arm-clang/makefile | 9 +- .../pru_i2s/pru_i2s_app/pru_i2s_diagnostic.c | 8 +- source/i2s/makefile | 98 +++++++++++ source/i2s/pru_i2s_app_config.c | 110 ++++++++++++ source/i2s/pru_i2s_app_config.h | 94 +++++++++++ .../include => source/i2s}/pru_i2s_config.h | 0 .../driver => source/i2s}/pru_i2s_drv.c | 0 .../include => source/i2s}/pru_i2s_drv.h | 0 33 files changed, 597 insertions(+), 1336 deletions(-) delete mode 100644 examples/pru_i2s/firmware/I2S/pru_i2s_pru0_array.h delete mode 100644 examples/pru_i2s/firmware/I2S/pru_i2s_pru1_array.h delete mode 100644 examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru0_array.h delete mode 100644 examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru1_array.h create mode 100644 source/i2s/makefile create mode 100644 source/i2s/pru_i2s_app_config.c create mode 100644 source/i2s/pru_i2s_app_config.h rename {examples/pru_i2s/include => source/i2s}/pru_i2s_config.h (100%) rename {examples/pru_i2s/driver => source/i2s}/pru_i2s_drv.c (100%) rename {examples/pru_i2s/include => source/i2s}/pru_i2s_drv.h (100%) diff --git a/examples/pru_i2s/README.md b/examples/pru_i2s/README.md index 2a946495d..06d9d08ba 100644 --- a/examples/pru_i2s/README.md +++ b/examples/pru_i2s/README.md @@ -42,7 +42,7 @@ This ensures continuous and efficient data transmission/reception with minimal l | Processor | Hardware | Software | |-----------|----------|----------| -| AM263x | Control Card (TMDSCNCD263) + HSECDOCK | MCU+ SDK AM263x 11.0, CCS 21.0.1, SysConfig 1.28.1, PRU CGT 2.3.3 | +| AM263x | Control Card (TMDSCNCD263) + HSECDOCK | OpenPRU 2026.02, MCU+ SDK AM263x 11.0, CCS 21.0.1, SysConfig 1.28.1, PRU CGT 2.3.3 | | AM261x | LaunchPad LP-AM261 REV A | MCU+ SDK AM261x 11.0, CCS 21.0.1, SysConfig 1.28.1, PRU CGT 2.3.3 | --- @@ -162,7 +162,6 @@ pru_i2s/ ├── README.md # This file ├── makefile # Top-level makefile ├── firmware/ # PRU firmware source code -│ ├── include/ # Shared firmware headers │ ├── I2S/ # I2S protocol implementation │ │ ├── pru_i2s_main.asm # Main firmware logic │ │ ├── fw_regs.asm # Register definitions @@ -170,6 +169,7 @@ pru_i2s/ │ │ ├── icss_pru_i2s_fw.h # Firmware register map │ │ ├── pru_i2s_interface.h # Interface definitions │ │ ├── pru_i2s_regs.h # Hardware registers +│ │ ├── generated/ # Generated firmware array headers (build output, gitignored) │ │ ├── pru0_tx/ # TX firmware builds │ │ │ ├── am261x-lp/ # AM261x variant │ │ │ └── am263x-cc/ # AM263x variant @@ -177,12 +177,7 @@ pru_i2s/ │ │ ├── am261x-lp/ │ │ └── am263x-cc/ │ └── TDM4/ # TDM4 protocol (parallel structure) -│ └── (same as I2S) -├── driver/ # PRU I2S driver implementation -│ └── pru_i2s_drv.c # Driver source (~2400 lines) -├── include/ # Driver public headers -│ ├── pru_i2s_drv.h # Driver API (~1000+ lines) -│ └── pru_i2s_pruss_intc_mapping.h # INTC definitions +│ └── (same structure as I2S, with pru_i2s_tdm4_pru0/1_array.h generated) ├── pru_i2s_app/ # R5F host application │ ├── board/ # Board support files │ │ ├── ioexp_tca6416.c # IO expander driver @@ -224,8 +219,11 @@ make DEVICE=am261x clean **What gets built:** - 4 PRU firmware binaries per device (I2S PRU0 TX, I2S PRU1 RX, TDM4 PRU0 TX, TDM4 PRU1 RX) -- Firmware header arrays (`.h` files for embedding in application) -- R5F application binary (`.out` and `.appimage`) +- Firmware header arrays (`.h` files) generated into `firmware/I2S/generated/` and `firmware/TDM4/generated/` (gitignored) +- PRU I2S driver library (`lib/pru_i2s.*.lib`) built from `source/i2s/makefile` +- R5F application binary (`.out` and `.mcelf`) + +**Note:** The PRU firmware makefiles use `pru_rules.mak` (silicon version `-v3`, PRUSS/PRU-ICSS) and place all build artifacts in a `ti-pru-cgt/generated/` subdirectory. The library build is owned by `source/i2s/makefile` and is invoked automatically by the top-level `makefile`. ### Building with Code Composer Studio @@ -265,7 +263,7 @@ The R5F application initializes PRU-ICSSG, downloads firmware to PRU cores, and │ (pru_i2s_diagnostic.c) │ ├─────────────────────────────┤ │ PRU I2S Driver │ -│ (pru_i2s_drv.c) │ +│ (source/i2s/pru_i2s_drv.c)│ ├─────────────────────────────┤ │ MCU+ SDK Drivers │ │ (PRUICSS, GPIO, etc.) │ diff --git a/examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec index bf3634dd2..87f64ecb4 100644 --- a/examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec @@ -36,7 +36,7 @@ -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S -DPRU0 -DSLICE0 - -v4 + -v3 -DSOC_AM261X -DPRU0 -DI2S_TX @@ -52,7 +52,7 @@ " postBuildStep=" - $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=pru_prupru_i2s0_image_0 -o pru_i2s_pru0_array.h pru_i2s_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt.out;if ${CCS_HOST_OS} == linux cat ${OPEN_PRU_PATH}/source/firmware/pru_load_bin_copyright.h pru_i2s_pru0_array.h > ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S/pru_i2s_pru0_array.h;if ${CCS_HOST_OS} == linux rm pru_i2s_pru0_array.h;if ${CCS_HOST_OS} == win32 $(CCS_INSTALL_DIR)/utils/cygwin/cat ${OPEN_PRU_PATH}/source/firmware/pru_load_bin_copyright.h pru_i2s_pru0_array.h > ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S/pru_i2s_pru0_array.h;if ${CCS_HOST_OS} == win32 $(CCS_INSTALL_DIR)/utils/cygwin/rm pru_i2s_pru0_array.h; + $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=pru_prupru_i2s0_image_0 -o ../pru_i2s_pru0_array.h pru_i2s_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt.out " description="A Pru I2s Pru0 Array FW project"> diff --git a/examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile index 9de227832..9755dab56 100644 --- a/examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -1,91 +1,42 @@ ################################################################################ # PRU I2S - I2S Protocol - PRU0 TX - AM261x-LP ################################################################################ -# Build firmware for PRU I2S transmit (TX) using I2S protocol export OPEN_PRU_PATH?=$(abspath ../../../../../../../..) include $(OPEN_PRU_PATH)/imports.mak -CG_TOOL_ROOT := $(CGT_TI_PRU_PATH) -GEN_DIR := . +# Define build outputs +OUTPUT_NAME := pru_i2s_am261x-lp_icssm0-pru0_fw -# Add inputs and outputs from these tool invocations to the build variables -CMD_SRCS += \ - linker.cmd \ +# MCU+ projects: rename & move hex array output +MCU_HEX_NAME := pru_i2s_pru0_array.h +HEX_ARRAY_PREFIX := pru_prupru_i2s0_image_0 +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/I2S/$(MCU_HEX_NAME) -ASM_SRCS += \ - pru_i2s_main.asm \ - fw_regs.asm \ +# which directories to search for assembly & C source files? +FILES_PATH := ../../../../ -OBJS += \ - pru_i2s_main.obj \ - fw_regs.obj \ +# Linker command file +COMMAND_FILES := linker.cmd -ASM_DEPS += \ - pru_i2s_main.d \ - fw_regs.d \ +# Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) +PRU_VERSION := 3 +EXPECTED_DEVICE := am261x -OBJDIR := . -FILES_PATH_common = \ - .. \ - ../../.. \ - ../../../.. \ - ../../../../.. \ -FILES_PATH := $(FILES_PATH_common) +# pru_rules.mak has shared settings for all PRU/RTU/TX_PRU core makefiles +include $(OPEN_PRU_PATH)/pru_rules.mak -vpath %.asm $(FILES_PATH) -vpath %.obj $(OBJDIR) -vpath %.cmd $(FILES_PATH) +# Additional include paths for I2S firmware headers +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/I2S - -# Add inputs and outputs from these tool invocations to the build variables -EXE_OUTPUTS += \ -pru_i2s_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt.out \ - -EXE_OUTPUTS__QUOTED += \ -"pru_i2s_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt.out" \ - -BIN_OUTPUTS += \ -pru_i2s_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt.hex \ - -BIN_OUTPUTS__QUOTED += \ -"pru_i2s_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt.hex" \ - -# All Target -all: $(OBJS) $(CMD_SRCS) - @$(MAKE) --no-print-directory -Onone "pru_i2s_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt.out" - -# Each subdirectory must supply rules for building sources it contributes -$(OBJDIR)/%.obj %.obj: %.asm - @echo 'Building file: "$^"' - @echo 'Invoking: PRU Compiler' - "$(CGT_TI_PRU_PATH)/bin/clpru" -DPRU0 -DSLICE0 -v4 --define=SOC_AM261X --define=PRU0 --define=I2S_TX --define=NUMBER_OF_TX_3 --define=I2S_TX_DETECT_UNDERFLOW --include_path="${CG_TOOL_ROOT}/include" --include_path="${MCU_PLUS_SDK_PATH}/source" --include_path="${OPEN_PRU_PATH}/source" --include_path="${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include" --include_path="${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S" --define=_DEBUG_=1 -g --diag_warning=225 --diag_wrap=off --display_error_number --endian=little --preproc_with_compile --preproc_dependency="$(basename $( ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S/pru_i2s_pru0_array.h - -$(RM) pru_i2s_pru0_array.h - -@echo ' ' - -.PHONY: all clean +# Defines: PRU0, I2S Tx, 3 Tx channels, underflow detection +DFLAGS := \ + -DPRU0 -DSLICE0 \ + --define=SOC_AM261X \ + --define=PRU0 \ + --define=I2S_TX \ + --define=NUMBER_OF_TX_3 \ + --define=I2S_TX_DETECT_UNDERFLOW diff --git a/examples/pru_i2s/firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec index db2e6562d..97141a484 100644 --- a/examples/pru_i2s/firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec @@ -36,7 +36,7 @@ -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S -DPRU0 -DSLICE0 - -v4 + -v3 -DSOC_AM263X -DPRU0 -DI2S_TX @@ -52,7 +52,7 @@ " postBuildStep=" - $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=pru_prupru_i2s0_image_0 -o pru_i2s_pru0_array.h pru_i2s_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt.out;if ${CCS_HOST_OS} == linux cat ${OPEN_PRU_PATH}/source/firmware/pru_load_bin_copyright.h pru_i2s_pru0_array.h > ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S/pru_i2s_pru0_array.h;if ${CCS_HOST_OS} == linux rm pru_i2s_pru0_array.h;if ${CCS_HOST_OS} == win32 $(CCS_INSTALL_DIR)/utils/cygwin/cat ${OPEN_PRU_PATH}/source/firmware/pru_load_bin_copyright.h pru_i2s_pru0_array.h > ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S/pru_i2s_pru0_array.h;if ${CCS_HOST_OS} == win32 $(CCS_INSTALL_DIR)/utils/cygwin/rm pru_i2s_pru0_array.h; + $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=pru_prupru_i2s0_image_0 -o ../pru_i2s_pru0_array.h pru_i2s_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt.out " description="A Pru I2s Pru0 Array FW project"> diff --git a/examples/pru_i2s/firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile index 93bf4bb34..8350c08f8 100644 --- a/examples/pru_i2s/firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -1,90 +1,41 @@ ################################################################################ -# PRU I2S Firmware Makefile +# PRU I2S - I2S Protocol - PRU0 TX - AM263x-CC ################################################################################ -# Required input arguments : -# Build firmware for PRU I2S Use this input argument to include files from external paths export OPEN_PRU_PATH?=$(abspath ../../../../../../../..) include $(OPEN_PRU_PATH)/imports.mak -CG_TOOL_ROOT := $(CGT_TI_PRU_PATH) -# Add inputs and outputs from these tool invocations to the build variables -CMD_SRCS += \ - linker.cmd \ +# Define build outputs +OUTPUT_NAME := pru_i2s_am263x-cc_icssm0-pru0_fw -ASM_SRCS += \ - pru_i2s_main.asm \ - fw_regs.asm \ +# MCU+ projects: rename & move hex array output +MCU_HEX_NAME := pru_i2s_pru0_array.h +HEX_ARRAY_PREFIX := pru_prupru_i2s0_image_0 +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/I2S/$(MCU_HEX_NAME) -OBJS += \ - pru_i2s_main.obj \ - fw_regs.obj \ +# which directories to search for assembly & C source files? +FILES_PATH := ../../../../ -ASM_DEPS += \ - pru_i2s_main.d \ - fw_regs.d \ +# Linker command file +COMMAND_FILES := linker.cmd -OBJDIR := . +# Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) +PRU_VERSION := 3 +EXPECTED_DEVICE := am263x -FILES_PATH_common = \ - .. \ - ../../.. \ - ../../../.. \ - ../../../../.. \ -FILES_PATH := $(FILES_PATH_common) +# pru_rules.mak has shared settings for all PRU/RTU/TX_PRU core makefiles +include $(OPEN_PRU_PATH)/pru_rules.mak -vpath %.asm $(FILES_PATH) -vpath %.obj $(OBJDIR) -vpath %.cmd $(FILES_PATH) +# Additional include paths for I2S firmware headers +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/I2S - -# Add inputs and outputs from these tool invocations to the build variables -EXE_OUTPUTS += \ -pru_i2s_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt.out \ - -EXE_OUTPUTS__QUOTED += \ -"pru_i2s_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt.out" \ - -BIN_OUTPUTS += \ -pru_i2s_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt.hex \ - -BIN_OUTPUTS__QUOTED += \ -"pru_i2s_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt.hex" \ - -# All Target -all: $(OBJS) $(CMD_SRCS) - @$(MAKE) --no-print-directory -Onone "pru_i2s_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt.out" - -# Each subdirectory must supply rules for building sources it contributes -$(OBJDIR)/%.obj %.obj: %.asm - @echo 'Building file: "$^"' - @echo 'Invoking: PRU Compiler' - "$(CGT_TI_PRU_PATH)/bin/clpru" -DPRU0 -DSLICE0 -v4 --define=SOC_AM263X --define=PRU0 --define=I2S_TX --define=NUMBER_OF_TX_3 --define=I2S_TX_DETECT_UNDERFLOW --include_path="${CG_TOOL_ROOT}/include" --include_path="${MCU_PLUS_SDK_PATH}/source" --include_path="${OPEN_PRU_PATH}/source" --include_path="${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include" --include_path="${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S" --define=_DEBUG_=1 -g --diag_warning=225 --diag_wrap=off --display_error_number --endian=little --preproc_with_compile --preproc_dependency="$(basename $( ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S/pru_i2s_pru0_array.h - -$(RM) pru_i2s_pru0_array.h - -@echo ' ' - -.PHONY: all clean +# Defines: PRU0, I2S Tx, 3 Tx channels, underflow detection +DFLAGS := \ + -DPRU0 -DSLICE0 \ + --define=SOC_AM263X \ + --define=PRU0 \ + --define=I2S_TX \ + --define=NUMBER_OF_TX_3 \ + --define=I2S_TX_DETECT_UNDERFLOW diff --git a/examples/pru_i2s/firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec index 7648e0ce1..8fec3fc4a 100644 --- a/examples/pru_i2s/firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec @@ -36,7 +36,7 @@ -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S -DPRU1 -DSLICE1 - -v4 + -v3 -DSOC_AM261X -DPRU1 -DI2S_RX @@ -51,7 +51,7 @@ " postBuildStep=" - $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=pru_prupru_i2s1_image_0 -o pru_i2s_pru1_array.h pru_i2s_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt.out;if ${CCS_HOST_OS} == linux cat ${OPEN_PRU_PATH}/source/firmware/pru_load_bin_copyright.h pru_i2s_pru1_array.h > ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S/pru_i2s_pru1_array.h;if ${CCS_HOST_OS} == linux rm pru_i2s_pru1_array.h;if ${CCS_HOST_OS} == win32 $(CCS_INSTALL_DIR)/utils/cygwin/cat ${OPEN_PRU_PATH}/source/firmware/pru_load_bin_copyright.h pru_i2s_pru1_array.h > ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S/pru_i2s_pru1_array.h;if ${CCS_HOST_OS} == win32 $(CCS_INSTALL_DIR)/utils/cygwin/rm pru_i2s_pru1_array.h; + $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=pru_prupru_i2s1_image_0 -o ../pru_i2s_pru1_array.h pru_i2s_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt.out " description="A Pru I2s Pru1 Array FW project"> diff --git a/examples/pru_i2s/firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile index 9afcd4155..bc2a797c6 100644 --- a/examples/pru_i2s/firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -1,90 +1,40 @@ ################################################################################ -# PRU I2S Firmware Makefile +# PRU I2S - I2S Protocol - PRU1 RX - AM261x-LP ################################################################################ -# Required input arguments : -# Build firmware for PRU I2S Use this input argument to include files from external paths export OPEN_PRU_PATH?=$(abspath ../../../../../../../..) include $(OPEN_PRU_PATH)/imports.mak -CG_TOOL_ROOT := $(CGT_TI_PRU_PATH) -# Add inputs and outputs from these tool invocations to the build variables -CMD_SRCS += \ - linker.cmd \ +# Define build outputs +OUTPUT_NAME := pru_i2s_am261x-lp_icssm0-pru1_fw -ASM_SRCS += \ - pru_i2s_main.asm \ - fw_regs.asm \ +# MCU+ projects: rename & move hex array output +MCU_HEX_NAME := pru_i2s_pru1_array.h +HEX_ARRAY_PREFIX := pru_prupru_i2s1_image_0 +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/I2S/$(MCU_HEX_NAME) -OBJS += \ - pru_i2s_main.obj \ - fw_regs.obj \ +# which directories to search for assembly & C source files? +FILES_PATH := ../../../../ -ASM_DEPS += \ - pru_i2s_main.d \ - fw_regs.d \ +# Linker command file +COMMAND_FILES := linker.cmd -OBJDIR := . +# Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) +PRU_VERSION := 3 +EXPECTED_DEVICE := am261x -FILES_PATH_common = \ - .. \ - ../../.. \ - ../../../.. \ - ../../../../.. \ -FILES_PATH := $(FILES_PATH_common) +# pru_rules.mak has shared settings for all PRU/RTU/TX_PRU core makefiles +include $(OPEN_PRU_PATH)/pru_rules.mak -vpath %.asm $(FILES_PATH) -vpath %.obj $(OBJDIR) -vpath %.cmd $(FILES_PATH) +# Additional include paths for I2S firmware headers +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/I2S - -# Add inputs and outputs from these tool invocations to the build variables -EXE_OUTPUTS += \ -pru_i2s_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt.out \ - -EXE_OUTPUTS__QUOTED += \ -"pru_i2s_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt.out" \ - -BIN_OUTPUTS += \ -pru_i2s_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt.hex \ - -BIN_OUTPUTS__QUOTED += \ -"pru_i2s_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt.hex" \ - -# All Target -all: $(OBJS) $(CMD_SRCS) - @$(MAKE) --no-print-directory -Onone "pru_i2s_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt.out" - -# Each subdirectory must supply rules for building sources it contributes -$(OBJDIR)/%.obj %.obj: %.asm - @echo 'Building file: "$^"' - @echo 'Invoking: PRU Compiler' - "$(CGT_TI_PRU_PATH)/bin/clpru" -DPRU1 -DSLICE1 -v4 --define=SOC_AM261X --define=PRU1 --define=I2S_RX --define=I2S_RX_DETECT_OVERFLOW --include_path="${CG_TOOL_ROOT}/include" --include_path="${MCU_PLUS_SDK_PATH}/source" --include_path="${OPEN_PRU_PATH}/source" --include_path="${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include" --include_path="${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S" --define=_DEBUG_=1 -g --diag_warning=225 --diag_wrap=off --display_error_number --endian=little --preproc_with_compile --preproc_dependency="$(basename $( ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S/pru_i2s_pru1_array.h - -$(RM) pru_i2s_pru1_array.h - -@echo ' ' - -.PHONY: all clean +# Defines: PRU1, I2S Rx, overflow detection +DFLAGS := \ + -DPRU1 -DSLICE1 \ + --define=SOC_AM261X \ + --define=PRU1 \ + --define=I2S_RX \ + --define=I2S_RX_DETECT_OVERFLOW diff --git a/examples/pru_i2s/firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec index 274f091e9..7e81226f4 100644 --- a/examples/pru_i2s/firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec @@ -36,7 +36,7 @@ -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S -DPRU1 -DSLICE1 - -v4 + -v3 -DSOC_AM263X -DPRU1 -DI2S_RX @@ -51,7 +51,7 @@ " postBuildStep=" - $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=pru_prupru_i2s1_image_0 -o pru_i2s_pru1_array.h pru_i2s_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt.out;if ${CCS_HOST_OS} == linux cat ${OPEN_PRU_PATH}/source/firmware/pru_load_bin_copyright.h pru_i2s_pru1_array.h > ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S/pru_i2s_pru1_array.h;if ${CCS_HOST_OS} == linux rm pru_i2s_pru1_array.h;if ${CCS_HOST_OS} == win32 $(CCS_INSTALL_DIR)/utils/cygwin/cat ${OPEN_PRU_PATH}/source/firmware/pru_load_bin_copyright.h pru_i2s_pru1_array.h > ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S/pru_i2s_pru1_array.h;if ${CCS_HOST_OS} == win32 $(CCS_INSTALL_DIR)/utils/cygwin/rm pru_i2s_pru1_array.h; + $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=pru_prupru_i2s1_image_0 -o ../pru_i2s_pru1_array.h pru_i2s_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt.out " description="A Pru I2s Pru1 Array FW project"> diff --git a/examples/pru_i2s/firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile index 3cb6008c5..e16505f10 100644 --- a/examples/pru_i2s/firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -1,90 +1,40 @@ ################################################################################ -# PRU I2S Firmware Makefile +# PRU I2S - I2S Protocol - PRU1 RX - AM263x-CC ################################################################################ -# Required input arguments : -# Build firmware for PRU I2S Use this input argument to include files from external paths export OPEN_PRU_PATH?=$(abspath ../../../../../../../..) include $(OPEN_PRU_PATH)/imports.mak -CG_TOOL_ROOT := $(CGT_TI_PRU_PATH) -# Add inputs and outputs from these tool invocations to the build variables -CMD_SRCS += \ - linker.cmd \ +# Define build outputs +OUTPUT_NAME := pru_i2s_am263x-cc_icssm0-pru1_fw -ASM_SRCS += \ - pru_i2s_main.asm \ - fw_regs.asm \ +# MCU+ projects: rename & move hex array output +MCU_HEX_NAME := pru_i2s_pru1_array.h +HEX_ARRAY_PREFIX := pru_prupru_i2s1_image_0 +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/I2S/$(MCU_HEX_NAME) -OBJS += \ - pru_i2s_main.obj \ - fw_regs.obj \ +# which directories to search for assembly & C source files? +FILES_PATH := ../../../../ -ASM_DEPS += \ - pru_i2s_main.d \ - fw_regs.d \ +# Linker command file +COMMAND_FILES := linker.cmd -OBJDIR := . +# Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) +PRU_VERSION := 3 +EXPECTED_DEVICE := am263x -FILES_PATH_common = \ - .. \ - ../../.. \ - ../../../.. \ - ../../../../.. \ -FILES_PATH := $(FILES_PATH_common) +# pru_rules.mak has shared settings for all PRU/RTU/TX_PRU core makefiles +include $(OPEN_PRU_PATH)/pru_rules.mak -vpath %.asm $(FILES_PATH) -vpath %.obj $(OBJDIR) -vpath %.cmd $(FILES_PATH) +# Additional include paths for I2S firmware headers +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/I2S - -# Add inputs and outputs from these tool invocations to the build variables -EXE_OUTPUTS += \ -pru_i2s_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt.out \ - -EXE_OUTPUTS__QUOTED += \ -"pru_i2s_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt.out" \ - -BIN_OUTPUTS += \ -pru_i2s_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt.hex \ - -BIN_OUTPUTS__QUOTED += \ -"pru_i2s_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt.hex" \ - -# All Target -all: $(OBJS) $(CMD_SRCS) - @$(MAKE) --no-print-directory -Onone "pru_i2s_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt.out" - -# Each subdirectory must supply rules for building sources it contributes -$(OBJDIR)/%.obj %.obj: %.asm - @echo 'Building file: "$^"' - @echo 'Invoking: PRU Compiler' - "$(CGT_TI_PRU_PATH)/bin/clpru" -DPRU1 -DSLICE1 -v4 --define=SOC_AM263X --define=PRU1 --define=I2S_RX --define=I2S_RX_DETECT_OVERFLOW --include_path="${CG_TOOL_ROOT}/include" --include_path="${MCU_PLUS_SDK_PATH}/source" --include_path="${OPEN_PRU_PATH}/source" --include_path="${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include" --include_path="${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S" --define=_DEBUG_=1 -g --diag_warning=225 --diag_wrap=off --display_error_number --endian=little --preproc_with_compile --preproc_dependency="$(basename $( ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S/pru_i2s_pru1_array.h - -$(RM) pru_i2s_pru1_array.h - -@echo ' ' - -.PHONY: all clean +# Defines: PRU1, I2S Rx, overflow detection +DFLAGS := \ + -DPRU1 -DSLICE1 \ + --define=SOC_AM263X \ + --define=PRU1 \ + --define=I2S_RX \ + --define=I2S_RX_DETECT_OVERFLOW diff --git a/examples/pru_i2s/firmware/I2S/pru_i2s_pru0_array.h b/examples/pru_i2s/firmware/I2S/pru_i2s_pru0_array.h deleted file mode 100644 index bf92fe82d..000000000 --- a/examples/pru_i2s/firmware/I2S/pru_i2s_pru0_array.h +++ /dev/null @@ -1,155 +0,0 @@ -const uint32_t pru_prupru_i2s0_image_0_0[] = { -0x0b015b5b, -0x51005b0c, -0x240000e4, -0x240000f7, -0x240000ea, -0x240004f7, -0xf1003782, -0x240008f7, -0xf100178a, -0x00eae2e1, -0xe1002284, -0x0104e2e2, -0x66e1e2fe, -0x2effbf80, -0x240002eb, -0x24001af9, -0x240002f7, -0xe1001917, -0x240001f7, -0xe1011917, -0x2400015a, -0x2400017a, -0x24001f1a, -0x240004f7, -0xf1003780, -0x10e0e0e2, -0x240008f7, -0xf100178a, -0x0b01eaea, -0x00eae0e1, -0x10e1e1e3, -0xf100a084, -0x010ce0e0, -0xd106ff00, -0xd101ff00, -0xc901ff00, -0xd101ff00, -0xd106ff00, -0xc906ff00, -0x10ebfffc, -0x51001619, -0x511e160b, -0x511f160f, -0x511d1611, -0x01011616, -0x2400007b, -0x71013602, -0x21005500, -0x24000036, -0x0b01fcfc, -0x6856fc40, -0x21005500, -0x0b01fcfc, -0x6856fc3d, -0x15015656, -0x01011616, -0x21005500, -0x01013636, -0x24000016, -0x21005500, -0xf100a097, -0x010ce0e0, -0x01011616, -0x21005500, -0x21002800, -0x50e1e003, -0x01011616, -0x21005500, -0x51015a03, -0x10e2e2e0, -0x21004800, -0x10e3e3e0, -0x00eae0e1, -0x15015a5a, -0x240018f9, -0xe100195a, -0xf102191b, -0x69005a04, -0xc9011b22, -0x1d001b1b, -0x21005300, -0xc9001b1f, -0x1d011b1b, -0x2400017b, -0x01011616, -0xd106ff00, -0x69017b03, -0xe102191b, -0x2400229f, -0x0a1ae4e7, -0x0a1ae5e8, -0x0a1ae6e9, -0x1101e7e7, -0x1101e8e8, -0x1101e9e9, -0x0902e7e7, -0x0903e8e8, -0x0905e9e9, -0x12e8e7e7, -0x12e9e7e7, -0x10e7e7fe, -0x51001a03, -0x05011a1a, -0x21006c00, -0x24001f1a, -0x10f7f7e4, -0x10f8f8e5, -0x10f9f9e6, -0x21002600, -0x21002600, -0x1f005b5b, -0x21007300, -0x1f015b5b, -0x21007300, -0x1f025b5b, -0x24001cf9, -0xe100195b, -0x2400249f, -0x21000000}; - -const uint8_t pru_prupru_i2s0_image_0_1[] = { -0x03, -0x00, -0x30, -0x20, -0x00, -0x00, -0x01, -0x00, -0x08, -0x01, -0x12, -0x13, -0x14, -0x06, -0x01, -0x02, -0x03, -0x05, -0x00, -0x04, -0x00, -0x01, -0x01, -0x00, -0x00, -0x00, -0x02, -0x01, -0x00, -0x00, -0x00, -0x00}; - diff --git a/examples/pru_i2s/firmware/I2S/pru_i2s_pru1_array.h b/examples/pru_i2s/firmware/I2S/pru_i2s_pru1_array.h deleted file mode 100644 index 256234b95..000000000 --- a/examples/pru_i2s/firmware/I2S/pru_i2s_pru1_array.h +++ /dev/null @@ -1,142 +0,0 @@ -const uint32_t pru_prupru_i2s1_image_0_0[] = { -0x2effbf80, -0x240002e7, -0x240004e8, -0x240008e9, -0x24001af9, -0x240002f7, -0xe1001917, -0x240001f7, -0xe1011917, -0x2400015a, -0x2400017a, -0x24001f1a, -0x240019eb, -0x24001bec, -0x240008f7, -0xf100178a, -0x0b01eaea, -0x10eaeaf1, -0x0501f1f1, -0x240014f7, -0xf100378d, -0x10ededef, -0x2400203a, -0x00f1edee, -0x10eeeef0, -0x0101f0f0, -0xd100ff00, -0xd101ff00, -0xc901ff00, -0xd101ff00, -0xd100ff00, -0xc900ff00, -0x10e7fffc, -0x10e8fff2, -0x10e9fff3, -0x60edee16, -0x5100161e, -0x511e160a, -0x511f160e, -0x511d1610, -0x01011616, -0x71013602, -0x21004500, -0x24000036, -0x0b01fcfc, -0x6856fc38, -0x21004500, -0x0b01fcfc, -0x6856fc35, -0x15015656, -0x01011616, -0x21004500, -0x01013636, -0x24000016, -0x21004500, -0x01011616, -0x21004500, -0x51017a03, -0x10efefed, -0x21003d00, -0x10f0f0ed, -0x00f1edee, -0x15017a7a, -0xe1000b7a, -0x2400017b, -0x21002800, -0x01011616, -0x21004500, -0x01011616, -0xd100ff00, -0x69017b0b, -0x2400007b, -0xf1000c3b, -0x69007a04, -0xd1013b17, -0x1f003b3b, -0x21004f00, -0xd1003b14, -0x1f013b3b, -0xe1000c3b, -0x2400269f, -0x21005200, -0x51203a08, -0x0b02f2f2, -0x0b03f3f3, -0x083af2f2, -0x083af3f3, -0x12f2f4f4, -0x12f3f5f5, -0x51003a03, -0x05013a3a, -0x21001f00, -0xe1006d94, -0x0108eded, -0x2eff8792, -0x24001f3a, -0x21001f00, -0x1f005b5b, -0x21006600, -0x1f015b5b, -0x21006600, -0x1f025b5b, -0x24001cf9, -0xe100195b, -0x2400279f, -0x21000000}; - -const uint8_t pru_prupru_i2s1_image_0_1[] = { -0x00, -0x02, -0x30, -0x20, -0x00, -0x02, -0x01, -0x00, -0x00, -0x01, -0x15, -0x16, -0x17, -0x00, -0x01, -0x04, -0x05, -0x06, -0x02, -0x03, -0x00, -0x03, -0x01, -0x00, -0x00, -0x00, -0x02, -0x01, -0x00, -0x00, -0x00, -0x00}; - diff --git a/examples/pru_i2s/firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec index 7af03b2f8..de022acf1 100644 --- a/examples/pru_i2s/firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec @@ -36,7 +36,7 @@ -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4 -DPRU0 -DSLICE0 - -v4 + -v3 -DSOC_AM261X -DPRU0 -DI2S_TX @@ -52,7 +52,7 @@ " postBuildStep=" - $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=pru_prupru_i2s0_image_0 -o pru_i2s_tdm4_pru0_array.h pru_i2s_tdm4_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt.out;if ${CCS_HOST_OS} == linux cat ${OPEN_PRU_PATH}/source/firmware/pru_load_bin_copyright.h pru_i2s_tdm4_pru0_array.h > ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru0_array.h;if ${CCS_HOST_OS} == linux rm pru_i2s_tdm4_pru0_array.h;if ${CCS_HOST_OS} == win32 $(CCS_INSTALL_DIR)/utils/cygwin/cat ${OPEN_PRU_PATH}/source/firmware/pru_load_bin_copyright.h pru_i2s_tdm4_pru0_array.h > ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru0_array.h;if ${CCS_HOST_OS} == win32 $(CCS_INSTALL_DIR)/utils/cygwin/rm pru_i2s_tdm4_pru0_array.h; + $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=pru_prupru_i2s0_image_0 -o ../pru_i2s_tdm4_pru0_array.h pru_i2s_tdm4_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt.out " description="A Pru I2s Tdm4 Pru0 Array FW project"> diff --git a/examples/pru_i2s/firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile index 6766072fe..119bea94f 100644 --- a/examples/pru_i2s/firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -1,90 +1,41 @@ ################################################################################ -# PRU I2S Firmware Makefile +# PRU I2S - TDM4 Protocol - PRU0 TX - AM261x-LP ################################################################################ -# Required input arguments : -# Build firmware for PRU I2S Use this input argument to include files from external paths export OPEN_PRU_PATH?=$(abspath ../../../../../../../..) include $(OPEN_PRU_PATH)/imports.mak -CG_TOOL_ROOT := $(CGT_TI_PRU_PATH) -# Add inputs and outputs from these tool invocations to the build variables -CMD_SRCS += \ - linker.cmd \ +# Define build outputs +OUTPUT_NAME := pru_i2s_tdm4_am261x-lp_icssm0-pru0_fw -ASM_SRCS += \ - pru_i2s_main.asm \ - fw_regs.asm \ +# MCU+ projects: rename & move hex array output +MCU_HEX_NAME := pru_i2s_tdm4_pru0_array.h +HEX_ARRAY_PREFIX := pru_prupru_i2s0_image_0 +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/TDM4/$(MCU_HEX_NAME) -OBJS += \ - pru_i2s_main.obj \ - fw_regs.obj \ +# which directories to search for assembly & C source files? +FILES_PATH := ../../../../ -ASM_DEPS += \ - pru_i2s_main.d \ - fw_regs.d \ +# Linker command file +COMMAND_FILES := linker.cmd -OBJDIR := . +# Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) +PRU_VERSION := 3 +EXPECTED_DEVICE := am261x -FILES_PATH_common = \ - .. \ - ../../.. \ - ../../../.. \ - ../../../../.. \ -FILES_PATH := $(FILES_PATH_common) +# pru_rules.mak has shared settings for all PRU/RTU/TX_PRU core makefiles +include $(OPEN_PRU_PATH)/pru_rules.mak -vpath %.asm $(FILES_PATH) -vpath %.obj $(OBJDIR) -vpath %.cmd $(FILES_PATH) +# Additional include paths for TDM4 firmware headers +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/TDM4 - -# Add inputs and outputs from these tool invocations to the build variables -EXE_OUTPUTS += \ -pru_i2s_tdm4_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt.out \ - -EXE_OUTPUTS__QUOTED += \ -"pru_i2s_tdm4_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt.out" \ - -BIN_OUTPUTS += \ -pru_i2s_tdm4_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt.hex \ - -BIN_OUTPUTS__QUOTED += \ -"pru_i2s_tdm4_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt.hex" \ - -# All Target -all: $(OBJS) $(CMD_SRCS) - @$(MAKE) --no-print-directory -Onone "pru_i2s_tdm4_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt.out" - -# Each subdirectory must supply rules for building sources it contributes -$(OBJDIR)/%.obj %.obj: %.asm - @echo 'Building file: "$^"' - @echo 'Invoking: PRU Compiler' - "$(CGT_TI_PRU_PATH)/bin/clpru" -DPRU0 -DSLICE0 -v4 --define=SOC_AM261X --define=PRU0 --define=I2S_TX --define=NUMBER_OF_TX_3 --define=I2S_TX_DETECT_UNDERFLOW --include_path="${CG_TOOL_ROOT}/include" --include_path="${MCU_PLUS_SDK_PATH}/source" --include_path="${OPEN_PRU_PATH}/source" --include_path="${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include" --include_path="${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4" --define=_DEBUG_=1 -g --diag_warning=225 --diag_wrap=off --display_error_number --endian=little --preproc_with_compile --preproc_dependency="$(basename $( ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru0_array.h - -$(RM) pru_i2s_tdm4_pru0_array.h - -@echo ' ' - -.PHONY: all clean +# Defines: PRU0, I2S Tx, 3 Tx channels, underflow detection +DFLAGS := \ + -DPRU0 -DSLICE0 \ + --define=SOC_AM261X \ + --define=PRU0 \ + --define=I2S_TX \ + --define=NUMBER_OF_TX_3 \ + --define=I2S_TX_DETECT_UNDERFLOW diff --git a/examples/pru_i2s/firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec index 4a3c3f4a2..e4574cf04 100644 --- a/examples/pru_i2s/firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec @@ -36,7 +36,7 @@ -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4 -DPRU0 -DSLICE0 - -v4 + -v3 -DSOC_AM263X -DPRU0 -DI2S_TX @@ -52,7 +52,7 @@ " postBuildStep=" - $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=pru_prupru_i2s0_image_0 -o pru_i2s_tdm4_pru0_array.h pru_i2s_tdm4_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt.out;if ${CCS_HOST_OS} == linux cat ${OPEN_PRU_PATH}/source/firmware/pru_load_bin_copyright.h pru_i2s_tdm4_pru0_array.h > ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru0_array.h;if ${CCS_HOST_OS} == linux rm pru_i2s_tdm4_pru0_array.h;if ${CCS_HOST_OS} == win32 $(CCS_INSTALL_DIR)/utils/cygwin/cat ${OPEN_PRU_PATH}/source/firmware/pru_load_bin_copyright.h pru_i2s_tdm4_pru0_array.h > ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru0_array.h;if ${CCS_HOST_OS} == win32 $(CCS_INSTALL_DIR)/utils/cygwin/rm pru_i2s_tdm4_pru0_array.h; + $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=pru_prupru_i2s0_image_0 -o ../pru_i2s_tdm4_pru0_array.h pru_i2s_tdm4_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt.out " description="A Pru I2s Tdm4 Pru0 Array FW project"> diff --git a/examples/pru_i2s/firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile index ff7a441ce..69ae62185 100644 --- a/examples/pru_i2s/firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -1,90 +1,41 @@ ################################################################################ -# PRU I2S Firmware Makefile +# PRU I2S - TDM4 Protocol - PRU0 TX - AM263x-CC ################################################################################ -# Required input arguments : -# Build firmware for PRU I2S Use this input argument to include files from external paths export OPEN_PRU_PATH?=$(abspath ../../../../../../../..) include $(OPEN_PRU_PATH)/imports.mak -CG_TOOL_ROOT := $(CGT_TI_PRU_PATH) -# Add inputs and outputs from these tool invocations to the build variables -CMD_SRCS += \ - linker.cmd \ +# Define build outputs +OUTPUT_NAME := pru_i2s_tdm4_am263x-cc_icssm0-pru0_fw -ASM_SRCS += \ - pru_i2s_main.asm \ - fw_regs.asm \ +# MCU+ projects: rename & move hex array output +MCU_HEX_NAME := pru_i2s_tdm4_pru0_array.h +HEX_ARRAY_PREFIX := pru_prupru_i2s0_image_0 +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/TDM4/$(MCU_HEX_NAME) -OBJS += \ - pru_i2s_main.obj \ - fw_regs.obj \ +# which directories to search for assembly & C source files? +FILES_PATH := ../../../../ -ASM_DEPS += \ - pru_i2s_main.d \ - fw_regs.d \ +# Linker command file +COMMAND_FILES := linker.cmd -OBJDIR := . +# Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) +PRU_VERSION := 3 +EXPECTED_DEVICE := am263x -FILES_PATH_common = \ - .. \ - ../../.. \ - ../../../.. \ - ../../../../.. \ -FILES_PATH := $(FILES_PATH_common) +# pru_rules.mak has shared settings for all PRU/RTU/TX_PRU core makefiles +include $(OPEN_PRU_PATH)/pru_rules.mak -vpath %.asm $(FILES_PATH) -vpath %.obj $(OBJDIR) -vpath %.cmd $(FILES_PATH) +# Additional include paths for TDM4 firmware headers +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/TDM4 - -# Add inputs and outputs from these tool invocations to the build variables -EXE_OUTPUTS += \ -pru_i2s_tdm4_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt.out \ - -EXE_OUTPUTS__QUOTED += \ -"pru_i2s_tdm4_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt.out" \ - -BIN_OUTPUTS += \ -pru_i2s_tdm4_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt.hex \ - -BIN_OUTPUTS__QUOTED += \ -"pru_i2s_tdm4_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt.hex" \ - -# All Target -all: $(OBJS) $(CMD_SRCS) - @$(MAKE) --no-print-directory -Onone "pru_i2s_tdm4_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt.out" - -# Each subdirectory must supply rules for building sources it contributes -$(OBJDIR)/%.obj %.obj: %.asm - @echo 'Building file: "$^"' - @echo 'Invoking: PRU Compiler' - "$(CGT_TI_PRU_PATH)/bin/clpru" -DPRU0 -DSLICE0 -v4 --define=SOC_AM263X --define=PRU0 --define=I2S_TX --define=NUMBER_OF_TX_3 --define=I2S_TX_DETECT_UNDERFLOW --include_path="${CG_TOOL_ROOT}/include" --include_path="${MCU_PLUS_SDK_PATH}/source" --include_path="${OPEN_PRU_PATH}/source" --include_path="${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include" --include_path="${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4" --define=_DEBUG_=1 -g --diag_warning=225 --diag_wrap=off --display_error_number --endian=little --preproc_with_compile --preproc_dependency="$(basename $( ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru0_array.h - -$(RM) pru_i2s_tdm4_pru0_array.h - -@echo ' ' - -.PHONY: all clean +# Defines: PRU0, I2S Tx, 3 Tx channels, underflow detection +DFLAGS := \ + -DPRU0 -DSLICE0 \ + --define=SOC_AM263X \ + --define=PRU0 \ + --define=I2S_TX \ + --define=NUMBER_OF_TX_3 \ + --define=I2S_TX_DETECT_UNDERFLOW diff --git a/examples/pru_i2s/firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec index 0d479e719..4e9d5e860 100644 --- a/examples/pru_i2s/firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec @@ -36,7 +36,7 @@ -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4 -DPRU1 -DSLICE1 - -v4 + -v3 -DSOC_AM261X -DPRU1 -DI2S_RX @@ -51,7 +51,7 @@ " postBuildStep=" - $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=pru_prupru_i2s1_image_0 -o pru_i2s_tdm4_pru1_array.h pru_i2s_tdm4_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt.out;if ${CCS_HOST_OS} == linux cat ${OPEN_PRU_PATH}/source/firmware/pru_load_bin_copyright.h pru_i2s_tdm4_pru1_array.h > ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru1_array.h;if ${CCS_HOST_OS} == linux rm pru_i2s_tdm4_pru1_array.h;if ${CCS_HOST_OS} == win32 $(CCS_INSTALL_DIR)/utils/cygwin/cat ${OPEN_PRU_PATH}/source/firmware/pru_load_bin_copyright.h pru_i2s_tdm4_pru1_array.h > ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru1_array.h;if ${CCS_HOST_OS} == win32 $(CCS_INSTALL_DIR)/utils/cygwin/rm pru_i2s_tdm4_pru1_array.h; + $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=pru_prupru_i2s1_image_0 -o ../pru_i2s_tdm4_pru1_array.h pru_i2s_tdm4_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt.out " description="A Pru I2s Tdm4 Pru1 Array FW project"> diff --git a/examples/pru_i2s/firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile index 833d03b6c..2202394bb 100644 --- a/examples/pru_i2s/firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -1,90 +1,40 @@ ################################################################################ -# PRU I2S Firmware Makefile +# PRU I2S - TDM4 Protocol - PRU1 RX - AM261x-LP ################################################################################ -# Required input arguments : -# Build firmware for PRU I2S Use this input argument to include files from external paths export OPEN_PRU_PATH?=$(abspath ../../../../../../../..) include $(OPEN_PRU_PATH)/imports.mak -CG_TOOL_ROOT := $(CGT_TI_PRU_PATH) -# Add inputs and outputs from these tool invocations to the build variables -CMD_SRCS += \ - linker.cmd \ +# Define build outputs +OUTPUT_NAME := pru_i2s_tdm4_am261x-lp_icssm0-pru1_fw -ASM_SRCS += \ - pru_i2s_main.asm \ - fw_regs.asm \ +# MCU+ projects: rename & move hex array output +MCU_HEX_NAME := pru_i2s_tdm4_pru1_array.h +HEX_ARRAY_PREFIX := pru_prupru_i2s1_image_0 +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/TDM4/$(MCU_HEX_NAME) -OBJS += \ - pru_i2s_main.obj \ - fw_regs.obj \ +# which directories to search for assembly & C source files? +FILES_PATH := ../../../../ -ASM_DEPS += \ - pru_i2s_main.d \ - fw_regs.d \ +# Linker command file +COMMAND_FILES := linker.cmd -OBJDIR := . +# Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) +PRU_VERSION := 3 +EXPECTED_DEVICE := am261x -FILES_PATH_common = \ - .. \ - ../../.. \ - ../../../.. \ - ../../../../.. \ -FILES_PATH := $(FILES_PATH_common) +# pru_rules.mak has shared settings for all PRU/RTU/TX_PRU core makefiles +include $(OPEN_PRU_PATH)/pru_rules.mak -vpath %.asm $(FILES_PATH) -vpath %.obj $(OBJDIR) -vpath %.cmd $(FILES_PATH) +# Additional include paths for TDM4 firmware headers +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/TDM4 - -# Add inputs and outputs from these tool invocations to the build variables -EXE_OUTPUTS += \ -pru_i2s_tdm4_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt.out \ - -EXE_OUTPUTS__QUOTED += \ -"pru_i2s_tdm4_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt.out" \ - -BIN_OUTPUTS += \ -pru_i2s_tdm4_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt.hex \ - -BIN_OUTPUTS__QUOTED += \ -"pru_i2s_tdm4_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt.hex" \ - -# All Target -all: $(OBJS) $(CMD_SRCS) - @$(MAKE) --no-print-directory -Onone "pru_i2s_tdm4_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt.out" - -# Each subdirectory must supply rules for building sources it contributes -$(OBJDIR)/%.obj %.obj: %.asm - @echo 'Building file: "$^"' - @echo 'Invoking: PRU Compiler' - "$(CGT_TI_PRU_PATH)/bin/clpru" -DPRU1 -DSLICE1 -v4 --define=SOC_AM261X --define=PRU1 --define=I2S_RX --define=I2S_RX_DETECT_OVERFLOW --include_path="${CG_TOOL_ROOT}/include" --include_path="${MCU_PLUS_SDK_PATH}/source" --include_path="${OPEN_PRU_PATH}/source" --include_path="${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include" --include_path="${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4" --define=_DEBUG_=1 -g --diag_warning=225 --diag_wrap=off --display_error_number --endian=little --preproc_with_compile --preproc_dependency="$(basename $( ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru1_array.h - -$(RM) pru_i2s_tdm4_pru1_array.h - -@echo ' ' - -.PHONY: all clean +# Defines: PRU1, I2S Rx, overflow detection +DFLAGS := \ + -DPRU1 -DSLICE1 \ + --define=SOC_AM261X \ + --define=PRU1 \ + --define=I2S_RX \ + --define=I2S_RX_DETECT_OVERFLOW diff --git a/examples/pru_i2s/firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec index a855f7fe6..e0e8b4365 100644 --- a/examples/pru_i2s/firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec @@ -36,7 +36,7 @@ -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4 -DPRU1 -DSLICE1 - -v4 + -v3 -DSOC_AM263X -DPRU1 -DI2S_RX @@ -51,7 +51,7 @@ " postBuildStep=" - $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=pru_prupru_i2s1_image_0 -o pru_i2s_tdm4_pru1_array.h pru_i2s_tdm4_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt.out;if ${CCS_HOST_OS} == linux cat ${OPEN_PRU_PATH}/source/firmware/pru_load_bin_copyright.h pru_i2s_tdm4_pru1_array.h > ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru1_array.h;if ${CCS_HOST_OS} == linux rm pru_i2s_tdm4_pru1_array.h;if ${CCS_HOST_OS} == win32 $(CCS_INSTALL_DIR)/utils/cygwin/cat ${OPEN_PRU_PATH}/source/firmware/pru_load_bin_copyright.h pru_i2s_tdm4_pru1_array.h > ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru1_array.h;if ${CCS_HOST_OS} == win32 $(CCS_INSTALL_DIR)/utils/cygwin/rm pru_i2s_tdm4_pru1_array.h; + $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=pru_prupru_i2s1_image_0 -o ../pru_i2s_tdm4_pru1_array.h pru_i2s_tdm4_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt.out " description="A Pru I2s Tdm4 Pru1 Array FW project"> diff --git a/examples/pru_i2s/firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile index b8df9d69f..11b2859d0 100644 --- a/examples/pru_i2s/firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -1,90 +1,40 @@ ################################################################################ -# PRU I2S Firmware Makefile +# PRU I2S - TDM4 Protocol - PRU1 RX - AM263x-CC ################################################################################ -# Required input arguments : -# Build firmware for PRU I2S Use this input argument to include files from external paths export OPEN_PRU_PATH?=$(abspath ../../../../../../../..) include $(OPEN_PRU_PATH)/imports.mak -CG_TOOL_ROOT := $(CGT_TI_PRU_PATH) -# Add inputs and outputs from these tool invocations to the build variables -CMD_SRCS += \ - linker.cmd \ +# Define build outputs +OUTPUT_NAME := pru_i2s_tdm4_am263x-cc_icssm0-pru1_fw -ASM_SRCS += \ - pru_i2s_main.asm \ - fw_regs.asm \ +# MCU+ projects: rename & move hex array output +MCU_HEX_NAME := pru_i2s_tdm4_pru1_array.h +HEX_ARRAY_PREFIX := pru_prupru_i2s1_image_0 +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/TDM4/$(MCU_HEX_NAME) -OBJS += \ - pru_i2s_main.obj \ - fw_regs.obj \ +# which directories to search for assembly & C source files? +FILES_PATH := ../../../../ -ASM_DEPS += \ - pru_i2s_main.d \ - fw_regs.d \ +# Linker command file +COMMAND_FILES := linker.cmd -OBJDIR := . +# Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) +PRU_VERSION := 3 +EXPECTED_DEVICE := am263x -FILES_PATH_common = \ - .. \ - ../../.. \ - ../../../.. \ - ../../../../.. \ -FILES_PATH := $(FILES_PATH_common) +# pru_rules.mak has shared settings for all PRU/RTU/TX_PRU core makefiles +include $(OPEN_PRU_PATH)/pru_rules.mak -vpath %.asm $(FILES_PATH) -vpath %.obj $(OBJDIR) -vpath %.cmd $(FILES_PATH) +# Additional include paths for TDM4 firmware headers +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/TDM4 - -# Add inputs and outputs from these tool invocations to the build variables -EXE_OUTPUTS += \ -pru_i2s_tdm4_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt.out \ - -EXE_OUTPUTS__QUOTED += \ -"pru_i2s_tdm4_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt.out" \ - -BIN_OUTPUTS += \ -pru_i2s_tdm4_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt.hex \ - -BIN_OUTPUTS__QUOTED += \ -"pru_i2s_tdm4_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt.hex" \ - -# All Target -all: $(OBJS) $(CMD_SRCS) - @$(MAKE) --no-print-directory -Onone "pru_i2s_tdm4_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt.out" - -# Each subdirectory must supply rules for building sources it contributes -$(OBJDIR)/%.obj %.obj: %.asm - @echo 'Building file: "$^"' - @echo 'Invoking: PRU Compiler' - "$(CGT_TI_PRU_PATH)/bin/clpru" -DPRU1 -DSLICE1 -v4 --define=SOC_AM263X --define=PRU1 --define=I2S_RX --define=I2S_RX_DETECT_OVERFLOW --include_path="${CG_TOOL_ROOT}/include" --include_path="${MCU_PLUS_SDK_PATH}/source" --include_path="${OPEN_PRU_PATH}/source" --include_path="${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include" --include_path="${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4" --define=_DEBUG_=1 -g --diag_warning=225 --diag_wrap=off --display_error_number --endian=little --preproc_with_compile --preproc_dependency="$(basename $( ${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru1_array.h - -$(RM) pru_i2s_tdm4_pru1_array.h - -@echo ' ' - -.PHONY: all clean +# Defines: PRU1, I2S Rx, overflow detection +DFLAGS := \ + -DPRU1 -DSLICE1 \ + --define=SOC_AM263X \ + --define=PRU1 \ + --define=I2S_RX \ + --define=I2S_RX_DETECT_OVERFLOW diff --git a/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru0_array.h b/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru0_array.h deleted file mode 100644 index 43d2025f1..000000000 --- a/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru0_array.h +++ /dev/null @@ -1,159 +0,0 @@ -const uint32_t pru_prupru_i2s0_image_0_0[] = { -0x91002b80, -0x1308e0e0, -0x81002b80, -0x0b015b5b, -0x51005b0c, -0x240000e4, -0x240000f7, -0x240000ea, -0x240004f7, -0xf1003782, -0x240008f7, -0xf100178a, -0x00eae2e1, -0xe1002284, -0x0104e2e2, -0x66e1e2fe, -0x2effbf80, -0x240002eb, -0x24001af9, -0x240002f7, -0xe1001917, -0x240001f7, -0xe1011917, -0x2400015a, -0x2400017a, -0x24000f1a, -0x2400011d, -0x0a1ae4e7, -0x1101e7e7, -0x0902e7e7, -0x240004f7, -0xf1003780, -0x10e0e0e2, -0x240008f7, -0xf100178a, -0x0b01eaea, -0x00eae0e1, -0x10e1e1e3, -0xf1000084, -0x0102e0e0, -0x01011d1d, -0xd106ff00, -0xd101ff00, -0xc901ff00, -0xd101ff00, -0x79000002, -0xc906ff00, -0x10ebfffc, -0x51001617, -0x510e160a, -0x510f160c, -0x510d160e, -0x01011616, -0x2400007b, -0x71013602, -0x21005b00, -0x24000036, -0x0b01fcfc, -0x21005b00, -0x0b01fcfc, -0x01011616, -0x21005b00, -0x01013636, -0x24000016, -0x21005b00, -0xf1000097, -0x49061d02, -0x0102e0e0, -0x01011616, -0x21005b00, -0x21003000, -0x50e1e003, -0x01011616, -0x21005b00, -0x51015a03, -0x10e2e2e0, -0x21004e00, -0x10e3e3e0, -0x00eae0e1, -0x15015a5a, -0x240018f9, -0xe100195a, -0xf102191b, -0x69005a04, -0xc9011b20, -0x1d001b1b, -0x21005900, -0xc9001b1d, -0x1d011b1b, -0x2400017b, -0x01011616, -0x10e7e7fe, -0xd106ff00, -0x69017b03, -0xe102191b, -0x2400229f, -0x51001a03, -0x05011a1a, -0x21006d00, -0x24000f1a, -0x71061d04, -0x240000c4, -0x24000084, -0x79000002, -0x10f7f7e4, -0x69061d03, -0x2400011d, -0x79000002, -0x01011d1d, -0x0a1ae4e7, -0x1101e7e7, -0x0902e7e7, -0x21002e00, -0x21002e00, -0x1f005b5b, -0x21007700, -0x1f015b5b, -0x21007700, -0x1f025b5b, -0x24001cf9, -0xe100195b, -0x2400249f, -0x21000000}; - -const uint8_t pru_prupru_i2s0_image_0_1[] = { -0x03, -0x00, -0x30, -0x20, -0x00, -0x00, -0x01, -0x00, -0x08, -0x01, -0x12, -0x13, -0x14, -0x06, -0x01, -0x02, -0x03, -0x05, -0x00, -0x04, -0x00, -0x01, -0x01, -0x00, -0x00, -0x00, -0x02, -0x01, -0x00, -0x00, -0x00, -0x00}; - diff --git a/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru1_array.h b/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru1_array.h deleted file mode 100644 index e9502160e..000000000 --- a/examples/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru1_array.h +++ /dev/null @@ -1,152 +0,0 @@ -const uint32_t pru_prupru_i2s1_image_0_0[] = { -0x91002b80, -0x1308e0e0, -0x81002b80, -0x2effbf80, -0x240002e7, -0x240004e8, -0x240008e9, -0x24001af9, -0x240002f7, -0xe1001917, -0x240001f7, -0xe1011917, -0x2400015a, -0x2400017a, -0x24000f1a, -0x2400011d, -0x240019eb, -0x24001bec, -0x240008f7, -0xf100178a, -0x0b01eaea, -0x10eaeaf1, -0x0501f1f1, -0x240014f7, -0xf100378d, -0x10ededef, -0x24000f3a, -0x00f1edee, -0x10eeeef0, -0x0101f0f0, -0xd100ff00, -0xd101ff00, -0xc901ff00, -0xd101ff00, -0x79000002, -0xc900ff00, -0x31090002, -0x0100e0e0, -0x10e7fffc, -0x10e8fff2, -0x10e9fff3, -0x60edee13, -0x5100161b, -0x510e1609, -0x510f160b, -0x510d160d, -0x01011616, -0x71013602, -0x21004800, -0x24000036, -0x0b01fcfc, -0x21004800, -0x0b01fcfc, -0x01011616, -0x21004800, -0x01013636, -0x24000016, -0x21004800, -0x01011616, -0x21004800, -0x51017a03, -0x10efefed, -0x21004000, -0x10f0f0ed, -0x00f1edee, -0x15017a7a, -0xe1000b7a, -0x2400017b, -0x21002e00, -0x01011616, -0x21004800, -0x01011616, -0xd100ff00, -0x69017b0b, -0x2400007b, -0xf1000c3b, -0x69007a04, -0xd1013b1e, -0x1f003b3b, -0x21005200, -0xd1003b1b, -0x1f013b3b, -0xe1000c3b, -0x2400269f, -0x21005500, -0x0b02f2f2, -0x0b03f3f3, -0x083af2f2, -0x083af3f3, -0x12f2f4f4, -0x12f3f5f5, -0x51003a03, -0x05013a3a, -0x21002300, -0x69061d04, -0x10e7fffc, -0x0b01fcfc, -0x5100fc0e, -0x49061d03, -0xe1000d94, -0x0102eded, -0x01011d1d, -0x71061d02, -0x2400011d, -0x2eff8792, -0x24000f3a, -0x21002300, -0x1f005b5b, -0x21007000, -0x1f015b5b, -0x21007000, -0x1f025b5b, -0x24001cf9, -0xe100195b, -0x2400279f, -0x21000000}; - -const uint8_t pru_prupru_i2s1_image_0_1[] = { -0x00, -0x02, -0x30, -0x20, -0x00, -0x02, -0x01, -0x00, -0x00, -0x01, -0x15, -0x16, -0x17, -0x00, -0x01, -0x04, -0x05, -0x06, -0x02, -0x03, -0x00, -0x03, -0x01, -0x00, -0x00, -0x00, -0x02, -0x01, -0x00, -0x00, -0x00, -0x00}; - diff --git a/examples/pru_i2s/makefile b/examples/pru_i2s/makefile index 5e06563a2..55713bc63 100644 --- a/examples/pru_i2s/makefile +++ b/examples/pru_i2s/makefile @@ -1,50 +1,5 @@ include ../../imports.mak -####################### -# Library build tools # -####################### -ifeq ($(CG_TOOL_ROOT),) - CC=$(CGT_TI_ARM_CLANG_PATH)/bin/tiarmclang - AR=$(CGT_TI_ARM_CLANG_PATH)/bin/tiarmar -else - CC=$(CG_TOOL_ROOT)/bin/tiarmclang - AR=$(CG_TOOL_ROOT)/bin/tiarmar -endif - -CFLAGS_OPT_debug := -O0 -CFLAGS_OPT_release := -Os -CFLAGS_OPT := $(CFLAGS_OPT_$(PROFILE)) - -CFLAGS_AM261X := -mcpu=cortex-r5 -mfloat-abi=hard -mfpu=vfpv3-d16 -mthumb -Wall -Werror -g -Wno-gnu-variable-sized-type-not-at-end -Wno-unused-function $(CFLAGS_OPT) -CFLAGS_AM263X := -mcpu=cortex-r5 -mfloat-abi=hard -mfpu=vfpv3-d16 -mthumb -Wall -Werror -g -Wno-gnu-variable-sized-type-not-at-end -Wno-unused-function $(CFLAGS_OPT) - -INCLUDES_AM261X := \ - -I$(MCU_PLUS_SDK_PATH)/source \ - -I$(OPEN_PRU_PATH)/source \ - -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/FreeRTOS-Kernel/include \ - -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F \ - -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/config/am261x/r5f \ - -I./include \ - -I./firmware \ - -I. \ - -I.. \ - -I$(OPEN_PRU_PATH)/examples - -INCLUDES_AM263X := \ - -I$(MCU_PLUS_SDK_PATH)/source \ - -I$(OPEN_PRU_PATH)/source \ - -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/FreeRTOS-Kernel/include \ - -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F \ - -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/config/am263x/r5f \ - -I./include \ - -I./firmware \ - -I. \ - -I.. \ - -I$(OPEN_PRU_PATH)/examples - -DEFINES_AM261X := -DSOC_AM261X -DOS_FREERTOS -DEFINES_AM263X := -DSOC_AM263X -DOS_FREERTOS - ####################### # project information # ####################### @@ -106,34 +61,35 @@ endif # Make and clean commands # ########################### -# "make pru" builds PRU firmware for all supported devices +ifeq ($(BUILD_PROJECT),y) +# "make" or "make all" builds PRU firmware then host code for $(DEVICE) +all: MESSAGE = "Building $(PROJECT_NAME) for $(DEVICE)" +all: pre_build_message + $(MAKE) pru + $(MAKE) host + +# "make pru" builds only PRU firmware for $(DEVICE) pru: ARGUMENTS_PRU = all -pru: ARGUMENTS_MCUPLUS = all pru: MESSAGE = "Building $(PROJECT_NAME) PRU firmware" -pru: pre_build_message $(SUPPORTED_PROCESSORS) +pru: pre_build_message $(DEVICE) -# "make host" builds host (R5F/ARM) code for specified DEVICE -host: ARGUMENTS_PRU = pru +# "make host" builds only host (R5F) code for $(DEVICE) — requires PRU firmware first host: ARGUMENTS_MCUPLUS = all host: MESSAGE = "Building $(PROJECT_NAME) host code for $(DEVICE)" host: pre_build_message $(DEVICE_NON_PRU) -ifeq ($(BUILD_PROJECT),y) -# "make" or "make all" builds projects that match $(DEVICE) set in imports.mak -all: ARGUMENTS_PRU = all -all: ARGUMENTS_MCUPLUS = $(ARGUMENTS_PRU) -all: MESSAGE = "Building $(PROJECT_NAME) for $(DEVICE)" -all: pre_build_message $(DEVICE) $(DEVICE_NON_PRU) - # "make clean" cleans projects that match $(DEVICE) set in imports.mak clean: ARGUMENTS_PRU = clean clean: ARGUMENTS_MCUPLUS = scrub clean: MESSAGE = "Cleaning $(PROJECT_NAME) for $(DEVICE)" -clean: pre_build_message $(DEVICE) $(DEVICE_NON_PRU) +clean: pre_build_message $(DEVICE) $(DEVICE_NON_PRU) clean_lib + +clean_lib: + $(MAKE) -C ../../source/i2s clean else # if a prebuild check failed, print message and exit -all clean: pre_build_message +all clean pru host: pre_build_message endif pre_build_message: @@ -158,15 +114,8 @@ am261x_mcuplus: build_lib_am261x $(MAKE) -C pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang $(ARGUMENTS_MCUPLUS) build_lib_am261x: -# am261x-lp - Build driver library (always rebuild by removing old lib and objects first) - $(RM) lib/pru_i2s.am261x.r5f.ti-arm-clang.*.lib lib/pru_i2s_*_am261x.obj - $(MKDIR) lib - @echo "Building pru_i2s library for am261x..." - $(CC) -c $(CFLAGS_AM261X) $(INCLUDES_AM261X) $(DEFINES_AM261X) -o lib/pru_i2s_drv_am261x.obj driver/pru_i2s_drv.c - $(CC) -c $(CFLAGS_AM261X) $(INCLUDES_AM261X) $(DEFINES_AM261X) -o lib/pru_i2s_app_config_am261x.obj pru_i2s_app/pru_i2s_app_config.c - $(AR) rc lib/pru_i2s.am261x.r5f.ti-arm-clang.$(PROFILE).lib lib/pru_i2s_drv_am261x.obj lib/pru_i2s_app_config_am261x.obj - $(RM) lib/pru_i2s_*_am261x.obj - @echo "Library build complete." +# am261x-lp - Build driver library + $(MAKE) -C ../../source/i2s build_am261x PROFILE=$(PROFILE) am263x: # am263x-cc - I2S protocol @@ -181,14 +130,7 @@ am263x_mcuplus: build_lib_am263x $(MAKE) -C pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang $(ARGUMENTS_MCUPLUS) build_lib_am263x: -# am263x-cc - Build driver library (always rebuild by removing old lib and objects first) - $(RM) lib/pru_i2s.am263x.r5f.ti-arm-clang.*.lib lib/pru_i2s_*_am263x.obj - $(MKDIR) lib - @echo "Building pru_i2s library for am263x..." - $(CC) -c $(CFLAGS_AM263X) $(INCLUDES_AM263X) $(DEFINES_AM263X) -o lib/pru_i2s_drv_am263x.obj driver/pru_i2s_drv.c - $(CC) -c $(CFLAGS_AM263X) $(INCLUDES_AM263X) $(DEFINES_AM263X) -o lib/pru_i2s_app_config_am263x.obj pru_i2s_app/pru_i2s_app_config.c - $(AR) rc lib/pru_i2s.am263x.r5f.ti-arm-clang.$(PROFILE).lib lib/pru_i2s_drv_am263x.obj lib/pru_i2s_app_config_am263x.obj - $(RM) lib/pru_i2s_*_am263x.obj - @echo "Library build complete." - -.PHONY: all clean pru host pre_build_message $(DEVICE) $(DEVICE_NON_PRU) $(SUPPORTED_PROCESSORS) +# am263x-cc - Build driver library + $(MAKE) -C ../../source/i2s build_am263x PROFILE=$(PROFILE) + +.PHONY: all clean pru host pre_build_message clean_lib $(DEVICE) $(DEVICE_NON_PRU) $(SUPPORTED_PROCESSORS) diff --git a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec index 3123056d8..bb1a72566 100644 --- a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -32,8 +32,14 @@ -I${CG_TOOL_ROOT}/include/c -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source - -I${OPEN_PRU_PATH}/examples/pru_i2s/include + -I${OPEN_PRU_PATH}/source/i2s + -I${WORKSPACE_LOC}/pru_i2s_tdm4_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt + -I${WORKSPACE_LOC}/pru_i2s_tdm4_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt + -I${WORKSPACE_LOC}/pru_i2s_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt + -I${WORKSPACE_LOC}/pru_i2s_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4 -I${OPEN_PRU_PATH}/examples/pru_i2s/pru_i2s_app -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/FreeRTOS-Kernel/include -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F @@ -55,9 +61,6 @@ linkerBuildOptions=" -i${MCU_PLUS_SDK_PATH}/source/kernel/freertos/lib -i${MCU_PLUS_SDK_PATH}/source/drivers/lib - -i${OPEN_PRU_PATH}/examples/pru_i2s/include - -i${OPEN_PRU_PATH}/examples/pru_i2s/firmware - -i${OPEN_PRU_PATH}/examples/pru_i2s/pru_i2s_app -i${MCU_PLUS_SDK_PATH}/source/board/lib -i${MCU_PLUS_SDK_PATH}/source/pru_io/lib -i${OPEN_PRU_PATH}/examples/pru_i2s/lib @@ -68,7 +71,7 @@ --reread_libs " - preBuildStep="$(MAKE) -C ${OPEN_PRU_PATH}/examples/pru_i2s build_lib_am261x CG_TOOL_ROOT=${CG_TOOL_ROOT} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} OPEN_PRU_PATH=${OPEN_PRU_PATH}" + preBuildStep="$(MAKE) -C ${OPEN_PRU_PATH}/examples/pru_i2s build_lib_am261x PROFILE=${ConfigName} CG_TOOL_ROOT=${CG_TOOL_ROOT} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} OPEN_PRU_PATH=${OPEN_PRU_PATH} BUILD_MCUPLUS=y" postBuildStep="$(MAKE) -C ${CCS_PROJECT_DIR} -f makefile_ccs_bootimage_gen OUTNAME=${BuildArtifactFileBaseName} PROFILE=${ConfigName} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} OPEN_PRU_PATH=${OPEN_PRU_PATH} CG_TOOL_ROOT=${CG_TOOL_ROOT} CCS_INSTALL_DIR=${CCS_INSTALL_DIR} CCS_IDE_MODE=${CCS_IDE_MODE} DEVICE=am261x" @@ -100,7 +103,7 @@ -lfreertos.am261x.r5f.ti-arm-clang.release.lib -ldrivers.am261x.r5f.ti-arm-clang.freertos.release.lib -lboard.am261x.r5f.ti-arm-clang.freertos.release.lib - -lpru_i2s.am261x.r5f.ti-arm-clang.release.lib + -lpru_i2s.am261x.r5f.ti-arm-clang.Release.lib -llibc.a -llibsysbm.a " diff --git a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile index 1c2cae5bb..6b17292e6 100644 --- a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile @@ -58,8 +58,10 @@ INCLUDES_common := \ -I${CG_TOOL_ROOT}/include/c \ -I${MCU_PLUS_SDK_PATH}/source \ -I${OPEN_PRU_PATH}/source \ - -I${OPEN_PRU_PATH}/examples/pru_i2s/include \ + -I${OPEN_PRU_PATH}/source/i2s \ -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware \ + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S \ + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4 \ -I${OPEN_PRU_PATH}/examples/pru_i2s/pru_i2s_app \ -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/FreeRTOS-Kernel/include \ -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F \ @@ -202,6 +204,11 @@ pru_i2s.am261x.r5f.ti-arm-clang.$(PROFILE).lib: @echo "Building library via parent makefile..." $(MAKE) -C ../../../.. build_lib_am261x +# Firmware array headers are generated by PRU firmware build (make pru). +# The catch-all pattern suppresses "No rule to make target" errors from -MMD +# dependency tracking regardless of path separator (forward vs back slash). +%.h: ; + FORCE: $(OUTNAME): $(SYSTEM_COMMAND) diff --git a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec index 4f2d60f10..3a4473583 100644 --- a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -32,8 +32,14 @@ -I${CG_TOOL_ROOT}/include/c -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source - -I${OPEN_PRU_PATH}/examples/pru_i2s/include + -I${OPEN_PRU_PATH}/source/i2s + -I${WORKSPACE_LOC}/pru_i2s_tdm4_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt + -I${WORKSPACE_LOC}/pru_i2s_tdm4_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt + -I${WORKSPACE_LOC}/pru_i2s_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt + -I${WORKSPACE_LOC}/pru_i2s_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4 -I${OPEN_PRU_PATH}/examples/pru_i2s/pru_i2s_app -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/FreeRTOS-Kernel/include -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F @@ -65,7 +71,7 @@ --reread_libs " - preBuildStep="$(MAKE) -C ${OPEN_PRU_PATH}/examples/pru_i2s build_lib_am263x CG_TOOL_ROOT=${CG_TOOL_ROOT} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} OPEN_PRU_PATH=${OPEN_PRU_PATH}" + preBuildStep="$(MAKE) -C ${OPEN_PRU_PATH}/examples/pru_i2s build_lib_am263x PROFILE=${ConfigName} CG_TOOL_ROOT=${CG_TOOL_ROOT} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} OPEN_PRU_PATH=${OPEN_PRU_PATH} BUILD_MCUPLUS=y" postBuildStep="$(MAKE) -C ${CCS_PROJECT_DIR} -f makefile_ccs_bootimage_gen OUTNAME=${BuildArtifactFileBaseName} PROFILE=${ConfigName} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} OPEN_PRU_PATH=${OPEN_PRU_PATH} CG_TOOL_ROOT=${CG_TOOL_ROOT} CCS_INSTALL_DIR=${CCS_INSTALL_DIR} CCS_IDE_MODE=${CCS_IDE_MODE} DEVICE=am263x" @@ -97,7 +103,7 @@ -lfreertos.am263x.r5f.ti-arm-clang.release.lib -ldrivers.am263x.r5f.ti-arm-clang.freertos.release.lib -lboard.am263x.r5f.ti-arm-clang.freertos.release.lib - -lpru_i2s.am263x.r5f.ti-arm-clang.release.lib + -lpru_i2s.am263x.r5f.ti-arm-clang.Release.lib -llibc.a -llibsysbm.a " diff --git a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile index f56972cc6..09df4c113 100644 --- a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile @@ -60,8 +60,10 @@ INCLUDES_common := \ -I${CG_TOOL_ROOT}/include/c \ -I${MCU_PLUS_SDK_PATH}/source \ -I${OPEN_PRU_PATH}/source \ - -I${OPEN_PRU_PATH}/examples/pru_i2s/include \ + -I${OPEN_PRU_PATH}/source/i2s \ -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware \ + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S \ + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4 \ -I${OPEN_PRU_PATH}/examples/pru_i2s/pru_i2s_app \ -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/FreeRTOS-Kernel/include \ -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F \ @@ -204,6 +206,11 @@ pru_i2s.am263x.r5f.ti-arm-clang.$(PROFILE).lib: @echo "Building library via parent makefile..." $(MAKE) -C ../../../.. build_lib_am263x +# Firmware array headers are generated by PRU firmware build (make pru). +# The catch-all pattern suppresses "No rule to make target" errors from -MMD +# dependency tracking regardless of path separator (forward vs back slash). +%.h: ; + FORCE: $(OUTNAME): $(SYSTEM_COMMAND) diff --git a/examples/pru_i2s/pru_i2s_app/pru_i2s_diagnostic.c b/examples/pru_i2s/pru_i2s_app/pru_i2s_diagnostic.c index 3fa0612f3..95eeb73d5 100644 --- a/examples/pru_i2s/pru_i2s_app/pru_i2s_diagnostic.c +++ b/examples/pru_i2s/pru_i2s_app/pru_i2s_diagnostic.c @@ -157,18 +157,18 @@ #if (CONFIG_I2S0_MODE == TDM_MODE) /* TDM Mode firmware */ #if defined(CONFIG_PRU_I2S0_ENABLED) && (CONFIG_PRU_I2S0_ENABLED == 1) - #include "TDM4/pru_i2s_tdm4_pru0_array.h" /* PRU0 TDM firmware */ + #include "pru_i2s_tdm4_pru0_array.h" /* PRU0 TDM firmware */ #endif #if defined(CONFIG_PRU_I2S1_ENABLED) && (CONFIG_PRU_I2S1_ENABLED == 1) - #include "TDM4/pru_i2s_tdm4_pru1_array.h" /* PRU1 TDM firmware */ + #include "pru_i2s_tdm4_pru1_array.h" /* PRU1 TDM firmware */ #endif #else /* I2S Mode firmware */ #if defined(CONFIG_PRU_I2S0_ENABLED) && (CONFIG_PRU_I2S0_ENABLED == 1) - #include "I2S/pru_i2s_pru0_array.h" /* PRU0 I2S firmware */ + #include "pru_i2s_pru0_array.h" /* PRU0 I2S firmware */ #endif #if defined(CONFIG_PRU_I2S1_ENABLED) && (CONFIG_PRU_I2S1_ENABLED == 1) - #include "I2S/pru_i2s_pru1_array.h" /* PRU1 I2S firmware */ + #include "pru_i2s_pru1_array.h" /* PRU1 I2S firmware */ #endif #endif diff --git a/source/i2s/makefile b/source/i2s/makefile new file mode 100644 index 000000000..94aeb889e --- /dev/null +++ b/source/i2s/makefile @@ -0,0 +1,98 @@ +export OPEN_PRU_PATH?=$(abspath ../..) +include $(OPEN_PRU_PATH)/imports.mak + +####################### +# Library build tools # +####################### +ifeq ($(CG_TOOL_ROOT),) + CC=$(CGT_TI_ARM_CLANG_PATH)/bin/tiarmclang + AR=$(CGT_TI_ARM_CLANG_PATH)/bin/tiarmar +else + CC=$(CG_TOOL_ROOT)/bin/tiarmclang + AR=$(CG_TOOL_ROOT)/bin/tiarmar +endif + +CFLAGS_OPT_debug := -O0 +CFLAGS_OPT_release := -Os +CFLAGS_OPT := $(CFLAGS_OPT_$(PROFILE)) + +CFLAGS_common := \ + -mcpu=cortex-r5 \ + -mfloat-abi=hard \ + -mfpu=vfpv3-d16 \ + -mthumb \ + -Wall \ + -Werror \ + -g \ + -Wno-gnu-variable-sized-type-not-at-end \ + -Wno-unused-function \ + $(CFLAGS_OPT) + +INCLUDES_common := \ + -I$(MCU_PLUS_SDK_PATH)/source \ + -I$(OPEN_PRU_PATH)/source \ + -I$(OPEN_PRU_PATH)/source/i2s \ + -I$(OPEN_PRU_PATH)/examples/pru_i2s/firmware \ + -I$(OPEN_PRU_PATH)/examples \ + -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/FreeRTOS-Kernel/include \ + -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F + +# Profile used when naming the built pru_i2s driver library +PROFILE?=Release +GEN_DIR := $(OPEN_PRU_PATH)/examples/pru_i2s/lib + +# Only build if MCU+ SDK is available +ifeq ($(BUILD_MCUPLUS),y) + +all: build_am261x build_am263x + +build_am261x: + $(MKDIR) $(GEN_DIR) + @echo "Building pru_i2s library for am261x..." + $(CC) -c $(CFLAGS_common) \ + $(INCLUDES_common) \ + -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/config/am261x/r5f \ + -DSOC_AM261X -DOS_FREERTOS \ + -o $(GEN_DIR)/pru_i2s_drv_am261x.obj pru_i2s_drv.c + $(CC) -c $(CFLAGS_common) \ + $(INCLUDES_common) \ + -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/config/am261x/r5f \ + -DSOC_AM261X -DOS_FREERTOS \ + -o $(GEN_DIR)/pru_i2s_app_config_am261x.obj pru_i2s_app_config.c + $(AR) rc $(GEN_DIR)/pru_i2s.am261x.r5f.ti-arm-clang.$(PROFILE).lib \ + $(GEN_DIR)/pru_i2s_drv_am261x.obj \ + $(GEN_DIR)/pru_i2s_app_config_am261x.obj + $(RM) $(GEN_DIR)/pru_i2s_drv_am261x.obj + $(RM) $(GEN_DIR)/pru_i2s_app_config_am261x.obj + @echo "Library build complete." + +build_am263x: + $(MKDIR) $(GEN_DIR) + @echo "Building pru_i2s library for am263x..." + $(CC) -c $(CFLAGS_common) \ + $(INCLUDES_common) \ + -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/config/am263x/r5f \ + -DSOC_AM263X -DOS_FREERTOS \ + -o $(GEN_DIR)/pru_i2s_drv_am263x.obj pru_i2s_drv.c + $(CC) -c $(CFLAGS_common) \ + $(INCLUDES_common) \ + -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/config/am263x/r5f \ + -DSOC_AM263X -DOS_FREERTOS \ + -o $(GEN_DIR)/pru_i2s_app_config_am263x.obj pru_i2s_app_config.c + $(AR) rc $(GEN_DIR)/pru_i2s.am263x.r5f.ti-arm-clang.$(PROFILE).lib \ + $(GEN_DIR)/pru_i2s_drv_am263x.obj \ + $(GEN_DIR)/pru_i2s_app_config_am263x.obj + $(RM) $(GEN_DIR)/pru_i2s_drv_am263x.obj + $(RM) $(GEN_DIR)/pru_i2s_app_config_am263x.obj + @echo "Library build complete." + +clean: + -$(RMDIR) $(GEN_DIR) + @echo "Finished clean" + +else +all clean: + @echo "Skipping pru_i2s library build: BUILD_MCUPLUS != y" +endif + +.PHONY: all build_am261x build_am263x clean diff --git a/source/i2s/pru_i2s_app_config.c b/source/i2s/pru_i2s_app_config.c new file mode 100644 index 000000000..9b32a8490 --- /dev/null +++ b/source/i2s/pru_i2s_app_config.c @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024-2025 Texas Instruments Incorporated + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the + * distribution. + * + * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file pru_i2s_app_config.c + * + * \brief PRU I2S Application Configuration + * + * This file contains the application-specific configuration for PRU I2S. + * Modify pru_i2s_app_config.h to configure: + * - ICSS instance selection (ICSSM0 or ICSSM1) + * - PRU core selection (PRU0 or PRU1) + * - I2S/TDM mode selection + * - Instance enable flags + */ + +#include "pru_i2s_config.h" +#include "pru_i2s_drv.h" +#include "pru_i2s_app_config.h" + +/* ========================================================================== */ +/* USER CONFIGURATION */ +/* ========================================================================== */ + +/** + * \brief PRU I2S Configuration Table + * + * This table defines the configuration for each PRU I2S instance. + * + * For AM261x LaunchPad: + * - Uses ICSSM1 (icssInstId = 1) + * - PRU0 for Tx, PRU1 for Rx + * + * For AM263x Control Card: + * - Uses ICSSM0 (icssInstId = 0) + * - PRU0 and PRU1 for Tx and Rx + * + * Modify the values below to match your hardware configuration. + */ +static const PRUI2S_UserConfig gPruI2sAppConfig[PRU_I2S_NUM_CONFIG] = +{ + /* Configuration 0: First PRU core */ + PRUI2S_USER_CONFIG_PRU0, + + /* Configuration 1: Second PRU core */ + PRUI2S_USER_CONFIG_PRU1 +}; + +/* ========================================================================== */ +/* FUNCTION DEFINITIONS */ +/* ========================================================================== */ + +/** + * \brief Apply PRU I2S application configuration + * + * This function applies the user configuration to the PRU I2S driver. + * It must be called before PRUI2S_init(). + * + * \return 0 on success, negative error code on failure + */ +int32_t PRUI2S_applyAppConfig(void) +{ + int32_t status = PRUI2S_DRV_SOK; + uint8_t i; + + for (i = 0; i < PRU_I2S_NUM_CONFIG; i++) + { + status = PRUI2S_setUserConfig( + i, + gPruI2sAppConfig[i].icssInstId, + gPruI2sAppConfig[i].pruInstId + ); + + if (status != PRUI2S_DRV_SOK) + { + break; + } + } + + return status; +} diff --git a/source/i2s/pru_i2s_app_config.h b/source/i2s/pru_i2s_app_config.h new file mode 100644 index 000000000..cc4ac8ec3 --- /dev/null +++ b/source/i2s/pru_i2s_app_config.h @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024-2025 Texas Instruments Incorporated + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the + * distribution. + * + * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _PRU_I2S_APP_CONFIG_H_ +#define _PRU_I2S_APP_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* ========================================================================== */ +/* I2S MODE CONFIGURATION CONSTANTS */ +/* ========================================================================== */ + +#define I2S_MODE 0 /**< Standard I2S mode */ +#define TDM_MODE 1 /**< Time Division Multiplexing mode */ +#define CONFIG_I2S0_MODE TDM_MODE /**< Selected mode: TDM mode=1, I2S mode=0 */ + +/* ========================================================================== */ +/* SYSCONFIG-BASED INSTANCE ENABLE FLAGS */ +/* ========================================================================== */ + +#ifndef CONFIG_PRU_I2S0_ENABLED +#define CONFIG_PRU_I2S0_ENABLED 1 /**< Enable PRU I2S 0 (Tx on PRU0) */ +#endif + +#ifndef CONFIG_PRU_I2S1_ENABLED +#define CONFIG_PRU_I2S1_ENABLED 1 /**< Enable PRU I2S 1 (Rx on PRU1) */ +#endif + +/* ========================================================================== */ +/* PRU I2S INSTANCE INDICES */ +/* ========================================================================== */ + +#define PRU_I2S0_INSTANCE_IDX 0 /**< Instance index for PRU I2S 0 (Tx only) */ +#define PRU_I2S1_INSTANCE_IDX 1 /**< Instance index for PRU I2S 1 (Rx only) */ + +/* ========================================================================== */ +/* TEST INSTANCE INDICES - PRU I2S INSTANCES USED */ +/* ========================================================================== */ + +#define TEST_PRUI2S0_IDX PRU_I2S0_INSTANCE_IDX /**< Test PRU I2S 0 index (for Tx) */ +#define TEST_PRUI2S1_IDX PRU_I2S1_INSTANCE_IDX /**< Test PRU I2S 1 index (for Rx) */ + +/* ========================================================================== */ +/* FUNCTION DECLARATIONS */ +/* ========================================================================== */ + +/** + * \brief Apply PRU I2S application configuration + * + * This function applies the user configuration to the PRU I2S driver. + * It must be called before PRUI2S_init(). + * + * \return 0 on success, negative error code on failure + */ +int32_t PRUI2S_applyAppConfig(void); + +#ifdef __cplusplus +} +#endif + +#endif /* _PRU_I2S_APP_CONFIG_H_ */ diff --git a/examples/pru_i2s/include/pru_i2s_config.h b/source/i2s/pru_i2s_config.h similarity index 100% rename from examples/pru_i2s/include/pru_i2s_config.h rename to source/i2s/pru_i2s_config.h diff --git a/examples/pru_i2s/driver/pru_i2s_drv.c b/source/i2s/pru_i2s_drv.c similarity index 100% rename from examples/pru_i2s/driver/pru_i2s_drv.c rename to source/i2s/pru_i2s_drv.c diff --git a/examples/pru_i2s/include/pru_i2s_drv.h b/source/i2s/pru_i2s_drv.h similarity index 100% rename from examples/pru_i2s/include/pru_i2s_drv.h rename to source/i2s/pru_i2s_drv.h From 8e790c63b8f5906ed0759efca76506c79fb1a4b3 Mon Sep 17 00:00:00 2001 From: Ayushman Date: Tue, 27 Oct 2026 14:30:10 +0530 Subject: [PATCH 02/10] Resolve QODO comments signed-off by Ayushman --- examples/pru_i2s/makefile | 3 ++- .../am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile | 1 - .../am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile | 1 - source/i2s/makefile | 3 ++- source/i2s/pru_i2s_app_config.c | 5 +++++ 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/pru_i2s/makefile b/examples/pru_i2s/makefile index 55713bc63..f7611f174 100644 --- a/examples/pru_i2s/makefile +++ b/examples/pru_i2s/makefile @@ -74,6 +74,7 @@ pru: MESSAGE = "Building $(PROJECT_NAME) PRU firmware" pru: pre_build_message $(DEVICE) # "make host" builds only host (R5F) code for $(DEVICE) — requires PRU firmware first +host: pru host: ARGUMENTS_MCUPLUS = all host: MESSAGE = "Building $(PROJECT_NAME) host code for $(DEVICE)" host: pre_build_message $(DEVICE_NON_PRU) @@ -82,7 +83,7 @@ host: pre_build_message $(DEVICE_NON_PRU) clean: ARGUMENTS_PRU = clean clean: ARGUMENTS_MCUPLUS = scrub clean: MESSAGE = "Cleaning $(PROJECT_NAME) for $(DEVICE)" -clean: pre_build_message $(DEVICE) $(DEVICE_NON_PRU) clean_lib +clean: pre_build_message $(DEVICE) clean_lib clean_lib: $(MAKE) -C ../../source/i2s clean diff --git a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile index 6b17292e6..c770dc3f4 100644 --- a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile @@ -39,7 +39,6 @@ endif FILES_common := \ pru_i2s_diagnostic.c \ - pru_i2s_app_config.c \ main.c \ ti_drivers_config.c \ ti_drivers_open_close.c \ diff --git a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile index 09df4c113..5fa9e4246 100644 --- a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile @@ -39,7 +39,6 @@ endif FILES_common := \ pru_i2s_diagnostic.c \ - pru_i2s_app_config.c \ main.c \ ti_drivers_config.c \ ti_drivers_open_close.c \ diff --git a/source/i2s/makefile b/source/i2s/makefile index 94aeb889e..35fadb42f 100644 --- a/source/i2s/makefile +++ b/source/i2s/makefile @@ -12,6 +12,7 @@ else AR=$(CG_TOOL_ROOT)/bin/tiarmar endif +# Debug: no optimization (-O0) for faster compile/debug; Release: size-optimized (-Os) CFLAGS_OPT_debug := -O0 CFLAGS_OPT_release := -Os CFLAGS_OPT := $(CFLAGS_OPT_$(PROFILE)) @@ -37,7 +38,7 @@ INCLUDES_common := \ -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/FreeRTOS-Kernel/include \ -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F -# Profile used when naming the built pru_i2s driver library +# Default library profile is Release (uppercase) so library names match linker refs PROFILE?=Release GEN_DIR := $(OPEN_PRU_PATH)/examples/pru_i2s/lib diff --git a/source/i2s/pru_i2s_app_config.c b/source/i2s/pru_i2s_app_config.c index 9b32a8490..a4df87481 100644 --- a/source/i2s/pru_i2s_app_config.c +++ b/source/i2s/pru_i2s_app_config.c @@ -86,6 +86,11 @@ static const PRUI2S_UserConfig gPruI2sAppConfig[PRU_I2S_NUM_CONFIG] = * It must be called before PRUI2S_init(). * * \return 0 on success, negative error code on failure + * + * Pseudocode: + * - For each configuration entry in the table: + * * Apply instance settings; stop and return error if any fails + * - Return success if all applied */ int32_t PRUI2S_applyAppConfig(void) { From 6d193f0b5ac5f77f0f0160fe09a03553dcf206bf Mon Sep 17 00:00:00 2001 From: Ayushman Date: Tue, 27 Oct 2026 15:06:04 +0530 Subject: [PATCH 03/10] rename firmware/I2S and firmware/TDM4 to firmware/i2s and firmware/tdm4 signed-off by Ayushman --- examples/pru_i2s/README.md | 14 ++++++------- .../pru_i2s/firmware/{I2S => i2s}/fw_regs.asm | 0 .../firmware/{I2S => i2s}/icss_pru_i2s_fw.h | 0 .../pru_i2s/firmware/{I2S => i2s}/linker.cmd | 0 .../ti-pru-cgt/example.projectspec | 4 ++-- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 4 ++-- .../ti-pru-cgt/makefile_projectspec | 0 .../ti-pru-cgt/example.projectspec | 4 ++-- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 4 ++-- .../ti-pru-cgt/makefile_projectspec | 0 .../ti-pru-cgt/example.projectspec | 4 ++-- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 4 ++-- .../ti-pru-cgt/makefile_projectspec | 0 .../ti-pru-cgt/example.projectspec | 4 ++-- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 4 ++-- .../ti-pru-cgt/makefile_projectspec | 0 .../firmware/{I2S => i2s}/pru_i2s_interface.h | 0 .../firmware/{I2S => i2s}/pru_i2s_main.asm | 0 .../firmware/{I2S => i2s}/pru_i2s_regs.h | 0 .../firmware/{TDM4 => tdm4}/fw_regs.asm | 0 .../firmware/{TDM4 => tdm4}/icss_pru_i2s_fw.h | 0 .../firmware/{TDM4 => tdm4}/linker.cmd | 0 .../ti-pru-cgt/example.projectspec | 4 ++-- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 4 ++-- .../ti-pru-cgt/makefile_projectspec | 0 .../ti-pru-cgt/example.projectspec | 4 ++-- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 4 ++-- .../ti-pru-cgt/makefile_projectspec | 0 .../ti-pru-cgt/example.projectspec | 4 ++-- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 4 ++-- .../ti-pru-cgt/makefile_projectspec | 0 .../ti-pru-cgt/example.projectspec | 4 ++-- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 4 ++-- .../ti-pru-cgt/makefile_projectspec | 0 .../{TDM4 => tdm4}/pru_i2s_interface.h | 0 .../firmware/{TDM4 => tdm4}/pru_i2s_main.asm | 0 .../firmware/{TDM4 => tdm4}/pru_i2s_regs.h | 0 examples/pru_i2s/makefile | 20 +++++++++---------- .../ti-arm-clang/example.projectspec | 4 ++-- .../r5fss0-0_freertos/ti-arm-clang/makefile | 4 ++-- .../ti-arm-clang/example.projectspec | 4 ++-- .../r5fss0-0_freertos/ti-arm-clang/makefile | 4 ++-- source/i2s/makefile | 2 ++ source/i2s/pru_i2s_drv.c | 2 +- source/i2s/pru_i2s_drv.h | 2 +- 45 files changed, 61 insertions(+), 59 deletions(-) rename examples/pru_i2s/firmware/{I2S => i2s}/fw_regs.asm (100%) rename examples/pru_i2s/firmware/{I2S => i2s}/icss_pru_i2s_fw.h (100%) rename examples/pru_i2s/firmware/{I2S => i2s}/linker.cmd (100%) rename examples/pru_i2s/firmware/{I2S => i2s}/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec (97%) rename examples/pru_i2s/firmware/{I2S => i2s}/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile (94%) rename examples/pru_i2s/firmware/{I2S => i2s}/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec (100%) rename examples/pru_i2s/firmware/{I2S => i2s}/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec (97%) rename examples/pru_i2s/firmware/{I2S => i2s}/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile (94%) rename examples/pru_i2s/firmware/{I2S => i2s}/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec (100%) rename examples/pru_i2s/firmware/{I2S => i2s}/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec (97%) rename examples/pru_i2s/firmware/{I2S => i2s}/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile (94%) rename examples/pru_i2s/firmware/{I2S => i2s}/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec (100%) rename examples/pru_i2s/firmware/{I2S => i2s}/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec (97%) rename examples/pru_i2s/firmware/{I2S => i2s}/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile (94%) rename examples/pru_i2s/firmware/{I2S => i2s}/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec (100%) rename examples/pru_i2s/firmware/{I2S => i2s}/pru_i2s_interface.h (100%) rename examples/pru_i2s/firmware/{I2S => i2s}/pru_i2s_main.asm (100%) rename examples/pru_i2s/firmware/{I2S => i2s}/pru_i2s_regs.h (100%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/fw_regs.asm (100%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/icss_pru_i2s_fw.h (100%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/linker.cmd (100%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec (97%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile (94%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec (100%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec (97%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile (94%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec (100%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec (97%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile (94%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec (100%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec (97%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile (94%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec (100%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/pru_i2s_interface.h (100%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/pru_i2s_main.asm (100%) rename examples/pru_i2s/firmware/{TDM4 => tdm4}/pru_i2s_regs.h (100%) diff --git a/examples/pru_i2s/README.md b/examples/pru_i2s/README.md index 06d9d08ba..cc1ae8ed2 100644 --- a/examples/pru_i2s/README.md +++ b/examples/pru_i2s/README.md @@ -162,7 +162,7 @@ pru_i2s/ ├── README.md # This file ├── makefile # Top-level makefile ├── firmware/ # PRU firmware source code -│ ├── I2S/ # I2S protocol implementation +│ ├── i2s/ # I2S protocol implementation │ │ ├── pru_i2s_main.asm # Main firmware logic │ │ ├── fw_regs.asm # Register definitions │ │ ├── linker.cmd # Linker script @@ -176,7 +176,7 @@ pru_i2s/ │ │ └── pru1_rx/ # RX firmware builds │ │ ├── am261x-lp/ │ │ └── am263x-cc/ -│ └── TDM4/ # TDM4 protocol (parallel structure) +│ └── tdm4/ # TDM4 protocol (parallel structure) │ └── (same structure as I2S, with pru_i2s_tdm4_pru0/1_array.h generated) ├── pru_i2s_app/ # R5F host application │ ├── board/ # Board support files @@ -219,7 +219,7 @@ make DEVICE=am261x clean **What gets built:** - 4 PRU firmware binaries per device (I2S PRU0 TX, I2S PRU1 RX, TDM4 PRU0 TX, TDM4 PRU1 RX) -- Firmware header arrays (`.h` files) generated into `firmware/I2S/generated/` and `firmware/TDM4/generated/` (gitignored) +- Firmware header arrays (`.h` files) generated into `firmware/i2s/generated/` and `firmware/tdm4/generated/` (gitignored) - PRU I2S driver library (`lib/pru_i2s.*.lib`) built from `source/i2s/makefile` - R5F application binary (`.out` and `.mcelf`) @@ -230,7 +230,7 @@ make DEVICE=am261x clean **Import Firmware Projects:** 1. Open CCS 2. Project → Import CCS Projects -3. Navigate to `examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/` +3. Navigate to `examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/` 4. Select `example.projectspec` 5. Click Finish 6. Repeat for other firmware variants (pru1_rx, TDM4, etc.) @@ -359,11 +359,11 @@ Interrupts trigger on: - **Clobbers**: `r0`–`r29` (all working registers used); flags modified - **Preserved**: none (`main` uses full PRU register context; no registers guaranteed preserved across the loop) - **Clock assumption**: PRU at 200 MHz; BCLK/FSYNC derived externally -- **Notes**: See `firmware/I2S/pru_i2s_regs.h` for register-to-symbol mapping (`tx_buffer_address`, `rx_buffer_address`, `fs_counter`, etc.). +- **Notes**: See `firmware/i2s/pru_i2s_regs.h` for register-to-symbol mapping (`tx_buffer_address`, `rx_buffer_address`, `fs_counter`, etc.). ### Firmware Configuration -Configurable parameters in `firmware/I2S/pru_i2s_interface.h` or `firmware/TDM4/pru_i2s_interface.h`: +Configurable parameters in `firmware/i2s/pru_i2s_interface.h` or `firmware/tdm4/pru_i2s_interface.h`: ```c // Bytes per channel @@ -380,7 +380,7 @@ Configurable parameters in `firmware/I2S/pru_i2s_interface.h` or `firmware/TDM4/ #### FW Register Map -`fw_regs.asm` (`firmware/I2S/` and `firmware/TDM4/`) lays out a fixed-layout status/config struct at DMEM offset 0 of each PRU core, shared between the firmware and the R5F driver (`icss_pru_i2s_fw.h` defines the same offsets on the C side). This is the entire handshake surface between the R5F and the PRU — the driver reads/writes these fields directly via `HW_RD/WR_REG*`, there is no other channel. `PRUI2S_getPruFwImageInfo()` (during driver init, before the PRU core is even running) only ever reads the capability/interrupt fields (`NUM_TX_I2S`, `NUM_RX_I2S`, `SAMP_FREQ`, the three `*_ICSS_INTC_SYS_EVT` fields) out of the firmware image — it never reads the buffer address/size fields. +`fw_regs.asm` (`firmware/i2s/` and `firmware/tdm4/`) lays out a fixed-layout status/config struct at DMEM offset 0 of each PRU core, shared between the firmware and the R5F driver (`icss_pru_i2s_fw.h` defines the same offsets on the C side). This is the entire handshake surface between the R5F and the PRU — the driver reads/writes these fields directly via `HW_RD/WR_REG*`, there is no other channel. `PRUI2S_getPruFwImageInfo()` (during driver init, before the PRU core is even running) only ever reads the capability/interrupt fields (`NUM_TX_I2S`, `NUM_RX_I2S`, `SAMP_FREQ`, the three `*_ICSS_INTC_SYS_EVT` fields) out of the firmware image — it never reads the buffer address/size fields. | Offset | Size | Field | Direction | Description | |--------|------|-------|-----------|--------------| diff --git a/examples/pru_i2s/firmware/I2S/fw_regs.asm b/examples/pru_i2s/firmware/i2s/fw_regs.asm similarity index 100% rename from examples/pru_i2s/firmware/I2S/fw_regs.asm rename to examples/pru_i2s/firmware/i2s/fw_regs.asm diff --git a/examples/pru_i2s/firmware/I2S/icss_pru_i2s_fw.h b/examples/pru_i2s/firmware/i2s/icss_pru_i2s_fw.h similarity index 100% rename from examples/pru_i2s/firmware/I2S/icss_pru_i2s_fw.h rename to examples/pru_i2s/firmware/i2s/icss_pru_i2s_fw.h diff --git a/examples/pru_i2s/firmware/I2S/linker.cmd b/examples/pru_i2s/firmware/i2s/linker.cmd similarity index 100% rename from examples/pru_i2s/firmware/I2S/linker.cmd rename to examples/pru_i2s/firmware/i2s/linker.cmd diff --git a/examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec similarity index 97% rename from examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec rename to examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec index 87f64ecb4..ce30871d4 100644 --- a/examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec @@ -33,10 +33,10 @@ -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s -DPRU0 -DSLICE0 - -v3 + -v4 -DSOC_AM261X -DPRU0 -DI2S_TX diff --git a/examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile similarity index 94% rename from examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile rename to examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile index 9755dab56..c3396eceb 100644 --- a/examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -11,7 +11,7 @@ OUTPUT_NAME := pru_i2s_am261x-lp_icssm0-pru0_fw # MCU+ projects: rename & move hex array output MCU_HEX_NAME := pru_i2s_pru0_array.h HEX_ARRAY_PREFIX := pru_prupru_i2s0_image_0 -MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/I2S/$(MCU_HEX_NAME) +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s/$(MCU_HEX_NAME) # which directories to search for assembly & C source files? FILES_PATH := ../../../../ @@ -30,7 +30,7 @@ include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for I2S firmware headers INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include -INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/I2S +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s # Defines: PRU0, I2S Tx, 3 Tx channels, underflow detection DFLAGS := \ diff --git a/examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec similarity index 100% rename from examples/pru_i2s/firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec rename to examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec diff --git a/examples/pru_i2s/firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec similarity index 97% rename from examples/pru_i2s/firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec rename to examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec index 97141a484..f7b50e0b3 100644 --- a/examples/pru_i2s/firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec @@ -33,10 +33,10 @@ -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s -DPRU0 -DSLICE0 - -v3 + -v4 -DSOC_AM263X -DPRU0 -DI2S_TX diff --git a/examples/pru_i2s/firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile similarity index 94% rename from examples/pru_i2s/firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile rename to examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile index 8350c08f8..7133ba264 100644 --- a/examples/pru_i2s/firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -11,7 +11,7 @@ OUTPUT_NAME := pru_i2s_am263x-cc_icssm0-pru0_fw # MCU+ projects: rename & move hex array output MCU_HEX_NAME := pru_i2s_pru0_array.h HEX_ARRAY_PREFIX := pru_prupru_i2s0_image_0 -MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/I2S/$(MCU_HEX_NAME) +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s/$(MCU_HEX_NAME) # which directories to search for assembly & C source files? FILES_PATH := ../../../../ @@ -29,7 +29,7 @@ include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for I2S firmware headers INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include -INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/I2S +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s # Defines: PRU0, I2S Tx, 3 Tx channels, underflow detection DFLAGS := \ diff --git a/examples/pru_i2s/firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec similarity index 100% rename from examples/pru_i2s/firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec rename to examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec diff --git a/examples/pru_i2s/firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec similarity index 97% rename from examples/pru_i2s/firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec rename to examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec index 8fec3fc4a..90eb7203b 100644 --- a/examples/pru_i2s/firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec @@ -33,10 +33,10 @@ -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s -DPRU1 -DSLICE1 - -v3 + -v4 -DSOC_AM261X -DPRU1 -DI2S_RX diff --git a/examples/pru_i2s/firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile similarity index 94% rename from examples/pru_i2s/firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile rename to examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile index bc2a797c6..393ec0790 100644 --- a/examples/pru_i2s/firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -11,7 +11,7 @@ OUTPUT_NAME := pru_i2s_am261x-lp_icssm0-pru1_fw # MCU+ projects: rename & move hex array output MCU_HEX_NAME := pru_i2s_pru1_array.h HEX_ARRAY_PREFIX := pru_prupru_i2s1_image_0 -MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/I2S/$(MCU_HEX_NAME) +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s/$(MCU_HEX_NAME) # which directories to search for assembly & C source files? FILES_PATH := ../../../../ @@ -29,7 +29,7 @@ include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for I2S firmware headers INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include -INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/I2S +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s # Defines: PRU1, I2S Rx, overflow detection DFLAGS := \ diff --git a/examples/pru_i2s/firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec similarity index 100% rename from examples/pru_i2s/firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec rename to examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec diff --git a/examples/pru_i2s/firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec similarity index 97% rename from examples/pru_i2s/firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec rename to examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec index 7e81226f4..dd18868ba 100644 --- a/examples/pru_i2s/firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec @@ -33,10 +33,10 @@ -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s -DPRU1 -DSLICE1 - -v3 + -v4 -DSOC_AM263X -DPRU1 -DI2S_RX diff --git a/examples/pru_i2s/firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile similarity index 94% rename from examples/pru_i2s/firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile rename to examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile index e16505f10..7d3e864e0 100644 --- a/examples/pru_i2s/firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -11,7 +11,7 @@ OUTPUT_NAME := pru_i2s_am263x-cc_icssm0-pru1_fw # MCU+ projects: rename & move hex array output MCU_HEX_NAME := pru_i2s_pru1_array.h HEX_ARRAY_PREFIX := pru_prupru_i2s1_image_0 -MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/I2S/$(MCU_HEX_NAME) +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s/$(MCU_HEX_NAME) # which directories to search for assembly & C source files? FILES_PATH := ../../../../ @@ -29,7 +29,7 @@ include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for I2S firmware headers INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include -INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/I2S +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s # Defines: PRU1, I2S Rx, overflow detection DFLAGS := \ diff --git a/examples/pru_i2s/firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec similarity index 100% rename from examples/pru_i2s/firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec rename to examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec diff --git a/examples/pru_i2s/firmware/I2S/pru_i2s_interface.h b/examples/pru_i2s/firmware/i2s/pru_i2s_interface.h similarity index 100% rename from examples/pru_i2s/firmware/I2S/pru_i2s_interface.h rename to examples/pru_i2s/firmware/i2s/pru_i2s_interface.h diff --git a/examples/pru_i2s/firmware/I2S/pru_i2s_main.asm b/examples/pru_i2s/firmware/i2s/pru_i2s_main.asm similarity index 100% rename from examples/pru_i2s/firmware/I2S/pru_i2s_main.asm rename to examples/pru_i2s/firmware/i2s/pru_i2s_main.asm diff --git a/examples/pru_i2s/firmware/I2S/pru_i2s_regs.h b/examples/pru_i2s/firmware/i2s/pru_i2s_regs.h similarity index 100% rename from examples/pru_i2s/firmware/I2S/pru_i2s_regs.h rename to examples/pru_i2s/firmware/i2s/pru_i2s_regs.h diff --git a/examples/pru_i2s/firmware/TDM4/fw_regs.asm b/examples/pru_i2s/firmware/tdm4/fw_regs.asm similarity index 100% rename from examples/pru_i2s/firmware/TDM4/fw_regs.asm rename to examples/pru_i2s/firmware/tdm4/fw_regs.asm diff --git a/examples/pru_i2s/firmware/TDM4/icss_pru_i2s_fw.h b/examples/pru_i2s/firmware/tdm4/icss_pru_i2s_fw.h similarity index 100% rename from examples/pru_i2s/firmware/TDM4/icss_pru_i2s_fw.h rename to examples/pru_i2s/firmware/tdm4/icss_pru_i2s_fw.h diff --git a/examples/pru_i2s/firmware/TDM4/linker.cmd b/examples/pru_i2s/firmware/tdm4/linker.cmd similarity index 100% rename from examples/pru_i2s/firmware/TDM4/linker.cmd rename to examples/pru_i2s/firmware/tdm4/linker.cmd diff --git a/examples/pru_i2s/firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec similarity index 97% rename from examples/pru_i2s/firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec rename to examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec index de022acf1..7bc547fdd 100644 --- a/examples/pru_i2s/firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec @@ -33,10 +33,10 @@ -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4 + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 -DPRU0 -DSLICE0 - -v3 + -v4 -DSOC_AM261X -DPRU0 -DI2S_TX diff --git a/examples/pru_i2s/firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile similarity index 94% rename from examples/pru_i2s/firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile rename to examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile index 119bea94f..23d081436 100644 --- a/examples/pru_i2s/firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -11,7 +11,7 @@ OUTPUT_NAME := pru_i2s_tdm4_am261x-lp_icssm0-pru0_fw # MCU+ projects: rename & move hex array output MCU_HEX_NAME := pru_i2s_tdm4_pru0_array.h HEX_ARRAY_PREFIX := pru_prupru_i2s0_image_0 -MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/TDM4/$(MCU_HEX_NAME) +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4/$(MCU_HEX_NAME) # which directories to search for assembly & C source files? FILES_PATH := ../../../../ @@ -29,7 +29,7 @@ include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for TDM4 firmware headers INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include -INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/TDM4 +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4 # Defines: PRU0, I2S Tx, 3 Tx channels, underflow detection DFLAGS := \ diff --git a/examples/pru_i2s/firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec similarity index 100% rename from examples/pru_i2s/firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec rename to examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec diff --git a/examples/pru_i2s/firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec similarity index 97% rename from examples/pru_i2s/firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec rename to examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec index e4574cf04..071689742 100644 --- a/examples/pru_i2s/firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec @@ -33,10 +33,10 @@ -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4 + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 -DPRU0 -DSLICE0 - -v3 + -v4 -DSOC_AM263X -DPRU0 -DI2S_TX diff --git a/examples/pru_i2s/firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile similarity index 94% rename from examples/pru_i2s/firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile rename to examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile index 69ae62185..25123b172 100644 --- a/examples/pru_i2s/firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -11,7 +11,7 @@ OUTPUT_NAME := pru_i2s_tdm4_am263x-cc_icssm0-pru0_fw # MCU+ projects: rename & move hex array output MCU_HEX_NAME := pru_i2s_tdm4_pru0_array.h HEX_ARRAY_PREFIX := pru_prupru_i2s0_image_0 -MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/TDM4/$(MCU_HEX_NAME) +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4/$(MCU_HEX_NAME) # which directories to search for assembly & C source files? FILES_PATH := ../../../../ @@ -29,7 +29,7 @@ include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for TDM4 firmware headers INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include -INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/TDM4 +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4 # Defines: PRU0, I2S Tx, 3 Tx channels, underflow detection DFLAGS := \ diff --git a/examples/pru_i2s/firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec similarity index 100% rename from examples/pru_i2s/firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec rename to examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile_projectspec diff --git a/examples/pru_i2s/firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec similarity index 97% rename from examples/pru_i2s/firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec rename to examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec index 4e9d5e860..0f3dd3bdc 100644 --- a/examples/pru_i2s/firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec @@ -33,10 +33,10 @@ -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4 + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 -DPRU1 -DSLICE1 - -v3 + -v4 -DSOC_AM261X -DPRU1 -DI2S_RX diff --git a/examples/pru_i2s/firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile similarity index 94% rename from examples/pru_i2s/firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile rename to examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile index 2202394bb..bdb812742 100644 --- a/examples/pru_i2s/firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -11,7 +11,7 @@ OUTPUT_NAME := pru_i2s_tdm4_am261x-lp_icssm0-pru1_fw # MCU+ projects: rename & move hex array output MCU_HEX_NAME := pru_i2s_tdm4_pru1_array.h HEX_ARRAY_PREFIX := pru_prupru_i2s1_image_0 -MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/TDM4/$(MCU_HEX_NAME) +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4/$(MCU_HEX_NAME) # which directories to search for assembly & C source files? FILES_PATH := ../../../../ @@ -29,7 +29,7 @@ include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for TDM4 firmware headers INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include -INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/TDM4 +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4 # Defines: PRU1, I2S Rx, overflow detection DFLAGS := \ diff --git a/examples/pru_i2s/firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec similarity index 100% rename from examples/pru_i2s/firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec rename to examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec diff --git a/examples/pru_i2s/firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec similarity index 97% rename from examples/pru_i2s/firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec rename to examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec index e0e8b4365..c44f0b28e 100644 --- a/examples/pru_i2s/firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec @@ -33,10 +33,10 @@ -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4 + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 -DPRU1 -DSLICE1 - -v3 + -v4 -DSOC_AM263X -DPRU1 -DI2S_RX diff --git a/examples/pru_i2s/firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile similarity index 94% rename from examples/pru_i2s/firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile rename to examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile index 11b2859d0..9e992b7e8 100644 --- a/examples/pru_i2s/firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -11,7 +11,7 @@ OUTPUT_NAME := pru_i2s_tdm4_am263x-cc_icssm0-pru1_fw # MCU+ projects: rename & move hex array output MCU_HEX_NAME := pru_i2s_tdm4_pru1_array.h HEX_ARRAY_PREFIX := pru_prupru_i2s1_image_0 -MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/TDM4/$(MCU_HEX_NAME) +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4/$(MCU_HEX_NAME) # which directories to search for assembly & C source files? FILES_PATH := ../../../../ @@ -29,7 +29,7 @@ include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for TDM4 firmware headers INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include -INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/TDM4 +INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4 # Defines: PRU1, I2S Rx, overflow detection DFLAGS := \ diff --git a/examples/pru_i2s/firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec similarity index 100% rename from examples/pru_i2s/firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec rename to examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile_projectspec diff --git a/examples/pru_i2s/firmware/TDM4/pru_i2s_interface.h b/examples/pru_i2s/firmware/tdm4/pru_i2s_interface.h similarity index 100% rename from examples/pru_i2s/firmware/TDM4/pru_i2s_interface.h rename to examples/pru_i2s/firmware/tdm4/pru_i2s_interface.h diff --git a/examples/pru_i2s/firmware/TDM4/pru_i2s_main.asm b/examples/pru_i2s/firmware/tdm4/pru_i2s_main.asm similarity index 100% rename from examples/pru_i2s/firmware/TDM4/pru_i2s_main.asm rename to examples/pru_i2s/firmware/tdm4/pru_i2s_main.asm diff --git a/examples/pru_i2s/firmware/TDM4/pru_i2s_regs.h b/examples/pru_i2s/firmware/tdm4/pru_i2s_regs.h similarity index 100% rename from examples/pru_i2s/firmware/TDM4/pru_i2s_regs.h rename to examples/pru_i2s/firmware/tdm4/pru_i2s_regs.h diff --git a/examples/pru_i2s/makefile b/examples/pru_i2s/makefile index f7611f174..d6fc80e5c 100644 --- a/examples/pru_i2s/makefile +++ b/examples/pru_i2s/makefile @@ -83,9 +83,9 @@ host: pre_build_message $(DEVICE_NON_PRU) clean: ARGUMENTS_PRU = clean clean: ARGUMENTS_MCUPLUS = scrub clean: MESSAGE = "Cleaning $(PROJECT_NAME) for $(DEVICE)" -clean: pre_build_message $(DEVICE) clean_lib +clean: pre_build_message $(DEVICE) $(DEVICE_NON_PRU) clean_lib -clean_lib: +clean_lib: $(DEVICE) $(DEVICE_NON_PRU) $(MAKE) -C ../../source/i2s clean else @@ -104,11 +104,11 @@ pre_build_message: # PRU firmware should be built before any RTOS code that includes it am261x: # am261x-lp - I2S protocol - $(MAKE) -C firmware/I2S/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt $(ARGUMENTS_PRU) - $(MAKE) -C firmware/I2S/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt $(ARGUMENTS_PRU) + $(MAKE) -C firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt $(ARGUMENTS_PRU) + $(MAKE) -C firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt $(ARGUMENTS_PRU) # am261x-lp - TDM4 protocol - $(MAKE) -C firmware/TDM4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt $(ARGUMENTS_PRU) - $(MAKE) -C firmware/TDM4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt $(ARGUMENTS_PRU) + $(MAKE) -C firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt $(ARGUMENTS_PRU) + $(MAKE) -C firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt $(ARGUMENTS_PRU) am261x_mcuplus: build_lib_am261x # am261x-lp - R5F application @@ -120,11 +120,11 @@ build_lib_am261x: am263x: # am263x-cc - I2S protocol - $(MAKE) -C firmware/I2S/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt $(ARGUMENTS_PRU) - $(MAKE) -C firmware/I2S/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt $(ARGUMENTS_PRU) + $(MAKE) -C firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt $(ARGUMENTS_PRU) + $(MAKE) -C firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt $(ARGUMENTS_PRU) # am263x-cc - TDM4 protocol - $(MAKE) -C firmware/TDM4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt $(ARGUMENTS_PRU) - $(MAKE) -C firmware/TDM4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt $(ARGUMENTS_PRU) + $(MAKE) -C firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt $(ARGUMENTS_PRU) + $(MAKE) -C firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt $(ARGUMENTS_PRU) am263x_mcuplus: build_lib_am263x # am263x-cc - R5F application diff --git a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec index bb1a72566..c9623634a 100644 --- a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -38,8 +38,8 @@ -I${WORKSPACE_LOC}/pru_i2s_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt -I${WORKSPACE_LOC}/pru_i2s_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4 + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 -I${OPEN_PRU_PATH}/examples/pru_i2s/pru_i2s_app -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/FreeRTOS-Kernel/include -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F diff --git a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile index c770dc3f4..58049da00 100644 --- a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile @@ -59,8 +59,8 @@ INCLUDES_common := \ -I${OPEN_PRU_PATH}/source \ -I${OPEN_PRU_PATH}/source/i2s \ -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware \ - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S \ - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4 \ + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s \ + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 \ -I${OPEN_PRU_PATH}/examples/pru_i2s/pru_i2s_app \ -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/FreeRTOS-Kernel/include \ -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F \ diff --git a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec index 3a4473583..f461930ea 100644 --- a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -38,8 +38,8 @@ -I${WORKSPACE_LOC}/pru_i2s_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt -I${WORKSPACE_LOC}/pru_i2s_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4 + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 -I${OPEN_PRU_PATH}/examples/pru_i2s/pru_i2s_app -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/FreeRTOS-Kernel/include -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F diff --git a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile index 5fa9e4246..38c624d21 100644 --- a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile @@ -61,8 +61,8 @@ INCLUDES_common := \ -I${OPEN_PRU_PATH}/source \ -I${OPEN_PRU_PATH}/source/i2s \ -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware \ - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/I2S \ - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/TDM4 \ + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s \ + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 \ -I${OPEN_PRU_PATH}/examples/pru_i2s/pru_i2s_app \ -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/FreeRTOS-Kernel/include \ -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F \ diff --git a/source/i2s/makefile b/source/i2s/makefile index 35fadb42f..e02f41547 100644 --- a/source/i2s/makefile +++ b/source/i2s/makefile @@ -15,6 +15,8 @@ endif # Debug: no optimization (-O0) for faster compile/debug; Release: size-optimized (-Os) CFLAGS_OPT_debug := -O0 CFLAGS_OPT_release := -Os +CFLAGS_OPT_Release := -Os +CFLAGS_OPT_Debug := -O0 CFLAGS_OPT := $(CFLAGS_OPT_$(PROFILE)) CFLAGS_common := \ diff --git a/source/i2s/pru_i2s_drv.c b/source/i2s/pru_i2s_drv.c index c1b8fd9df..d8aa19210 100644 --- a/source/i2s/pru_i2s_drv.c +++ b/source/i2s/pru_i2s_drv.c @@ -36,7 +36,7 @@ #include #include "pru_i2s_drv.h" -#include +#include /* Application calls PRUICSS_intcInit() directly (Motor Control SDK pattern) */ diff --git a/source/i2s/pru_i2s_drv.h b/source/i2s/pru_i2s_drv.h index f21231c65..e74050316 100644 --- a/source/i2s/pru_i2s_drv.h +++ b/source/i2s/pru_i2s_drv.h @@ -46,7 +46,7 @@ #include #include #include -#include "TDM4/icss_pru_i2s_fw.h" +#include "tdm4/icss_pru_i2s_fw.h" /* Number of ICSS instances */ #define PRUI2S_NUM_ICSS_INST ( 2 ) /* Number of PRU instances per ICSS */ From 17b5f23698e67d8497fd6d31be2eabf2f5cd0549 Mon Sep 17 00:00:00 2001 From: Ayushman Date: Wed, 18 Nov 2026 14:57:31 +0530 Subject: [PATCH 04/10] pru_i2s: fix review comments (parallel build, -v4, README, dead files, Debug lib name) - makefile: host builds pru firmware, then the driver library, then the R5F app as ordered recipe steps, so "make -j host" no longer compiles the app before the firmware array headers exist; all calls host - makefile: clean_lib no longer depends on the device targets, so "make clean" does not build the library before removing it - firmware makefiles (8) and README: PRU_VERSION 3 -> 4 (-v4) - README: correct array header location, firmware-only build command and build directory - remove unused pru_i2s_app/pru_i2s_app_config.{c,h}; the source/i2s copies are the ones built into the library - app projectspecs: link ...Debug.lib to match the PROFILE=${ConfigName} name Signed-off-by: Ayushman --- examples/pru_i2s/README.md | 10 +- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 2 +- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 2 +- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 2 +- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 2 +- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 2 +- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 2 +- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 2 +- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 2 +- examples/pru_i2s/makefile | 18 +-- .../ti-arm-clang/example.projectspec | 2 +- .../ti-arm-clang/example.projectspec | 2 +- .../pru_i2s/pru_i2s_app/pru_i2s_app_config.c | 110 ------------------ .../pru_i2s/pru_i2s_app/pru_i2s_app_config.h | 94 --------------- 14 files changed, 25 insertions(+), 227 deletions(-) delete mode 100644 examples/pru_i2s/pru_i2s_app/pru_i2s_app_config.c delete mode 100644 examples/pru_i2s/pru_i2s_app/pru_i2s_app_config.h diff --git a/examples/pru_i2s/README.md b/examples/pru_i2s/README.md index cc1ae8ed2..f5a241ef3 100644 --- a/examples/pru_i2s/README.md +++ b/examples/pru_i2s/README.md @@ -169,7 +169,7 @@ pru_i2s/ │ │ ├── icss_pru_i2s_fw.h # Firmware register map │ │ ├── pru_i2s_interface.h # Interface definitions │ │ ├── pru_i2s_regs.h # Hardware registers -│ │ ├── generated/ # Generated firmware array headers (build output, gitignored) +│ │ ├── pru_i2s_pru0/1_array.h # Generated firmware array headers (build output, gitignored) │ │ ├── pru0_tx/ # TX firmware builds │ │ │ ├── am261x-lp/ # AM261x variant │ │ │ └── am263x-cc/ # AM263x variant @@ -201,7 +201,7 @@ pru_i2s/ **Build all firmware and application:** ```bash -cd /path/to/open-pru +cd examples/pru_i2s make DEVICE=am261x # Build for AM261x make DEVICE=am263x # Build for AM263x ``` @@ -209,7 +209,7 @@ make DEVICE=am263x # Build for AM263x **Build only firmware:** ```bash cd examples/pru_i2s -make DEVICE=am261x # Builds 4 firmware variants (I2S + TDM4, PRU0 + PRU1) +make pru DEVICE=am261x # Builds 4 firmware variants (I2S + TDM4, PRU0 + PRU1) ``` **Clean:** @@ -219,11 +219,11 @@ make DEVICE=am261x clean **What gets built:** - 4 PRU firmware binaries per device (I2S PRU0 TX, I2S PRU1 RX, TDM4 PRU0 TX, TDM4 PRU1 RX) -- Firmware header arrays (`.h` files) generated into `firmware/i2s/generated/` and `firmware/tdm4/generated/` (gitignored) +- Firmware header arrays (`.h` files) copied into `firmware/i2s/` and `firmware/tdm4/` (gitignored) - PRU I2S driver library (`lib/pru_i2s.*.lib`) built from `source/i2s/makefile` - R5F application binary (`.out` and `.mcelf`) -**Note:** The PRU firmware makefiles use `pru_rules.mak` (silicon version `-v3`, PRUSS/PRU-ICSS) and place all build artifacts in a `ti-pru-cgt/generated/` subdirectory. The library build is owned by `source/i2s/makefile` and is invoked automatically by the top-level `makefile`. +**Note:** The PRU firmware makefiles use `pru_rules.mak` (silicon version `-v4`) and place all build artifacts in a `ti-pru-cgt/generated/` subdirectory. The library build is owned by `source/i2s/makefile` and is invoked automatically by the top-level `makefile`. ### Building with Code Composer Studio diff --git a/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile index c3396eceb..773e30033 100644 --- a/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -20,7 +20,7 @@ FILES_PATH := ../../../../ COMMAND_FILES := linker.cmd # Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) -PRU_VERSION := 3 +PRU_VERSION := 4 EXPECTED_DEVICE := am261x diff --git a/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile index 7133ba264..6c17510c0 100644 --- a/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -20,7 +20,7 @@ FILES_PATH := ../../../../ COMMAND_FILES := linker.cmd # Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) -PRU_VERSION := 3 +PRU_VERSION := 4 EXPECTED_DEVICE := am263x diff --git a/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile index 393ec0790..941b31e28 100644 --- a/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -20,7 +20,7 @@ FILES_PATH := ../../../../ COMMAND_FILES := linker.cmd # Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) -PRU_VERSION := 3 +PRU_VERSION := 4 EXPECTED_DEVICE := am261x diff --git a/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile index 7d3e864e0..01a4c766a 100644 --- a/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -20,7 +20,7 @@ FILES_PATH := ../../../../ COMMAND_FILES := linker.cmd # Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) -PRU_VERSION := 3 +PRU_VERSION := 4 EXPECTED_DEVICE := am263x diff --git a/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile index 23d081436..1764c51ac 100644 --- a/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -20,7 +20,7 @@ FILES_PATH := ../../../../ COMMAND_FILES := linker.cmd # Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) -PRU_VERSION := 3 +PRU_VERSION := 4 EXPECTED_DEVICE := am261x diff --git a/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile index 25123b172..75057172a 100644 --- a/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -20,7 +20,7 @@ FILES_PATH := ../../../../ COMMAND_FILES := linker.cmd # Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) -PRU_VERSION := 3 +PRU_VERSION := 4 EXPECTED_DEVICE := am263x diff --git a/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile index bdb812742..7ce91505e 100644 --- a/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -20,7 +20,7 @@ FILES_PATH := ../../../../ COMMAND_FILES := linker.cmd # Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) -PRU_VERSION := 3 +PRU_VERSION := 4 EXPECTED_DEVICE := am261x diff --git a/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile index 9e992b7e8..0c2178d8b 100644 --- a/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -20,7 +20,7 @@ FILES_PATH := ../../../../ COMMAND_FILES := linker.cmd # Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) -PRU_VERSION := 3 +PRU_VERSION := 4 EXPECTED_DEVICE := am263x diff --git a/examples/pru_i2s/makefile b/examples/pru_i2s/makefile index d6fc80e5c..7e5f5a500 100644 --- a/examples/pru_i2s/makefile +++ b/examples/pru_i2s/makefile @@ -65,7 +65,6 @@ ifeq ($(BUILD_PROJECT),y) # "make" or "make all" builds PRU firmware then host code for $(DEVICE) all: MESSAGE = "Building $(PROJECT_NAME) for $(DEVICE)" all: pre_build_message - $(MAKE) pru $(MAKE) host # "make pru" builds only PRU firmware for $(DEVICE) @@ -73,11 +72,14 @@ pru: ARGUMENTS_PRU = all pru: MESSAGE = "Building $(PROJECT_NAME) PRU firmware" pru: pre_build_message $(DEVICE) -# "make host" builds only host (R5F) code for $(DEVICE) — requires PRU firmware first -host: pru -host: ARGUMENTS_MCUPLUS = all +# "make host" builds PRU firmware, then the driver library, then host (R5F) code +# for $(DEVICE). The steps are recipe lines so they stay in order under "make -j": +# the host code includes the PRU firmware headers, and links the library. host: MESSAGE = "Building $(PROJECT_NAME) host code for $(DEVICE)" -host: pre_build_message $(DEVICE_NON_PRU) +host: pre_build_message + $(MAKE) pru + $(MAKE) build_lib_$(DEVICE) + $(MAKE) $(DEVICE_NON_PRU) ARGUMENTS_MCUPLUS=all # "make clean" cleans projects that match $(DEVICE) set in imports.mak clean: ARGUMENTS_PRU = clean @@ -85,7 +87,7 @@ clean: ARGUMENTS_MCUPLUS = scrub clean: MESSAGE = "Cleaning $(PROJECT_NAME) for $(DEVICE)" clean: pre_build_message $(DEVICE) $(DEVICE_NON_PRU) clean_lib -clean_lib: $(DEVICE) $(DEVICE_NON_PRU) +clean_lib: $(MAKE) -C ../../source/i2s clean else @@ -110,7 +112,7 @@ am261x: $(MAKE) -C firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt $(ARGUMENTS_PRU) $(MAKE) -C firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt $(ARGUMENTS_PRU) -am261x_mcuplus: build_lib_am261x +am261x_mcuplus: # am261x-lp - R5F application $(MAKE) -C pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang $(ARGUMENTS_MCUPLUS) @@ -126,7 +128,7 @@ am263x: $(MAKE) -C firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt $(ARGUMENTS_PRU) $(MAKE) -C firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt $(ARGUMENTS_PRU) -am263x_mcuplus: build_lib_am263x +am263x_mcuplus: # am263x-cc - R5F application $(MAKE) -C pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang $(ARGUMENTS_MCUPLUS) diff --git a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec index c9623634a..4aecc7f33 100644 --- a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -90,7 +90,7 @@ -lfreertos.am261x.r5f.ti-arm-clang.debug.lib -ldrivers.am261x.r5f.ti-arm-clang.freertos.debug.lib -lboard.am261x.r5f.ti-arm-clang.freertos.debug.lib - -lpru_i2s.am261x.r5f.ti-arm-clang.debug.lib + -lpru_i2s.am261x.r5f.ti-arm-clang.Debug.lib -llibc.a -llibsysbm.a " diff --git a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec index f461930ea..bf8304c21 100644 --- a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -90,7 +90,7 @@ -lfreertos.am263x.r5f.ti-arm-clang.debug.lib -ldrivers.am263x.r5f.ti-arm-clang.freertos.debug.lib -lboard.am263x.r5f.ti-arm-clang.freertos.debug.lib - -lpru_i2s.am263x.r5f.ti-arm-clang.debug.lib + -lpru_i2s.am263x.r5f.ti-arm-clang.Debug.lib -llibc.a -llibsysbm.a " diff --git a/examples/pru_i2s/pru_i2s_app/pru_i2s_app_config.c b/examples/pru_i2s/pru_i2s_app/pru_i2s_app_config.c deleted file mode 100644 index 9b32a8490..000000000 --- a/examples/pru_i2s/pru_i2s_app/pru_i2s_app_config.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2024-2025 Texas Instruments Incorporated - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * \file pru_i2s_app_config.c - * - * \brief PRU I2S Application Configuration - * - * This file contains the application-specific configuration for PRU I2S. - * Modify pru_i2s_app_config.h to configure: - * - ICSS instance selection (ICSSM0 or ICSSM1) - * - PRU core selection (PRU0 or PRU1) - * - I2S/TDM mode selection - * - Instance enable flags - */ - -#include "pru_i2s_config.h" -#include "pru_i2s_drv.h" -#include "pru_i2s_app_config.h" - -/* ========================================================================== */ -/* USER CONFIGURATION */ -/* ========================================================================== */ - -/** - * \brief PRU I2S Configuration Table - * - * This table defines the configuration for each PRU I2S instance. - * - * For AM261x LaunchPad: - * - Uses ICSSM1 (icssInstId = 1) - * - PRU0 for Tx, PRU1 for Rx - * - * For AM263x Control Card: - * - Uses ICSSM0 (icssInstId = 0) - * - PRU0 and PRU1 for Tx and Rx - * - * Modify the values below to match your hardware configuration. - */ -static const PRUI2S_UserConfig gPruI2sAppConfig[PRU_I2S_NUM_CONFIG] = -{ - /* Configuration 0: First PRU core */ - PRUI2S_USER_CONFIG_PRU0, - - /* Configuration 1: Second PRU core */ - PRUI2S_USER_CONFIG_PRU1 -}; - -/* ========================================================================== */ -/* FUNCTION DEFINITIONS */ -/* ========================================================================== */ - -/** - * \brief Apply PRU I2S application configuration - * - * This function applies the user configuration to the PRU I2S driver. - * It must be called before PRUI2S_init(). - * - * \return 0 on success, negative error code on failure - */ -int32_t PRUI2S_applyAppConfig(void) -{ - int32_t status = PRUI2S_DRV_SOK; - uint8_t i; - - for (i = 0; i < PRU_I2S_NUM_CONFIG; i++) - { - status = PRUI2S_setUserConfig( - i, - gPruI2sAppConfig[i].icssInstId, - gPruI2sAppConfig[i].pruInstId - ); - - if (status != PRUI2S_DRV_SOK) - { - break; - } - } - - return status; -} diff --git a/examples/pru_i2s/pru_i2s_app/pru_i2s_app_config.h b/examples/pru_i2s/pru_i2s_app/pru_i2s_app_config.h deleted file mode 100644 index cc4ac8ec3..000000000 --- a/examples/pru_i2s/pru_i2s_app/pru_i2s_app_config.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2024-2025 Texas Instruments Incorporated - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _PRU_I2S_APP_CONFIG_H_ -#define _PRU_I2S_APP_CONFIG_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/* ========================================================================== */ -/* I2S MODE CONFIGURATION CONSTANTS */ -/* ========================================================================== */ - -#define I2S_MODE 0 /**< Standard I2S mode */ -#define TDM_MODE 1 /**< Time Division Multiplexing mode */ -#define CONFIG_I2S0_MODE TDM_MODE /**< Selected mode: TDM mode=1, I2S mode=0 */ - -/* ========================================================================== */ -/* SYSCONFIG-BASED INSTANCE ENABLE FLAGS */ -/* ========================================================================== */ - -#ifndef CONFIG_PRU_I2S0_ENABLED -#define CONFIG_PRU_I2S0_ENABLED 1 /**< Enable PRU I2S 0 (Tx on PRU0) */ -#endif - -#ifndef CONFIG_PRU_I2S1_ENABLED -#define CONFIG_PRU_I2S1_ENABLED 1 /**< Enable PRU I2S 1 (Rx on PRU1) */ -#endif - -/* ========================================================================== */ -/* PRU I2S INSTANCE INDICES */ -/* ========================================================================== */ - -#define PRU_I2S0_INSTANCE_IDX 0 /**< Instance index for PRU I2S 0 (Tx only) */ -#define PRU_I2S1_INSTANCE_IDX 1 /**< Instance index for PRU I2S 1 (Rx only) */ - -/* ========================================================================== */ -/* TEST INSTANCE INDICES - PRU I2S INSTANCES USED */ -/* ========================================================================== */ - -#define TEST_PRUI2S0_IDX PRU_I2S0_INSTANCE_IDX /**< Test PRU I2S 0 index (for Tx) */ -#define TEST_PRUI2S1_IDX PRU_I2S1_INSTANCE_IDX /**< Test PRU I2S 1 index (for Rx) */ - -/* ========================================================================== */ -/* FUNCTION DECLARATIONS */ -/* ========================================================================== */ - -/** - * \brief Apply PRU I2S application configuration - * - * This function applies the user configuration to the PRU I2S driver. - * It must be called before PRUI2S_init(). - * - * \return 0 on success, negative error code on failure - */ -int32_t PRUI2S_applyAppConfig(void); - -#ifdef __cplusplus -} -#endif - -#endif /* _PRU_I2S_APP_CONFIG_H_ */ From ed1aa3603eb2d00aa13505f0203ebcb05c5402e4 Mon Sep 17 00:00:00 2001 From: Ayushman Date: Wed, 18 Nov 2026 16:11:46 +0530 Subject: [PATCH 05/10] pru_i2s: decouple source/i2s from the example - move icss_pru_i2s_fw.h to source/i2s/ as the single copy shared by the PRU firmware and the R5F driver (the firmware/i2s and firmware/tdm4 copies were identical apart from a guard comment); the driver now includes it locally - source/i2s/makefile: drop the examples/ include paths and write the library to source/i2s/lib, matching source/rpmsg - firmware makefiles and projectspecs: add source/i2s to the include path and link the header from its new location - app makefiles and projectspecs: link the library from source/i2s/lib - README: update the file tree and library path Signed-off-by: Ayushman --- examples/pru_i2s/README.md | 3 +- .../pru_i2s/firmware/i2s/icss_pru_i2s_fw.h | 197 ------------------ .../ti-pru-cgt/example.projectspec | 3 +- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 1 + .../ti-pru-cgt/example.projectspec | 3 +- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 1 + .../ti-pru-cgt/example.projectspec | 3 +- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 1 + .../ti-pru-cgt/example.projectspec | 3 +- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 1 + .../ti-pru-cgt/example.projectspec | 3 +- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 1 + .../ti-pru-cgt/example.projectspec | 3 +- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 1 + .../ti-pru-cgt/example.projectspec | 3 +- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 1 + .../ti-pru-cgt/example.projectspec | 3 +- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 1 + .../ti-arm-clang/example.projectspec | 2 +- .../r5fss0-0_freertos/ti-arm-clang/makefile | 4 +- .../ti-arm-clang/example.projectspec | 2 +- .../r5fss0-0_freertos/ti-arm-clang/makefile | 4 +- .../tdm4 => source/i2s}/icss_pru_i2s_fw.h | 0 source/i2s/makefile | 4 +- source/i2s/pru_i2s_drv.c | 2 +- source/i2s/pru_i2s_drv.h | 2 +- 26 files changed, 34 insertions(+), 218 deletions(-) delete mode 100644 examples/pru_i2s/firmware/i2s/icss_pru_i2s_fw.h rename {examples/pru_i2s/firmware/tdm4 => source/i2s}/icss_pru_i2s_fw.h (100%) diff --git a/examples/pru_i2s/README.md b/examples/pru_i2s/README.md index f5a241ef3..524c60069 100644 --- a/examples/pru_i2s/README.md +++ b/examples/pru_i2s/README.md @@ -166,7 +166,6 @@ pru_i2s/ │ │ ├── pru_i2s_main.asm # Main firmware logic │ │ ├── fw_regs.asm # Register definitions │ │ ├── linker.cmd # Linker script -│ │ ├── icss_pru_i2s_fw.h # Firmware register map │ │ ├── pru_i2s_interface.h # Interface definitions │ │ ├── pru_i2s_regs.h # Hardware registers │ │ ├── pru_i2s_pru0/1_array.h # Generated firmware array headers (build output, gitignored) @@ -220,7 +219,7 @@ make DEVICE=am261x clean **What gets built:** - 4 PRU firmware binaries per device (I2S PRU0 TX, I2S PRU1 RX, TDM4 PRU0 TX, TDM4 PRU1 RX) - Firmware header arrays (`.h` files) copied into `firmware/i2s/` and `firmware/tdm4/` (gitignored) -- PRU I2S driver library (`lib/pru_i2s.*.lib`) built from `source/i2s/makefile` +- PRU I2S driver library (`source/i2s/lib/pru_i2s.*.lib`) built from `source/i2s/makefile` - R5F application binary (`.out` and `.mcelf`) **Note:** The PRU firmware makefiles use `pru_rules.mak` (silicon version `-v4`) and place all build artifacts in a `ti-pru-cgt/generated/` subdirectory. The library build is owned by `source/i2s/makefile` and is invoked automatically by the top-level `makefile`. diff --git a/examples/pru_i2s/firmware/i2s/icss_pru_i2s_fw.h b/examples/pru_i2s/firmware/i2s/icss_pru_i2s_fw.h deleted file mode 100644 index 4d172dcb2..000000000 --- a/examples/pru_i2s/firmware/i2s/icss_pru_i2s_fw.h +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (C) 2025 Texas Instruments Incorporated - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _ICSS_pru_i2s_FW_H_ -#define _ICSS_pru_i2s_FW_H_ - -/* - Firmware registers -*/ - -/* FW register base address */ -#define ICSS_PRUI2S_FW_REG_BASE ( 0x0000 ) - -/* FW register sizes (in bytes) */ -#define FW_REG_NUM_TX_I2S_SZ ( 1 ) -#define FW_REG_NUM_RX_I2S_SZ ( 1 ) -#define FW_REG_SAMP_FREQ_SZ ( 1 ) -#define FW_REG_BITS_PER_SLOT_SZ ( 1 ) -#define FW_REG_TX_PING_PONG_BUF_ADDR_SZ ( 4 ) -#define FW_REG_PING_PONG_BUF_SZ_SZ ( 2 ) -#define FW_REG_I2S_ICSS_INTC_SYS_EVT_SZ ( 1 ) -#define FW_REG_I2S_ERR_ICSS_INTC_SYS_EVT_SZ ( 1 ) -#define FW_REG_I2S_PIN_NUM_SZ ( 1 ) - -/* FW register offsets from base (in bytes) */ -#define FW_REG_NUM_TX_I2S_OFFSET ( 0x00 ) -#define FW_REG_NUM_RX_I2S_OFFSET ( 0x01 ) -#define FW_REG_SAMP_FREQ_OFFSET ( 0x02 ) -#define FW_REG_BITS_PER_SLOT_OFFSET ( 0x03 ) -#define FW_REG_TX_PING_PONG_BUF_ADDR_OFFSET ( 0x04 ) -#define FW_REG_PING_PONG_BUF_SZ_OFFSET ( 0x08 ) -#define FW_REG_I2S_TX_ICSS_INTC_SYS_EVT_OFFSET ( 0x0A ) -#define FW_REG_I2S_RX_ICSS_INTC_SYS_EVT_OFFSET ( 0x0B ) -#define FW_REG_I2S_ERR_ICSS_INTC_SYS_EVT_OFFSET ( 0x0C ) -#define FW_REG_I2S_PIN_NUM_BCLK_OFFSET ( 0x0D ) -#define FW_REG_I2S_PIN_NUM_FSYNC_OFFSET ( 0x0E ) -#define FW_REG_I2S_PIN_NUM_TX0_OFFSET ( 0x0F ) -#define FW_REG_I2S_PIN_NUM_TX1_OFFSET ( 0x10 ) -#define FW_REG_I2S_PIN_NUM_TX2_OFFSET ( 0x11 ) -#define FW_REG_I2S_PIN_NUM_RX0_OFFSET ( 0x12 ) -#define FW_REG_I2S_PIN_NUM_RX1_OFFSET ( 0x13 ) -#define FW_REG_RX_PING_PONG_BUF_ADDR_OFFSET ( 0x14 ) -#define FW_REG_TX_PING_PONG_SEL_OFFSET ( 0x18 ) -#define FW_REG_RX_PING_PONG_SEL_OFFSET ( 0x19 ) -#define FW_REG_TX_PING_PONG_STAT_OFFSET ( 0x1A ) -#define FW_REG_RX_PING_PONG_STAT_OFFSET ( 0x1B ) -#define FW_REG_ERR_STAT_OFFSET ( 0x1C ) - -/* FW register addresses */ -#define FW_REG_NUM_TX_I2S ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_NUM_TX_I2S_OFFSET ) -#define FW_REG_NUM_RX_I2S ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_NUM_RX_I2S_OFFSET ) -#define FW_REG_SAMP_FREQ ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_SAMP_FREQ_OFFSET ) -#define FW_REG_BITS_PER_SLOT ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_BITS_PER_SLOT_OFFSET ) -#define FW_REG_TX_PING_PONG_BUF_ADDR ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_TX_PING_PONG_BUF_ADDR_OFFSET ) -#define FW_REG_PING_PONG_BUF_SZ ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_PING_PONG_BUF_SZ_OFFSET ) -#define FW_REG_I2S_TX_ICSS_INTC_SYS_EVT ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_I2S_TX_ICSS_INTC_SYS_EVT_OFFSET ) -#define FW_REG_I2S_RX_ICSS_INTC_SYS_EVT ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_I2S_RX_ICSS_INTC_SYS_EVT_OFFSET ) -#define FW_REG_I2S_ERR_ICSS_INTC_SYS_EVT ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_I2S_ERR_ICSS_INTC_SYS_EVT_OFFSET ) -#define FW_REG_I2S_PIN_NUM_BCLK ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_I2S_PIN_NUM_BCLK_OFFSET ) -#define FW_REG_I2S_PIN_NUM_FSYNC ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_I2S_PIN_NUM_FSYNC_OFFSET ) -#define FW_REG_I2S_PIN_NUM_TX0 ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_I2S_PIN_NUM_TX0_OFFSET ) -#define FW_REG_I2S_PIN_NUM_TX1 ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_I2S_PIN_NUM_TX1_OFFSET ) -#define FW_REG_I2S_PIN_NUM_TX2 ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_I2S_PIN_NUM_TX2_OFFSET ) -#define FW_REG_I2S_PIN_NUM_RX0 ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_I2S_PIN_NUM_RX0_OFFSET ) -#define FW_REG_I2S_PIN_NUM_RX1 ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_I2S_PIN_NUM_RX1_OFFSET ) -#define FW_REG_RX_PING_PONG_BUF_ADDR ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_RX_PING_PONG_BUF_ADDR_OFFSET ) -#define FW_REG_TX_PING_PONG_SEL ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_TX_PING_PONG_SEL_OFFSET ) -#define FW_REG_RX_PING_PONG_SEL ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_RX_PING_PONG_SEL_OFFSET ) -#define FW_REG_TX_PING_PONG_STAT ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_TX_PING_PONG_STAT_OFFSET ) -#define FW_REG_RX_PING_PONG_STAT ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_RX_PING_PONG_STAT_OFFSET ) -#define FW_REG_ERR_STAT ( ICSS_PRUI2S_FW_REG_BASE + FW_REG_ERR_STAT_OFFSET ) - -/* - Firmware register bit fields -*/ - -/* NUM_TX_I2S */ -#define BF_NUM_TX_I2S_MASK ( 0x3 ) -#define NUM_TX_I2S_BF_NUM_TX_I2S_SHIFT ( 0 ) -#define NUM_TX_I2S_BF_NUM_TX_I2S_MASK ( BF_NUM_TX_I2S_MASK << NUM_TX_I2S_BF_NUM_TX_I2S_SHIFT ) - -/* NUM_RX_I2S */ -#define BF_NUM_RX_I2S_MASK ( 0x3 ) -#define NUM_TX_I2S_BF_NUM_RX_I2S_SHIFT ( 0 ) -#define NUM_TX_I2S_BF_NUM_RX_I2S_MASK ( BF_NUM_RX_I2S_MASK << NUM_TX_I2S_BF_NUM_RX_I2S_SHIFT ) - -/* FW_REG_SAMP_FREQ */ -#define BF_SAMP_FREQ_MASK ( 0xFF ) -#define SAMP_FREQ_BF_SAMP_FREQ_SHIFT ( 0 ) -#define SAMP_FREQ_BF_SAMP_FREQ_MASK ( BF_SAMP_FREQ_MASK << SAMP_FREQ_BF_SAMP_FREQ_SHIFT ) - -/* FW_REG_BITS_PER_SLOT */ -#define BF_BITS_PER_SLOT_MASK ( 0x1F ) -#define BITS_PER_SLOT_BF_BITS_PER_SLOT_SHIFT ( 0 ) -#define BITS_PER_SLOT_BF_BITS_PER_SLOT_MASK ( BF_BITS_PER_SLOT_MASK << BITS_PER_SLOT_BF_BITS_PER_SLOT_SHIFT ) - -/* FW_REG_TX_PING_PONG_BUF_ADDR */ -#define BF_TX_BUF_PING_PONG_BUF_ADDR_MASK ( 0xFFFFFFFF ) -#define TX_BUF_PING_PONG_BUF_ADDR_BF_TX_BUF_PING_PONG_BUF_ADDR_SHIFT \ - ( 0 ) -#define TX_BUF_PING_PONG_BUF_ADDR_BF_TX_BUF_PING_PONG_BUF_ADDR_MASK \ - ( BF_TX_BUF_PING_PONG_BUF_ADDR_MASK << TX_BUF_PING_PONG_BUF_ADDR_BF_TX_BUF_PING_PONG_BUF_ADDR_SHIFT ) - -/* FW_REG_PING_PONG_BUF_SZ */ -#define BF_PING_PONG_BUF_SZ_MASK ( 0xFFFF ) -#define TX_PING_PONG_BUF_SZ_BF_PING_PONG_BUF_SZ_SHIFT \ - ( 0 ) -#define TX_PING_PONG_BUF_SZ_BF_PING_PONG_BUF_SZ_MASK \ - ( BF_PING_PONG_BUF_SZ_MASK << TX_PING_PONG_BUF_SZ_BF_PING_PONG_BUF_SZ_SHIFT ) - -/* FW_REG_I2S_ICSS_INTC_SYS_EVT */ -#define BF_I2S_ICSS_INTC_SYS_EVT_MASK ( 0xFF ) -#define I2S_ICSS_INTC_SYS_EVT_BF_I2S_ICSS_INTC_SYS_EVT_SHIFT \ - ( 0 ) -#define I2S_ICSS_INTC_SYS_EVT_BF_I2S_ICSS_INTC_SYS_EVT_MASK \ - ( BF_I2S_ICSS_INTC_SYS_EVT_MASK << I2S_ICSS_INTC_SYS_EVT_BF_I2S_ICSS_INTC_SYS_EVT_SHIFT ) - -/* FW_REG_I2S_ERR_ICSS_INTC_SYS_EVT */ -#define BF_I2S_ERR_ICSS_INTC_SYS_EVT_MASK ( 0xFF ) -#define I2S_ERR_ICSS_INTC_SYS_EVT_BF_I2S_ERR_ICSS_INTC_SYS_EVT_SHIFT \ - ( 0 ) -#define I2S_ERR_ICSS_INTC_SYS_EVT_BF_I2S_ERR_ICSS_INTC_SYS_EVT_MASK \ - ( BF_I2S_ERR_ICSS_INTC_SYS_EVT_MASK << I2S_ERR_ICSS_INTC_SYS_EVT_BF_I2S_ERR_ICSS_INTC_SYS_EVT_SHIFT ) - -/* FW_REG_I2S_PIN_NUM_ */ -#define BF_I2S_PIN_NUM_MASK ( 0xFF ) -#define I2S_PIN_NUM_BF_I2S_PIN_NUM_SHIFT ( 0 ) -#define I2S_PIN_NUM_BF_I2S_PIN_NUM_MASK ( BF_I2S_PIN_NUM_MASK << I2S_PIN_NUM_BF_I2S_PIN_NUM_SHIFT ) - -/* FW_REG_TX_PING_PONG_SEL */ -#define BF_TX_PING_PONG_SEL_MASK ( 0x1 ) -#define TX_PING_PONG_SEL_BF_TX_PING_PONG_SEL_SHIFT ( 0 ) -#define TX_PING_PONG_SEL_BF_TX_PING_PONG_SEL_MASK ( BF_TX_PING_PONG_SEL_MASK << TX_PING_PONG_SEL_BF_TX_PING_PONG_SEL_SHIFT) - -/* FW_REG_RX_PING_PONG_SEL */ -#define BF_RX_PING_PONG_SEL_MASK ( 0x1 ) -#define RX_PING_PONG_SEL_BF_RX_PING_PONG_SEL_SHIFT ( 0 ) -#define RX_PING_PONG_SEL_BF_RX_PING_PONG_SEL_MASK ( BF_RX_PING_PONG_SEL_MASK << RX_PING_PONG_SEL_BF_RX_PING_PONG_SEL_SHIFT) - -/* FW_REG_TX_PING_PONG_STAT */ -#define BF_TX_PING_PONG_STAT_MASK ( 0x1 ) -#define TX_PING_PONG_STAT_BF_TX_PING_STAT_SHIFT ( 0 ) -#define TX_PING_PONG_STAT_BF_TX_PONG_STAT_SHIFT ( 1 ) -#define TX_PING_PONG_STAT_BF_TX_PING_STAT_MASK ( BF_TX_PING_PONG_STAT_MASK << TX_PING_PONG_STAT_BF_TX_PING_STAT_SHIFT ) -#define TX_PING_PONG_STAT_BF_TX_PONG_STAT_MASK ( BF_TX_PING_PONG_STAT_MASK << TX_PING_PONG_STAT_BF_TX_PONG_STAT_SHIFT ) - -/* FW_REG_RX_PING_PONG_STAT */ -#define BF_RX_PING_PONG_STAT_MASK ( 0x1 ) -#define RX_PING_PONG_STAT_BF_RX_PING_STAT_SHIFT ( 0 ) -#define RX_PING_PONG_STAT_BF_RX_PONG_STAT_SHIFT ( 1 ) -#define RX_PING_PONG_STAT_BF_RX_PING_STAT_MASK ( BF_RX_PING_PONG_STAT_MASK << RX_PING_PONG_STAT_BF_RX_PING_STAT_SHIFT ) -#define RX_PING_PONG_STAT_BF_RX_PONG_STAT_MASK ( BF_RX_PING_PONG_STAT_MASK << RX_PING_PONG_STAT_BF_RX_PONG_STAT_SHIFT ) - -/* FW_REG_ERR_STAT */ -#define BF_OVR_ERR_STAT_MASK ( 0x1 ) -#define BF_UND_ERR_STAT_MASK ( 0x1 ) -#define BF_FSYNC_ERR_STAT_MASK ( 0x1 ) -#define ERR_STAT_BF_OVR_ERR_STAT_SHIFT ( 0 ) -#define ERR_STAT_BF_UND_ERR_STAT_SHIFT ( 1 ) -#define ERR_STAT_BF_FSYNC_ERR_STAT_SHIFT ( 2 ) -#define ERR_STAT_BF_BF_OVR_ERR_STAT_MASK ( BF_OVR_ERR_STAT_MASK << ERR_STAT_BF_OVR_ERR_STAT_SHIFT ) -#define ERR_STAT_BF_BF_UND_ERR_STAT_MASK ( BF_UND_ERR_STAT_MASK << ERR_STAT_BF_UND_ERR_STAT_SHIFT ) -#define ERR_STAT_BF_BF_FSYNC_ERR_STAT_MASK ( BF_FSYNC_ERR_STAT_MASK << ERR_STAT_BF_FSYNC_ERR_STAT_SHIFT ) - -#define PING_PONG_SEL_PING ( 0 ) -#define PING_PONG_SEL_PONG ( 1 ) - -#endif /* _ICSS_PRUI2S_FW_H_ */ diff --git a/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec index ce30871d4..64f95e80b 100644 --- a/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec @@ -34,6 +34,7 @@ -I${OPEN_PRU_PATH}/source -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s + -I${OPEN_PRU_PATH}/source/i2s -DPRU0 -DSLICE0 -v4 @@ -83,7 +84,7 @@ - + diff --git a/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile index 773e30033..c6c9528ac 100644 --- a/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -31,6 +31,7 @@ include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for I2S firmware headers INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s +INCLUDE += --include_path=$(OPEN_PRU_PATH)/source/i2s # Defines: PRU0, I2S Tx, 3 Tx channels, underflow detection DFLAGS := \ diff --git a/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec index f7b50e0b3..5d80a50dc 100644 --- a/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec @@ -34,6 +34,7 @@ -I${OPEN_PRU_PATH}/source -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s + -I${OPEN_PRU_PATH}/source/i2s -DPRU0 -DSLICE0 -v4 @@ -83,7 +84,7 @@ - + diff --git a/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile index 6c17510c0..3828864af 100644 --- a/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -30,6 +30,7 @@ include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for I2S firmware headers INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s +INCLUDE += --include_path=$(OPEN_PRU_PATH)/source/i2s # Defines: PRU0, I2S Tx, 3 Tx channels, underflow detection DFLAGS := \ diff --git a/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec index 90eb7203b..181f418d9 100644 --- a/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec @@ -34,6 +34,7 @@ -I${OPEN_PRU_PATH}/source -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s + -I${OPEN_PRU_PATH}/source/i2s -DPRU1 -DSLICE1 -v4 @@ -82,7 +83,7 @@ - + diff --git a/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile index 941b31e28..3471608c1 100644 --- a/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -30,6 +30,7 @@ include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for I2S firmware headers INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s +INCLUDE += --include_path=$(OPEN_PRU_PATH)/source/i2s # Defines: PRU1, I2S Rx, overflow detection DFLAGS := \ diff --git a/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec index dd18868ba..88094e9c6 100644 --- a/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec @@ -34,6 +34,7 @@ -I${OPEN_PRU_PATH}/source -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s + -I${OPEN_PRU_PATH}/source/i2s -DPRU1 -DSLICE1 -v4 @@ -82,7 +83,7 @@ - + diff --git a/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile index 01a4c766a..03af15e8b 100644 --- a/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -30,6 +30,7 @@ include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for I2S firmware headers INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s +INCLUDE += --include_path=$(OPEN_PRU_PATH)/source/i2s # Defines: PRU1, I2S Rx, overflow detection DFLAGS := \ diff --git a/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec index 7bc547fdd..845f51661 100644 --- a/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec @@ -34,6 +34,7 @@ -I${OPEN_PRU_PATH}/source -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 + -I${OPEN_PRU_PATH}/source/i2s -DPRU0 -DSLICE0 -v4 @@ -81,7 +82,7 @@ - + diff --git a/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile index 1764c51ac..ec83d9598 100644 --- a/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -30,6 +30,7 @@ include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for TDM4 firmware headers INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4 +INCLUDE += --include_path=$(OPEN_PRU_PATH)/source/i2s # Defines: PRU0, I2S Tx, 3 Tx channels, underflow detection DFLAGS := \ diff --git a/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec index 071689742..a98478eb9 100644 --- a/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec @@ -34,6 +34,7 @@ -I${OPEN_PRU_PATH}/source -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 + -I${OPEN_PRU_PATH}/source/i2s -DPRU0 -DSLICE0 -v4 @@ -81,7 +82,7 @@ - + diff --git a/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile index 75057172a..aa306d25c 100644 --- a/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -30,6 +30,7 @@ include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for TDM4 firmware headers INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4 +INCLUDE += --include_path=$(OPEN_PRU_PATH)/source/i2s # Defines: PRU0, I2S Tx, 3 Tx channels, underflow detection DFLAGS := \ diff --git a/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec index 0f3dd3bdc..3221f9f65 100644 --- a/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec @@ -34,6 +34,7 @@ -I${OPEN_PRU_PATH}/source -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 + -I${OPEN_PRU_PATH}/source/i2s -DPRU1 -DSLICE1 -v4 @@ -80,7 +81,7 @@ - + diff --git a/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile index 7ce91505e..48530d3a7 100644 --- a/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -30,6 +30,7 @@ include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for TDM4 firmware headers INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4 +INCLUDE += --include_path=$(OPEN_PRU_PATH)/source/i2s # Defines: PRU1, I2S Rx, overflow detection DFLAGS := \ diff --git a/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec index c44f0b28e..1785098a0 100644 --- a/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec @@ -34,6 +34,7 @@ -I${OPEN_PRU_PATH}/source -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 + -I${OPEN_PRU_PATH}/source/i2s -DPRU1 -DSLICE1 -v4 @@ -80,7 +81,7 @@ - + diff --git a/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile index 0c2178d8b..c34d11ff2 100644 --- a/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -30,6 +30,7 @@ include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for TDM4 firmware headers INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4 +INCLUDE += --include_path=$(OPEN_PRU_PATH)/source/i2s # Defines: PRU1, I2S Rx, overflow detection DFLAGS := \ diff --git a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec index 4aecc7f33..6b58a067e 100644 --- a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -63,7 +63,7 @@ -i${MCU_PLUS_SDK_PATH}/source/drivers/lib -i${MCU_PLUS_SDK_PATH}/source/board/lib -i${MCU_PLUS_SDK_PATH}/source/pru_io/lib - -i${OPEN_PRU_PATH}/examples/pru_i2s/lib + -i${OPEN_PRU_PATH}/source/i2s/lib -i${CG_TOOL_ROOT}/lib -m=pru_i2s_app.${ConfigName}.map --diag_suppress=10063 diff --git a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile index 58049da00..5927831c2 100644 --- a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile @@ -110,7 +110,7 @@ LIBS_PATH_common = \ -Wl,-i${MCU_PLUS_SDK_PATH}/source/drivers/lib \ -Wl,-i${MCU_PLUS_SDK_PATH}/source/board/lib \ -Wl,-i${MCU_PLUS_SDK_PATH}/source/pru_io/lib \ - -Wl,-i${OPEN_PRU_PATH}/examples/pru_i2s/lib \ + -Wl,-i${OPEN_PRU_PATH}/source/i2s/lib \ -Wl,-i${CG_TOOL_ROOT}/lib \ LIBS_common = \ @@ -141,7 +141,7 @@ LIBS_PATH_NAME = \ ${MCU_PLUS_SDK_PATH}/source/drivers/lib \ ${MCU_PLUS_SDK_PATH}/source/board/lib \ ${MCU_PLUS_SDK_PATH}/source/pru_io/lib \ - ${OPEN_PRU_PATH}/examples/pru_i2s/lib \ + ${OPEN_PRU_PATH}/source/i2s/lib \ ${CG_TOOL_ROOT}/lib \ FILES := $(FILES_common) $(FILES_$(PROFILE)) diff --git a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec index bf8304c21..55a583143 100644 --- a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -63,7 +63,7 @@ -i${MCU_PLUS_SDK_PATH}/source/drivers/lib -i${MCU_PLUS_SDK_PATH}/source/board/lib -i${MCU_PLUS_SDK_PATH}/source/pru_io/lib - -i${OPEN_PRU_PATH}/examples/pru_i2s/lib + -i${OPEN_PRU_PATH}/source/i2s/lib -i${CG_TOOL_ROOT}/lib -m=pru_i2s_app.${ConfigName}.map --diag_suppress=10063 diff --git a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile index 38c624d21..ec6a97a2c 100644 --- a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile @@ -112,7 +112,7 @@ LIBS_PATH_common = \ -Wl,-i${MCU_PLUS_SDK_PATH}/source/drivers/lib \ -Wl,-i${MCU_PLUS_SDK_PATH}/source/board/lib \ -Wl,-i${MCU_PLUS_SDK_PATH}/source/pru_io/lib \ - -Wl,-i${OPEN_PRU_PATH}/examples/pru_i2s/lib \ + -Wl,-i${OPEN_PRU_PATH}/source/i2s/lib \ -Wl,-i${CG_TOOL_ROOT}/lib \ LIBS_common = \ @@ -143,7 +143,7 @@ LIBS_PATH_NAME = \ ${MCU_PLUS_SDK_PATH}/source/drivers/lib \ ${MCU_PLUS_SDK_PATH}/source/board/lib \ ${MCU_PLUS_SDK_PATH}/source/pru_io/lib \ - ${OPEN_PRU_PATH}/examples/pru_i2s/lib \ + ${OPEN_PRU_PATH}/source/i2s/lib \ ${CG_TOOL_ROOT}/lib \ FILES := $(FILES_common) $(FILES_$(PROFILE)) diff --git a/examples/pru_i2s/firmware/tdm4/icss_pru_i2s_fw.h b/source/i2s/icss_pru_i2s_fw.h similarity index 100% rename from examples/pru_i2s/firmware/tdm4/icss_pru_i2s_fw.h rename to source/i2s/icss_pru_i2s_fw.h diff --git a/source/i2s/makefile b/source/i2s/makefile index e02f41547..f26fa9e30 100644 --- a/source/i2s/makefile +++ b/source/i2s/makefile @@ -35,14 +35,12 @@ INCLUDES_common := \ -I$(MCU_PLUS_SDK_PATH)/source \ -I$(OPEN_PRU_PATH)/source \ -I$(OPEN_PRU_PATH)/source/i2s \ - -I$(OPEN_PRU_PATH)/examples/pru_i2s/firmware \ - -I$(OPEN_PRU_PATH)/examples \ -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/FreeRTOS-Kernel/include \ -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F # Default library profile is Release (uppercase) so library names match linker refs PROFILE?=Release -GEN_DIR := $(OPEN_PRU_PATH)/examples/pru_i2s/lib +GEN_DIR := $(OPEN_PRU_PATH)/source/i2s/lib # Only build if MCU+ SDK is available ifeq ($(BUILD_MCUPLUS),y) diff --git a/source/i2s/pru_i2s_drv.c b/source/i2s/pru_i2s_drv.c index d8aa19210..37b387f6e 100644 --- a/source/i2s/pru_i2s_drv.c +++ b/source/i2s/pru_i2s_drv.c @@ -36,7 +36,7 @@ #include #include "pru_i2s_drv.h" -#include +#include "icss_pru_i2s_fw.h" /* Application calls PRUICSS_intcInit() directly (Motor Control SDK pattern) */ diff --git a/source/i2s/pru_i2s_drv.h b/source/i2s/pru_i2s_drv.h index e74050316..e31eee697 100644 --- a/source/i2s/pru_i2s_drv.h +++ b/source/i2s/pru_i2s_drv.h @@ -46,7 +46,7 @@ #include #include #include -#include "tdm4/icss_pru_i2s_fw.h" +#include "icss_pru_i2s_fw.h" /* Number of ICSS instances */ #define PRUI2S_NUM_ICSS_INST ( 2 ) /* Number of PRU instances per ICSS */ From 09ce8a58659ba91f8f9d1b6c753ee21335196058 Mon Sep 17 00:00:00 2001 From: Ayushman Date: Thu, 19 Nov 2026 15:00:28 +0530 Subject: [PATCH 06/10] pru_i2s: keep app config in the example and use -v3 - move pru_i2s_app_config.{c,h} from source/i2s back into examples/pru_i2s/pru_i2s_app; it is example configuration, so it is no longer compiled into the driver library. The app makefiles and projectspecs now build it - source/i2s/pru_i2s_drv.h: drop the PRUI2S_applyAppConfig() declaration, the function is defined by the example and not by the library - PRU_VERSION 4 -> 3 in the 8 firmware makefiles, -v4 -> -v3 in the 8 firmware projectspecs and the README note (PRU-ICSS, as in examples/empty) - README: remove the "gitignored" wording for the generated array headers - remove the unused examples/pru_i2s/firmware/include path (directory does not exist) from the 8 firmware makefiles and projectspecs - README: drop the "Build only firmware" block; no other example documents `make pru`, and the full build is `make` from examples/pru_i2s Signed-off-by: Ayushman --- examples/pru_i2s/README.md | 12 +++--------- .../ti-pru-cgt/example.projectspec | 3 +-- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 3 +-- .../ti-pru-cgt/example.projectspec | 3 +-- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 3 +-- .../ti-pru-cgt/example.projectspec | 3 +-- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 3 +-- .../ti-pru-cgt/example.projectspec | 3 +-- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 3 +-- .../ti-pru-cgt/example.projectspec | 3 +-- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 3 +-- .../ti-pru-cgt/example.projectspec | 3 +-- .../icssm0-pru0_fw/ti-pru-cgt/makefile | 3 +-- .../ti-pru-cgt/example.projectspec | 3 +-- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 3 +-- .../ti-pru-cgt/example.projectspec | 3 +-- .../icssm0-pru1_fw/ti-pru-cgt/makefile | 3 +-- .../ti-arm-clang/example.projectspec | 2 ++ .../r5fss0-0_freertos/ti-arm-clang/makefile | 1 + .../ti-arm-clang/example.projectspec | 2 ++ .../r5fss0-0_freertos/ti-arm-clang/makefile | 1 + .../pru_i2s/pru_i2s_app}/pru_i2s_app_config.c | 0 .../pru_i2s/pru_i2s_app}/pru_i2s_app_config.h | 0 source/i2s/makefile | 18 ++---------------- source/i2s/pru_i2s_drv.h | 10 ---------- 25 files changed, 27 insertions(+), 67 deletions(-) rename {source/i2s => examples/pru_i2s/pru_i2s_app}/pru_i2s_app_config.c (100%) rename {source/i2s => examples/pru_i2s/pru_i2s_app}/pru_i2s_app_config.h (100%) diff --git a/examples/pru_i2s/README.md b/examples/pru_i2s/README.md index 524c60069..e45b05d5a 100644 --- a/examples/pru_i2s/README.md +++ b/examples/pru_i2s/README.md @@ -168,7 +168,7 @@ pru_i2s/ │ │ ├── linker.cmd # Linker script │ │ ├── pru_i2s_interface.h # Interface definitions │ │ ├── pru_i2s_regs.h # Hardware registers -│ │ ├── pru_i2s_pru0/1_array.h # Generated firmware array headers (build output, gitignored) +│ │ ├── pru_i2s_pru0/1_array.h # Generated firmware array headers (build output) │ │ ├── pru0_tx/ # TX firmware builds │ │ │ ├── am261x-lp/ # AM261x variant │ │ │ └── am263x-cc/ # AM263x variant @@ -205,12 +205,6 @@ make DEVICE=am261x # Build for AM261x make DEVICE=am263x # Build for AM263x ``` -**Build only firmware:** -```bash -cd examples/pru_i2s -make pru DEVICE=am261x # Builds 4 firmware variants (I2S + TDM4, PRU0 + PRU1) -``` - **Clean:** ```bash make DEVICE=am261x clean @@ -218,11 +212,11 @@ make DEVICE=am261x clean **What gets built:** - 4 PRU firmware binaries per device (I2S PRU0 TX, I2S PRU1 RX, TDM4 PRU0 TX, TDM4 PRU1 RX) -- Firmware header arrays (`.h` files) copied into `firmware/i2s/` and `firmware/tdm4/` (gitignored) +- Firmware header arrays (`.h` files) copied into `firmware/i2s/` and `firmware/tdm4/` - PRU I2S driver library (`source/i2s/lib/pru_i2s.*.lib`) built from `source/i2s/makefile` - R5F application binary (`.out` and `.mcelf`) -**Note:** The PRU firmware makefiles use `pru_rules.mak` (silicon version `-v4`) and place all build artifacts in a `ti-pru-cgt/generated/` subdirectory. The library build is owned by `source/i2s/makefile` and is invoked automatically by the top-level `makefile`. +**Note:** The PRU firmware makefiles use `pru_rules.mak` (silicon version `-v3`) and place all build artifacts in a `ti-pru-cgt/generated/` subdirectory. The library build is owned by `source/i2s/makefile` and is invoked automatically by the top-level `makefile`. ### Building with Code Composer Studio diff --git a/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec index 64f95e80b..f79082788 100644 --- a/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec @@ -32,12 +32,11 @@ -I${CG_TOOL_ROOT}/include -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s -I${OPEN_PRU_PATH}/source/i2s -DPRU0 -DSLICE0 - -v4 + -v3 -DSOC_AM261X -DPRU0 -DI2S_TX diff --git a/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile index c6c9528ac..bccbbe501 100644 --- a/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -20,7 +20,7 @@ FILES_PATH := ../../../../ COMMAND_FILES := linker.cmd # Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) -PRU_VERSION := 4 +PRU_VERSION := 3 EXPECTED_DEVICE := am261x @@ -29,7 +29,6 @@ EXPECTED_DEVICE := am261x include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for I2S firmware headers -INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s INCLUDE += --include_path=$(OPEN_PRU_PATH)/source/i2s diff --git a/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec index 5d80a50dc..741cabef8 100644 --- a/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec @@ -32,12 +32,11 @@ -I${CG_TOOL_ROOT}/include -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s -I${OPEN_PRU_PATH}/source/i2s -DPRU0 -DSLICE0 - -v4 + -v3 -DSOC_AM263X -DPRU0 -DI2S_TX diff --git a/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile index 3828864af..32dd2849f 100644 --- a/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -20,7 +20,7 @@ FILES_PATH := ../../../../ COMMAND_FILES := linker.cmd # Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) -PRU_VERSION := 4 +PRU_VERSION := 3 EXPECTED_DEVICE := am263x @@ -28,7 +28,6 @@ EXPECTED_DEVICE := am263x include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for I2S firmware headers -INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s INCLUDE += --include_path=$(OPEN_PRU_PATH)/source/i2s diff --git a/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec index 181f418d9..aa98380b5 100644 --- a/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec @@ -32,12 +32,11 @@ -I${CG_TOOL_ROOT}/include -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s -I${OPEN_PRU_PATH}/source/i2s -DPRU1 -DSLICE1 - -v4 + -v3 -DSOC_AM261X -DPRU1 -DI2S_RX diff --git a/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile index 3471608c1..85ce5aed3 100644 --- a/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -20,7 +20,7 @@ FILES_PATH := ../../../../ COMMAND_FILES := linker.cmd # Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) -PRU_VERSION := 4 +PRU_VERSION := 3 EXPECTED_DEVICE := am261x @@ -28,7 +28,6 @@ EXPECTED_DEVICE := am261x include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for I2S firmware headers -INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s INCLUDE += --include_path=$(OPEN_PRU_PATH)/source/i2s diff --git a/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec index 88094e9c6..8133a3867 100644 --- a/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec @@ -32,12 +32,11 @@ -I${CG_TOOL_ROOT}/include -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s -I${OPEN_PRU_PATH}/source/i2s -DPRU1 -DSLICE1 - -v4 + -v3 -DSOC_AM263X -DPRU1 -DI2S_RX diff --git a/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile index 03af15e8b..3c728e803 100644 --- a/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -20,7 +20,7 @@ FILES_PATH := ../../../../ COMMAND_FILES := linker.cmd # Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) -PRU_VERSION := 4 +PRU_VERSION := 3 EXPECTED_DEVICE := am263x @@ -28,7 +28,6 @@ EXPECTED_DEVICE := am263x include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for I2S firmware headers -INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s INCLUDE += --include_path=$(OPEN_PRU_PATH)/source/i2s diff --git a/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec index 845f51661..6a5a082cb 100644 --- a/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/example.projectspec @@ -32,12 +32,11 @@ -I${CG_TOOL_ROOT}/include -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 -I${OPEN_PRU_PATH}/source/i2s -DPRU0 -DSLICE0 - -v4 + -v3 -DSOC_AM261X -DPRU0 -DI2S_TX diff --git a/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile index ec83d9598..21abd078d 100644 --- a/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -20,7 +20,7 @@ FILES_PATH := ../../../../ COMMAND_FILES := linker.cmd # Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) -PRU_VERSION := 4 +PRU_VERSION := 3 EXPECTED_DEVICE := am261x @@ -28,7 +28,6 @@ EXPECTED_DEVICE := am261x include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for TDM4 firmware headers -INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4 INCLUDE += --include_path=$(OPEN_PRU_PATH)/source/i2s diff --git a/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec index a98478eb9..ede88b7ce 100644 --- a/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/example.projectspec @@ -32,12 +32,11 @@ -I${CG_TOOL_ROOT}/include -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 -I${OPEN_PRU_PATH}/source/i2s -DPRU0 -DSLICE0 - -v4 + -v3 -DSOC_AM263X -DPRU0 -DI2S_TX diff --git a/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile index aa306d25c..9f96c7e9e 100644 --- a/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -20,7 +20,7 @@ FILES_PATH := ../../../../ COMMAND_FILES := linker.cmd # Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) -PRU_VERSION := 4 +PRU_VERSION := 3 EXPECTED_DEVICE := am263x @@ -28,7 +28,6 @@ EXPECTED_DEVICE := am263x include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for TDM4 firmware headers -INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4 INCLUDE += --include_path=$(OPEN_PRU_PATH)/source/i2s diff --git a/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec index 3221f9f65..3433f964a 100644 --- a/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/example.projectspec @@ -32,12 +32,11 @@ -I${CG_TOOL_ROOT}/include -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 -I${OPEN_PRU_PATH}/source/i2s -DPRU1 -DSLICE1 - -v4 + -v3 -DSOC_AM261X -DPRU1 -DI2S_RX diff --git a/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile index 48530d3a7..552bad877 100644 --- a/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -20,7 +20,7 @@ FILES_PATH := ../../../../ COMMAND_FILES := linker.cmd # Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) -PRU_VERSION := 4 +PRU_VERSION := 3 EXPECTED_DEVICE := am261x @@ -28,7 +28,6 @@ EXPECTED_DEVICE := am261x include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for TDM4 firmware headers -INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4 INCLUDE += --include_path=$(OPEN_PRU_PATH)/source/i2s diff --git a/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec index 1785098a0..caf478571 100644 --- a/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec +++ b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/example.projectspec @@ -32,12 +32,11 @@ -I${CG_TOOL_ROOT}/include -I${MCU_PLUS_SDK_PATH}/source -I${OPEN_PRU_PATH}/source - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/include -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 -I${OPEN_PRU_PATH}/source/i2s -DPRU1 -DSLICE1 - -v4 + -v3 -DSOC_AM263X -DPRU1 -DI2S_RX diff --git a/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile index c34d11ff2..21f033761 100644 --- a/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -20,7 +20,7 @@ FILES_PATH := ../../../../ COMMAND_FILES := linker.cmd # Silicon version (3: PRUSS, PRU-ICSS; 4: PRU_ICSSG) -PRU_VERSION := 4 +PRU_VERSION := 3 EXPECTED_DEVICE := am263x @@ -28,7 +28,6 @@ EXPECTED_DEVICE := am263x include $(OPEN_PRU_PATH)/pru_rules.mak # Additional include paths for TDM4 firmware headers -INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/include INCLUDE += --include_path=$(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4 INCLUDE += --include_path=$(OPEN_PRU_PATH)/source/i2s diff --git a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec index 6b58a067e..e28b4106a 100644 --- a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -110,6 +110,8 @@ > + + diff --git a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile index 5927831c2..2c2d87629 100644 --- a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile @@ -39,6 +39,7 @@ endif FILES_common := \ pru_i2s_diagnostic.c \ + pru_i2s_app_config.c \ main.c \ ti_drivers_config.c \ ti_drivers_open_close.c \ diff --git a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec index 55a583143..ba973b8d6 100644 --- a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -110,6 +110,8 @@ > + + diff --git a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile index ec6a97a2c..3b43367e9 100644 --- a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile @@ -39,6 +39,7 @@ endif FILES_common := \ pru_i2s_diagnostic.c \ + pru_i2s_app_config.c \ main.c \ ti_drivers_config.c \ ti_drivers_open_close.c \ diff --git a/source/i2s/pru_i2s_app_config.c b/examples/pru_i2s/pru_i2s_app/pru_i2s_app_config.c similarity index 100% rename from source/i2s/pru_i2s_app_config.c rename to examples/pru_i2s/pru_i2s_app/pru_i2s_app_config.c diff --git a/source/i2s/pru_i2s_app_config.h b/examples/pru_i2s/pru_i2s_app/pru_i2s_app_config.h similarity index 100% rename from source/i2s/pru_i2s_app_config.h rename to examples/pru_i2s/pru_i2s_app/pru_i2s_app_config.h diff --git a/source/i2s/makefile b/source/i2s/makefile index f26fa9e30..17a834c47 100644 --- a/source/i2s/makefile +++ b/source/i2s/makefile @@ -55,16 +55,9 @@ build_am261x: -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/config/am261x/r5f \ -DSOC_AM261X -DOS_FREERTOS \ -o $(GEN_DIR)/pru_i2s_drv_am261x.obj pru_i2s_drv.c - $(CC) -c $(CFLAGS_common) \ - $(INCLUDES_common) \ - -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/config/am261x/r5f \ - -DSOC_AM261X -DOS_FREERTOS \ - -o $(GEN_DIR)/pru_i2s_app_config_am261x.obj pru_i2s_app_config.c $(AR) rc $(GEN_DIR)/pru_i2s.am261x.r5f.ti-arm-clang.$(PROFILE).lib \ - $(GEN_DIR)/pru_i2s_drv_am261x.obj \ - $(GEN_DIR)/pru_i2s_app_config_am261x.obj + $(GEN_DIR)/pru_i2s_drv_am261x.obj $(RM) $(GEN_DIR)/pru_i2s_drv_am261x.obj - $(RM) $(GEN_DIR)/pru_i2s_app_config_am261x.obj @echo "Library build complete." build_am263x: @@ -75,16 +68,9 @@ build_am263x: -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/config/am263x/r5f \ -DSOC_AM263X -DOS_FREERTOS \ -o $(GEN_DIR)/pru_i2s_drv_am263x.obj pru_i2s_drv.c - $(CC) -c $(CFLAGS_common) \ - $(INCLUDES_common) \ - -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/config/am263x/r5f \ - -DSOC_AM263X -DOS_FREERTOS \ - -o $(GEN_DIR)/pru_i2s_app_config_am263x.obj pru_i2s_app_config.c $(AR) rc $(GEN_DIR)/pru_i2s.am263x.r5f.ti-arm-clang.$(PROFILE).lib \ - $(GEN_DIR)/pru_i2s_drv_am263x.obj \ - $(GEN_DIR)/pru_i2s_app_config_am263x.obj + $(GEN_DIR)/pru_i2s_drv_am263x.obj $(RM) $(GEN_DIR)/pru_i2s_drv_am263x.obj - $(RM) $(GEN_DIR)/pru_i2s_app_config_am263x.obj @echo "Library build complete." clean: diff --git a/source/i2s/pru_i2s_drv.h b/source/i2s/pru_i2s_drv.h index e31eee697..370fc8f89 100644 --- a/source/i2s/pru_i2s_drv.h +++ b/source/i2s/pru_i2s_drv.h @@ -330,16 +330,6 @@ int32_t PRUI2S_setUserConfig( uint8_t pruInstId ); -/** - * \brief Apply PRU I2S application configuration - * - * This function applies the user configuration to the PRU I2S driver. - * It must be called before PRUI2S_init(). - * - * \return 0 on success, negative error code on failure - */ -int32_t PRUI2S_applyAppConfig(void); - /* * Get PRUI2S SW IP attributes for use in application, e.g. * - # Tx I2S From 9d51d0d8830b6e4580dd6b80b0e722d0ec434011 Mon Sep 17 00:00:00 2001 From: Ayushman Date: Thu, 26 Nov 2026 12:35:09 +0530 Subject: [PATCH 07/10] pru_i2s: build the driver library with a separate libs target The example no longer builds or cleans the driver library as part of its own build. The library has its own targets, like the MCU+ SDK libraries. - add "libs" and "libs-clean" to examples/pru_i2s/makefile. "clean" no longer removes the library - the library output belongs to the example: examples/pru_i2s/lib. The output directory of source/i2s/makefile is now overridable (GEN_DIR ?=) - the application only links the existing library. If it is missing, the build stops with a message to run "make libs" - remove the library rebuild rule from the application makefiles and the library preBuildStep from the application projectspecs - library names are lowercase (debug/release) like the MCU+ SDK library names, in the makefile and the projectspecs - delete the archive of the profile being built before running ar, so a rebuild cannot keep stale members. The temporary object file name includes the profile, so a debug and a release build do not collide - README: build the library first, rebuild after driver changes, libs-clean Signed-off-by: Ayushman --- examples/pru_i2s/README.md | 32 ++++++++++++++----- examples/pru_i2s/makefile | 32 ++++++++++++------- .../ti-arm-clang/example.projectspec | 8 ++--- .../r5fss0-0_freertos/ti-arm-clang/makefile | 16 ++++------ .../ti-arm-clang/example.projectspec | 8 ++--- .../r5fss0-0_freertos/ti-arm-clang/makefile | 16 ++++------ source/i2s/makefile | 24 +++++++------- 7 files changed, 77 insertions(+), 59 deletions(-) diff --git a/examples/pru_i2s/README.md b/examples/pru_i2s/README.md index e45b05d5a..660d56516 100644 --- a/examples/pru_i2s/README.md +++ b/examples/pru_i2s/README.md @@ -185,6 +185,7 @@ pru_i2s/ │ ├── data.h # Test data │ ├── am261x-lp/r5fss0-0_freertos/ │ └── am263x-cc/r5fss0-0_freertos/ +├── lib/ # Driver library (build output of make libs, not checked in) └── images/ # Documentation images ``` @@ -198,25 +199,39 @@ pru_i2s/ - Set `DEVICE` environment variable in `imports.mak` - Ensure CCS utils are in PATH (for gmake on Windows) -**Build all firmware and application:** +**Build the driver library, then the firmware and application:** ```bash cd examples/pru_i2s -make DEVICE=am261x # Build for AM261x -make DEVICE=am263x # Build for AM263x +make DEVICE=am261x libs # Build the driver library for AM261x +make DEVICE=am261x # Build the firmware and application for AM261x +make DEVICE=am263x libs # Build the driver library for AM263x +make DEVICE=am263x # Build the firmware and application for AM263x ``` +The driver library is built separately from the application. The application +only links the existing library, and stops with an error if the library is +missing. Run `make libs` first on a fresh clone, and again after any change to +the driver source in `source/i2s/`. Library files are not checked in. Building +from the root of the repository with `make` also builds the library first. + +Use `make libs PROFILE=debug` to build the debug library for a debug build of the +application. The default is `release`, set `PROFILE` in `imports.mak`. + **Clean:** ```bash -make DEVICE=am261x clean +make DEVICE=am261x clean # Clean the firmware and application +make DEVICE=am261x libs-clean # Clean the driver library ``` +`clean` does not remove the driver library. Use `libs-clean` for that. + **What gets built:** - 4 PRU firmware binaries per device (I2S PRU0 TX, I2S PRU1 RX, TDM4 PRU0 TX, TDM4 PRU1 RX) - Firmware header arrays (`.h` files) copied into `firmware/i2s/` and `firmware/tdm4/` -- PRU I2S driver library (`source/i2s/lib/pru_i2s.*.lib`) built from `source/i2s/makefile` +- PRU I2S driver library (`lib/pru_i2s..r5f.ti-arm-clang..lib`), built by `make libs` from the driver source in `source/i2s/` - R5F application binary (`.out` and `.mcelf`) -**Note:** The PRU firmware makefiles use `pru_rules.mak` (silicon version `-v3`) and place all build artifacts in a `ti-pru-cgt/generated/` subdirectory. The library build is owned by `source/i2s/makefile` and is invoked automatically by the top-level `makefile`. +**Note:** The PRU firmware makefiles use `pru_rules.mak` (silicon version `-v3`) and place all build artifacts in a `ti-pru-cgt/generated/` subdirectory. The driver source is in `source/i2s/`, and its library output belongs to this example in `examples/pru_i2s/lib/`. ### Building with Code Composer Studio @@ -233,8 +248,9 @@ make DEVICE=am261x clean 2. Import `example.projectspec` **Build Order:** -1. Build PRU firmware first (generates header arrays) -2. Build R5F application (includes firmware headers) +1. Build the driver library (`make DEVICE= libs` in `examples/pru_i2s`). CCS does not build it. Rebuild it after any change to `source/i2s/`. Build `PROFILE=debug` for the Debug configuration, the default is `release` +2. Build PRU firmware (generates header arrays) +3. Build R5F application (includes firmware headers, links the driver library from `examples/pru_i2s/lib/`) **Debug Configuration:** Refer to MCU+ SDK documentation: diff --git a/examples/pru_i2s/makefile b/examples/pru_i2s/makefile index 7e5f5a500..24d1ee47c 100644 --- a/examples/pru_i2s/makefile +++ b/examples/pru_i2s/makefile @@ -10,6 +10,8 @@ SUPPORTED_PROCESSORS := am261x am263x # Profile used when naming the built pru_i2s driver library, must match the # ConfigName the R5F application makefiles link against (see PROFILE there). PROFILE?=release +# The driver library is built from source/i2s, its output belongs to this project +LIB_DIR := $(CURDIR)/lib # Does the PRU code have dependencies outside of the open-pru repo? PRU_DEPENDENCIES := mcuplus # Use NON_PRU_DEPENDENCIES to select which makefiles to call for non-PRU cores @@ -72,27 +74,33 @@ pru: ARGUMENTS_PRU = all pru: MESSAGE = "Building $(PROJECT_NAME) PRU firmware" pru: pre_build_message $(DEVICE) -# "make host" builds PRU firmware, then the driver library, then host (R5F) code -# for $(DEVICE). The steps are recipe lines so they stay in order under "make -j": -# the host code includes the PRU firmware headers, and links the library. +# "make host" builds PRU firmware, then host (R5F) code for $(DEVICE). The steps +# are recipe lines so they stay in order under "make -j": the host code includes +# the PRU firmware headers. The host code links the driver library, which is not +# built here: run "make libs" first. host: MESSAGE = "Building $(PROJECT_NAME) host code for $(DEVICE)" host: pre_build_message $(MAKE) pru - $(MAKE) build_lib_$(DEVICE) $(MAKE) $(DEVICE_NON_PRU) ARGUMENTS_MCUPLUS=all +# "make libs" builds the driver library for $(DEVICE) into $(LIB_DIR) +libs: MESSAGE = "Building $(PROJECT_NAME) driver library for $(DEVICE)" +libs: pre_build_message build_lib_$(DEVICE) + +# "make libs-clean" removes the driver library, "make clean" does not +libs-clean: MESSAGE = "Cleaning $(PROJECT_NAME) driver library" +libs-clean: pre_build_message + $(MAKE) -C ../../source/i2s clean GEN_DIR=$(LIB_DIR) + # "make clean" cleans projects that match $(DEVICE) set in imports.mak clean: ARGUMENTS_PRU = clean clean: ARGUMENTS_MCUPLUS = scrub clean: MESSAGE = "Cleaning $(PROJECT_NAME) for $(DEVICE)" -clean: pre_build_message $(DEVICE) $(DEVICE_NON_PRU) clean_lib - -clean_lib: - $(MAKE) -C ../../source/i2s clean +clean: pre_build_message $(DEVICE) $(DEVICE_NON_PRU) else # if a prebuild check failed, print message and exit -all clean pru host: pre_build_message +all clean pru host libs libs-clean: pre_build_message endif pre_build_message: @@ -118,7 +126,7 @@ am261x_mcuplus: build_lib_am261x: # am261x-lp - Build driver library - $(MAKE) -C ../../source/i2s build_am261x PROFILE=$(PROFILE) + $(MAKE) -C ../../source/i2s build_am261x PROFILE=$(PROFILE) GEN_DIR=$(LIB_DIR) am263x: # am263x-cc - I2S protocol @@ -134,6 +142,6 @@ am263x_mcuplus: build_lib_am263x: # am263x-cc - Build driver library - $(MAKE) -C ../../source/i2s build_am263x PROFILE=$(PROFILE) + $(MAKE) -C ../../source/i2s build_am263x PROFILE=$(PROFILE) GEN_DIR=$(LIB_DIR) -.PHONY: all clean pru host pre_build_message clean_lib $(DEVICE) $(DEVICE_NON_PRU) $(SUPPORTED_PROCESSORS) +.PHONY: all clean pru host libs libs-clean pre_build_message build_lib_am261x build_lib_am263x $(DEVICE) $(DEVICE_NON_PRU) $(SUPPORTED_PROCESSORS) diff --git a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec index e28b4106a..5414a885a 100644 --- a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -63,7 +63,7 @@ -i${MCU_PLUS_SDK_PATH}/source/drivers/lib -i${MCU_PLUS_SDK_PATH}/source/board/lib -i${MCU_PLUS_SDK_PATH}/source/pru_io/lib - -i${OPEN_PRU_PATH}/source/i2s/lib + -i${OPEN_PRU_PATH}/examples/pru_i2s/lib -i${CG_TOOL_ROOT}/lib -m=pru_i2s_app.${ConfigName}.map --diag_suppress=10063 @@ -71,8 +71,6 @@ --reread_libs " - preBuildStep="$(MAKE) -C ${OPEN_PRU_PATH}/examples/pru_i2s build_lib_am261x PROFILE=${ConfigName} CG_TOOL_ROOT=${CG_TOOL_ROOT} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} OPEN_PRU_PATH=${OPEN_PRU_PATH} BUILD_MCUPLUS=y" - postBuildStep="$(MAKE) -C ${CCS_PROJECT_DIR} -f makefile_ccs_bootimage_gen OUTNAME=${BuildArtifactFileBaseName} PROFILE=${ConfigName} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} OPEN_PRU_PATH=${OPEN_PRU_PATH} CG_TOOL_ROOT=${CG_TOOL_ROOT} CCS_INSTALL_DIR=${CCS_INSTALL_DIR} CCS_IDE_MODE=${CCS_IDE_MODE} DEVICE=am261x" enableSysConfigTool="true" @@ -90,7 +88,7 @@ -lfreertos.am261x.r5f.ti-arm-clang.debug.lib -ldrivers.am261x.r5f.ti-arm-clang.freertos.debug.lib -lboard.am261x.r5f.ti-arm-clang.freertos.debug.lib - -lpru_i2s.am261x.r5f.ti-arm-clang.Debug.lib + -lpru_i2s.am261x.r5f.ti-arm-clang.debug.lib -llibc.a -llibsysbm.a " @@ -103,7 +101,7 @@ -lfreertos.am261x.r5f.ti-arm-clang.release.lib -ldrivers.am261x.r5f.ti-arm-clang.freertos.release.lib -lboard.am261x.r5f.ti-arm-clang.freertos.release.lib - -lpru_i2s.am261x.r5f.ti-arm-clang.Release.lib + -lpru_i2s.am261x.r5f.ti-arm-clang.release.lib -llibc.a -llibsysbm.a " diff --git a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile index 2c2d87629..cdb4070ff 100644 --- a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile @@ -111,7 +111,7 @@ LIBS_PATH_common = \ -Wl,-i${MCU_PLUS_SDK_PATH}/source/drivers/lib \ -Wl,-i${MCU_PLUS_SDK_PATH}/source/board/lib \ -Wl,-i${MCU_PLUS_SDK_PATH}/source/pru_io/lib \ - -Wl,-i${OPEN_PRU_PATH}/source/i2s/lib \ + -Wl,-i${OPEN_PRU_PATH}/examples/pru_i2s/lib \ -Wl,-i${CG_TOOL_ROOT}/lib \ LIBS_common = \ @@ -142,7 +142,7 @@ LIBS_PATH_NAME = \ ${MCU_PLUS_SDK_PATH}/source/drivers/lib \ ${MCU_PLUS_SDK_PATH}/source/board/lib \ ${MCU_PLUS_SDK_PATH}/source/pru_io/lib \ - ${OPEN_PRU_PATH}/source/i2s/lib \ + ${OPEN_PRU_PATH}/examples/pru_i2s/lib \ ${CG_TOOL_ROOT}/lib \ FILES := $(FILES_common) $(FILES_$(PROFILE)) @@ -179,10 +179,7 @@ $(OBJDIR)/%.obj %.obj: %.S @echo Compiling: am261x:r5fss0-0:freertos:ti-arm-clang $(LIBNAME): $< $(CC) -c $(CFLAGS) -o $(OBJDIR)/$@ $< -all: build_lib_if_needed $(TARGETS) - -build_lib_if_needed: - @echo "Library is built by parent makefile" +all: $(TARGETS) SYSCFG_GEN_FILES=generated/ti_drivers_config.c generated/ti_drivers_config.h SYSCFG_GEN_FILES+=generated/ti_drivers_open_close.c generated/ti_drivers_open_close.h @@ -199,10 +196,11 @@ else SYSTEM_COMMAND := $(OBJS) $(LNK_FILES) $(LIBS_NAME) endif -# Library is built by parent makefile (top-level pru_i2s/makefile) +# The driver library is not built with the application. It is found through +# LIBS_PATH_NAME, this rule only runs when the library has not been built. pru_i2s.am261x.r5f.ti-arm-clang.$(PROFILE).lib: - @echo "Building library via parent makefile..." - $(MAKE) -C ../../../.. build_lib_am261x + @echo "ERROR: $@ not found. Build the libraries first: run 'make libs' in examples/pru_i2s" + @exit 1 # Firmware array headers are generated by PRU firmware build (make pru). # The catch-all pattern suppresses "No rule to make target" errors from -MMD diff --git a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec index ba973b8d6..ad5a2b529 100644 --- a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -63,7 +63,7 @@ -i${MCU_PLUS_SDK_PATH}/source/drivers/lib -i${MCU_PLUS_SDK_PATH}/source/board/lib -i${MCU_PLUS_SDK_PATH}/source/pru_io/lib - -i${OPEN_PRU_PATH}/source/i2s/lib + -i${OPEN_PRU_PATH}/examples/pru_i2s/lib -i${CG_TOOL_ROOT}/lib -m=pru_i2s_app.${ConfigName}.map --diag_suppress=10063 @@ -71,8 +71,6 @@ --reread_libs " - preBuildStep="$(MAKE) -C ${OPEN_PRU_PATH}/examples/pru_i2s build_lib_am263x PROFILE=${ConfigName} CG_TOOL_ROOT=${CG_TOOL_ROOT} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} OPEN_PRU_PATH=${OPEN_PRU_PATH} BUILD_MCUPLUS=y" - postBuildStep="$(MAKE) -C ${CCS_PROJECT_DIR} -f makefile_ccs_bootimage_gen OUTNAME=${BuildArtifactFileBaseName} PROFILE=${ConfigName} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} OPEN_PRU_PATH=${OPEN_PRU_PATH} CG_TOOL_ROOT=${CG_TOOL_ROOT} CCS_INSTALL_DIR=${CCS_INSTALL_DIR} CCS_IDE_MODE=${CCS_IDE_MODE} DEVICE=am263x" enableSysConfigTool="true" @@ -90,7 +88,7 @@ -lfreertos.am263x.r5f.ti-arm-clang.debug.lib -ldrivers.am263x.r5f.ti-arm-clang.freertos.debug.lib -lboard.am263x.r5f.ti-arm-clang.freertos.debug.lib - -lpru_i2s.am263x.r5f.ti-arm-clang.Debug.lib + -lpru_i2s.am263x.r5f.ti-arm-clang.debug.lib -llibc.a -llibsysbm.a " @@ -103,7 +101,7 @@ -lfreertos.am263x.r5f.ti-arm-clang.release.lib -ldrivers.am263x.r5f.ti-arm-clang.freertos.release.lib -lboard.am263x.r5f.ti-arm-clang.freertos.release.lib - -lpru_i2s.am263x.r5f.ti-arm-clang.Release.lib + -lpru_i2s.am263x.r5f.ti-arm-clang.release.lib -llibc.a -llibsysbm.a " diff --git a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile index 3b43367e9..804c4f48d 100644 --- a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile @@ -113,7 +113,7 @@ LIBS_PATH_common = \ -Wl,-i${MCU_PLUS_SDK_PATH}/source/drivers/lib \ -Wl,-i${MCU_PLUS_SDK_PATH}/source/board/lib \ -Wl,-i${MCU_PLUS_SDK_PATH}/source/pru_io/lib \ - -Wl,-i${OPEN_PRU_PATH}/source/i2s/lib \ + -Wl,-i${OPEN_PRU_PATH}/examples/pru_i2s/lib \ -Wl,-i${CG_TOOL_ROOT}/lib \ LIBS_common = \ @@ -144,7 +144,7 @@ LIBS_PATH_NAME = \ ${MCU_PLUS_SDK_PATH}/source/drivers/lib \ ${MCU_PLUS_SDK_PATH}/source/board/lib \ ${MCU_PLUS_SDK_PATH}/source/pru_io/lib \ - ${OPEN_PRU_PATH}/source/i2s/lib \ + ${OPEN_PRU_PATH}/examples/pru_i2s/lib \ ${CG_TOOL_ROOT}/lib \ FILES := $(FILES_common) $(FILES_$(PROFILE)) @@ -181,10 +181,7 @@ $(OBJDIR)/%.obj %.obj: %.S @echo Compiling: am263x:r5fss0-0:freertos:ti-arm-clang $(LIBNAME): $< $(CC) -c $(CFLAGS) -o $(OBJDIR)/$@ $< -all: build_lib_if_needed $(TARGETS) - -build_lib_if_needed: - @echo "Library is built by parent makefile" +all: $(TARGETS) SYSCFG_GEN_FILES=generated/ti_drivers_config.c generated/ti_drivers_config.h SYSCFG_GEN_FILES+=generated/ti_drivers_open_close.c generated/ti_drivers_open_close.h @@ -201,10 +198,11 @@ else SYSTEM_COMMAND := $(OBJS) $(LNK_FILES) $(LIBS_NAME) endif -# Library is built by parent makefile (top-level pru_i2s/makefile) +# The driver library is not built with the application. It is found through +# LIBS_PATH_NAME, this rule only runs when the library has not been built. pru_i2s.am263x.r5f.ti-arm-clang.$(PROFILE).lib: - @echo "Building library via parent makefile..." - $(MAKE) -C ../../../.. build_lib_am263x + @echo "ERROR: $@ not found. Build the libraries first: run 'make libs' in examples/pru_i2s" + @exit 1 # Firmware array headers are generated by PRU firmware build (make pru). # The catch-all pattern suppresses "No rule to make target" errors from -MMD diff --git a/source/i2s/makefile b/source/i2s/makefile index 17a834c47..8bebd7c72 100644 --- a/source/i2s/makefile +++ b/source/i2s/makefile @@ -15,8 +15,6 @@ endif # Debug: no optimization (-O0) for faster compile/debug; Release: size-optimized (-Os) CFLAGS_OPT_debug := -O0 CFLAGS_OPT_release := -Os -CFLAGS_OPT_Release := -Os -CFLAGS_OPT_Debug := -O0 CFLAGS_OPT := $(CFLAGS_OPT_$(PROFILE)) CFLAGS_common := \ @@ -38,9 +36,11 @@ INCLUDES_common := \ -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/FreeRTOS-Kernel/include \ -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F -# Default library profile is Release (uppercase) so library names match linker refs -PROFILE?=Release -GEN_DIR := $(OPEN_PRU_PATH)/source/i2s/lib +# Library profile (debug or release), lowercase to match the MCU+ SDK library names +PROFILE?=release +# Output directory. The project that owns the library overrides this on the +# command line, see examples/pru_i2s/makefile +GEN_DIR ?= $(OPEN_PRU_PATH)/source/i2s/lib # Only build if MCU+ SDK is available ifeq ($(BUILD_MCUPLUS),y) @@ -54,10 +54,11 @@ build_am261x: $(INCLUDES_common) \ -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/config/am261x/r5f \ -DSOC_AM261X -DOS_FREERTOS \ - -o $(GEN_DIR)/pru_i2s_drv_am261x.obj pru_i2s_drv.c + -o $(GEN_DIR)/pru_i2s_drv_am261x.$(PROFILE).obj pru_i2s_drv.c + $(RM) $(GEN_DIR)/pru_i2s.am261x.r5f.ti-arm-clang.$(PROFILE).lib $(AR) rc $(GEN_DIR)/pru_i2s.am261x.r5f.ti-arm-clang.$(PROFILE).lib \ - $(GEN_DIR)/pru_i2s_drv_am261x.obj - $(RM) $(GEN_DIR)/pru_i2s_drv_am261x.obj + $(GEN_DIR)/pru_i2s_drv_am261x.$(PROFILE).obj + $(RM) $(GEN_DIR)/pru_i2s_drv_am261x.$(PROFILE).obj @echo "Library build complete." build_am263x: @@ -67,10 +68,11 @@ build_am263x: $(INCLUDES_common) \ -I$(MCU_PLUS_SDK_PATH)/source/kernel/freertos/config/am263x/r5f \ -DSOC_AM263X -DOS_FREERTOS \ - -o $(GEN_DIR)/pru_i2s_drv_am263x.obj pru_i2s_drv.c + -o $(GEN_DIR)/pru_i2s_drv_am263x.$(PROFILE).obj pru_i2s_drv.c + $(RM) $(GEN_DIR)/pru_i2s.am263x.r5f.ti-arm-clang.$(PROFILE).lib $(AR) rc $(GEN_DIR)/pru_i2s.am263x.r5f.ti-arm-clang.$(PROFILE).lib \ - $(GEN_DIR)/pru_i2s_drv_am263x.obj - $(RM) $(GEN_DIR)/pru_i2s_drv_am263x.obj + $(GEN_DIR)/pru_i2s_drv_am263x.$(PROFILE).obj + $(RM) $(GEN_DIR)/pru_i2s_drv_am263x.$(PROFILE).obj @echo "Library build complete." clean: From d0460895117174fff3914a14f875de4454b169ff Mon Sep 17 00:00:00 2001 From: Ayushman Date: Thu, 26 Nov 2026 12:35:16 +0530 Subject: [PATCH 08/10] makefile: add top-level libs and libs-clean targets Libraries owned by a project are built and cleaned separately from the project, like the MCU+ SDK libraries. Today only pru_i2s has one. - "make libs" builds, "make libs-clean" cleans the libraries of the projects listed in LIBS_SUBDIRS in examples/makefile - "make" (all) builds the libraries first, so a fresh clone and the make CI are unchanged. "make clean" does not remove them - update the help text and the README - ccs_build.yml: the CCS projects only link the library, so build it with "make libs" before the CCS import Signed-off-by: Ayushman --- .github/workflows/ccs_build.yml | 19 +++++++++++++++++++ README.md | 6 ++++++ examples/makefile | 18 +++++++++++++++++- makefile | 27 +++++++++++++++++++++++---- 4 files changed, 65 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ccs_build.yml b/.github/workflows/ccs_build.yml index 1f74b5efb..a1c7daf63 100644 --- a/.github/workflows/ccs_build.yml +++ b/.github/workflows/ccs_build.yml @@ -249,6 +249,25 @@ jobs: CCS_NODE = $(CCS_PATH)/tools/node/node EOF + - name: Build project libraries + # Some projects (for example pru_i2s) link a library that the CCS + # project does not build. Build these first with the makefiles, the + # same way a user runs "make libs" before building in CCS. + # Projects without a library for this device do nothing. + run: | + DEVICE="${{ matrix.device }}" + if [ -z "${{ matrix.mcu_plus_sdk }}" ]; then + echo "No MCU+ SDK for ${DEVICE}, skipping library build" + exit 0 + fi + ARM_CGT_PATH="$HOME/ti/ccs_20.3.1/ccs/tools/compiler/ti-cgt-armllvm_4.0.3.LTS" + [ -d "${ARM_CGT_PATH}" ] || ARM_CGT_PATH="$HOME/ti/ti-cgt-armllvm_4.0.3.LTS" + make libs DEVICE="${DEVICE}" \ + BUILD_MCUPLUS=y \ + PROFILE=release \ + MCU_PLUS_SDK_PATH="$HOME/ti/${{ matrix.mcu_plus_sdk }}" \ + CGT_TI_ARM_CLANG_PATH="${ARM_CGT_PATH}" + - name: Patch metadata for SysConfig version # Temporarily encodes the SysConfig version into OpenPRU's package.tirex.json # and product.json so CCS selects the correct SysConfig version when diff --git a/README.md b/README.md index 0dac3e852..ec48697fa 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,12 @@ Makefiles can be used to: For detailed steps on how to use makefiles, run ```make help``` from the root folder of the `open-pru` repository. +Some projects build a library that the project then links, for example the +`pru_i2s` driver library. `make` builds these libraries first. They can also be +built or cleaned on their own with `make libs` and `make libs-clean`. +`make clean` does not remove them. Run `make libs` again after changing the +library source code. + ### Building With CCS - Import the project into CCS. For steps to create a new PRU project in CCS, diff --git a/examples/makefile b/examples/makefile index 085d41f99..580cff6a8 100644 --- a/examples/makefile +++ b/examples/makefile @@ -6,10 +6,25 @@ SUBDIRS := \ LCD_interface logic_scope pru_emif pru_eqep pru_i2s spi_loopback \ fir multicore_scheduler rpmsg_echo_linux +# projects that build a library of their own. Only these get "libs" and "libs-clean" +LIBS_SUBDIRS := pru_i2s + # "make" or "make all" builds projects that match $(DEVICE) set in imports.mak all: ARGUMENTS = all all: $(SUBDIRS) +# "make libs" builds the libraries of the projects in LIBS_SUBDIRS +libs: $(addprefix libs-,$(LIBS_SUBDIRS)) + +# "make libs-clean" cleans the libraries of the projects in LIBS_SUBDIRS +libs-clean: $(addprefix libs-clean-,$(LIBS_SUBDIRS)) + +$(addprefix libs-,$(LIBS_SUBDIRS)): + $(MAKE) -C $(patsubst libs-%,%,$@) libs + +$(addprefix libs-clean-,$(LIBS_SUBDIRS)): + $(MAKE) -C $(patsubst libs-clean-%,%,$@) libs-clean + pru: ARGUMENTS = pru pru: $(SUBDIRS) @@ -23,4 +38,5 @@ clean: $(SUBDIRS) $(SUBDIRS): $(MAKE) -C $@ $(ARGUMENTS) -.PHONY: all clean pru host $(SUBDIRS) +.PHONY: all clean pru host libs libs-clean $(SUBDIRS) \ + $(addprefix libs-,$(LIBS_SUBDIRS)) $(addprefix libs-clean-,$(LIBS_SUBDIRS)) diff --git a/makefile b/makefile index ba943d8c5..61a2f7939 100644 --- a/makefile +++ b/makefile @@ -3,12 +3,23 @@ include imports.mak SUBDIRS := source academy examples # "make" or "make all" builds projects that match $(DEVICE) set in imports.mak -# this also builds all libraries in the source directory +# this also builds all libraries in the source directory and the project +# libraries ("make libs") all: $(MAKE) -C source + $(MAKE) libs $(MAKE) pru $(MAKE) host +# "make libs" builds the libraries owned by projects (for example pru_i2s) +# the projects link these libraries, but "make pru" and "make host" do not build them +libs: + $(MAKE) -C examples libs + +# "make libs-clean" cleans the libraries owned by projects. "make clean" does not +libs-clean: + $(MAKE) -C examples libs-clean + # "make pru" builds PRU firmware for all projects matching $(DEVICE) pru: ARGUMENTS := pru pru: academy examples @@ -59,12 +70,20 @@ help: @echo "$(MAKE) -s pru // build only PRU firmware for all projects" @echo "$(MAKE) -s host // build only host code for all projects" @echo "$(MAKE) -s clean // clean all projects that match DEVICE" + @echo "$(MAKE) -s libs // build only the libraries owned by projects" + @echo "$(MAKE) -s libs-clean // clean only the libraries owned by projects" @echo @echo "The overall build targets also build & clean all libraries in the" @echo "source/ directory" @echo - @echo "Note: make pru and make host assume source/ libraries are already" - @echo "built. Run make first on a fresh clone to build everything in order." + @echo "Libraries owned by a project (for example the pru_i2s driver library)" + @echo "are built by make and make libs. make clean does not remove them, use" + @echo "make libs-clean. Rebuild them with make libs after changing the library" + @echo "source code." + @echo + @echo "Note: make pru and make host assume source/ libraries and project" + @echo "libraries are already built. Run make first on a fresh clone to build" + @echo "everything in order." @echo @echo "Build a single project:" @echo "=======================" @@ -90,4 +109,4 @@ help: @echo "the PRU firmware." @echo -.PHONY: all clean pru host help academy examples source +.PHONY: all clean pru host libs libs-clean help academy examples source From 34c568074e1972a5359eff594b55e86b5b537d7e Mon Sep 17 00:00:00 2001 From: Ayushman Date: Thu, 26 Nov 2026 12:39:39 +0530 Subject: [PATCH 09/10] pru_i2s: generate the firmware headers per board The PRU firmware headers of am261x and am263x were copied to the same path, firmware/i2s/ and firmware/tdm4/. After building am261x, am263x, then am261x again, the am261x .out files were up to date, so the headers were not generated again and the am261x application was built with the am263x firmware images (different pins, no build error). - copy the headers to firmware//, am261x-lp or am263x-cc. The I2S and TDM4 header names differ, so one directory per board is enough - the application includes firmware// instead of firmware/i2s and firmware/tdm4 - pru_rules.mak creates the destination directory before the copy - README: describe the new location The CCS projects are not affected: the firmware postBuildStep writes the header into the workspace project. Signed-off-by: Ayushman --- examples/pru_i2s/README.md | 10 ++++++---- .../am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile | 2 +- .../am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile | 2 +- .../am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile | 2 +- .../am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile | 2 +- .../am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile | 2 +- .../am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile | 2 +- .../am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile | 2 +- .../am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile | 2 +- .../r5fss0-0_freertos/ti-arm-clang/example.projectspec | 3 +-- .../am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile | 3 +-- .../r5fss0-0_freertos/ti-arm-clang/example.projectspec | 3 +-- .../am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile | 3 +-- pru_rules.mak | 1 + 14 files changed, 19 insertions(+), 20 deletions(-) diff --git a/examples/pru_i2s/README.md b/examples/pru_i2s/README.md index 660d56516..cdbd273e9 100644 --- a/examples/pru_i2s/README.md +++ b/examples/pru_i2s/README.md @@ -168,15 +168,17 @@ pru_i2s/ │ │ ├── linker.cmd # Linker script │ │ ├── pru_i2s_interface.h # Interface definitions │ │ ├── pru_i2s_regs.h # Hardware registers -│ │ ├── pru_i2s_pru0/1_array.h # Generated firmware array headers (build output) │ │ ├── pru0_tx/ # TX firmware builds │ │ │ ├── am261x-lp/ # AM261x variant │ │ │ └── am263x-cc/ # AM263x variant │ │ └── pru1_rx/ # RX firmware builds │ │ ├── am261x-lp/ │ │ └── am263x-cc/ -│ └── tdm4/ # TDM4 protocol (parallel structure) -│ └── (same structure as I2S, with pru_i2s_tdm4_pru0/1_array.h generated) +│ ├── tdm4/ # TDM4 protocol (parallel structure) +│ ├── am261x-lp/ # Generated firmware array headers for AM261x (build output) +│ │ └── pru_i2s_pru0/1_array.h, pru_i2s_tdm4_pru0/1_array.h +│ └── am263x-cc/ # Generated firmware array headers for AM263x (build output) +│ └── pru_i2s_pru0/1_array.h, pru_i2s_tdm4_pru0/1_array.h ├── pru_i2s_app/ # R5F host application │ ├── board/ # Board support files │ │ ├── ioexp_tca6416.c # IO expander driver @@ -227,7 +229,7 @@ make DEVICE=am261x libs-clean # Clean the driver library **What gets built:** - 4 PRU firmware binaries per device (I2S PRU0 TX, I2S PRU1 RX, TDM4 PRU0 TX, TDM4 PRU1 RX) -- Firmware header arrays (`.h` files) copied into `firmware/i2s/` and `firmware/tdm4/` +- Firmware header arrays (`.h` files) copied into `firmware//` (`firmware/am261x-lp/` or `firmware/am263x-cc/`). Each board has its own copy, so building for one board does not overwrite the headers of the other - PRU I2S driver library (`lib/pru_i2s..r5f.ti-arm-clang..lib`), built by `make libs` from the driver source in `source/i2s/` - R5F application binary (`.out` and `.mcelf`) diff --git a/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile index bccbbe501..516cfb178 100644 --- a/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -11,7 +11,7 @@ OUTPUT_NAME := pru_i2s_am261x-lp_icssm0-pru0_fw # MCU+ projects: rename & move hex array output MCU_HEX_NAME := pru_i2s_pru0_array.h HEX_ARRAY_PREFIX := pru_prupru_i2s0_image_0 -MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s/$(MCU_HEX_NAME) +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/am261x-lp/$(MCU_HEX_NAME) # which directories to search for assembly & C source files? FILES_PATH := ../../../../ diff --git a/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile index 32dd2849f..75db5ad86 100644 --- a/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -11,7 +11,7 @@ OUTPUT_NAME := pru_i2s_am263x-cc_icssm0-pru0_fw # MCU+ projects: rename & move hex array output MCU_HEX_NAME := pru_i2s_pru0_array.h HEX_ARRAY_PREFIX := pru_prupru_i2s0_image_0 -MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s/$(MCU_HEX_NAME) +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/am263x-cc/$(MCU_HEX_NAME) # which directories to search for assembly & C source files? FILES_PATH := ../../../../ diff --git a/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile index 85ce5aed3..cbf283e04 100644 --- a/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -11,7 +11,7 @@ OUTPUT_NAME := pru_i2s_am261x-lp_icssm0-pru1_fw # MCU+ projects: rename & move hex array output MCU_HEX_NAME := pru_i2s_pru1_array.h HEX_ARRAY_PREFIX := pru_prupru_i2s1_image_0 -MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s/$(MCU_HEX_NAME) +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/am261x-lp/$(MCU_HEX_NAME) # which directories to search for assembly & C source files? FILES_PATH := ../../../../ diff --git a/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile index 3c728e803..9b014f039 100644 --- a/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/i2s/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -11,7 +11,7 @@ OUTPUT_NAME := pru_i2s_am263x-cc_icssm0-pru1_fw # MCU+ projects: rename & move hex array output MCU_HEX_NAME := pru_i2s_pru1_array.h HEX_ARRAY_PREFIX := pru_prupru_i2s1_image_0 -MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/i2s/$(MCU_HEX_NAME) +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/am263x-cc/$(MCU_HEX_NAME) # which directories to search for assembly & C source files? FILES_PATH := ../../../../ diff --git a/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile index 21abd078d..d6f4b30c8 100644 --- a/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru0_tx/am261x-lp/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -11,7 +11,7 @@ OUTPUT_NAME := pru_i2s_tdm4_am261x-lp_icssm0-pru0_fw # MCU+ projects: rename & move hex array output MCU_HEX_NAME := pru_i2s_tdm4_pru0_array.h HEX_ARRAY_PREFIX := pru_prupru_i2s0_image_0 -MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4/$(MCU_HEX_NAME) +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/am261x-lp/$(MCU_HEX_NAME) # which directories to search for assembly & C source files? FILES_PATH := ../../../../ diff --git a/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile index 9f96c7e9e..01673223a 100644 --- a/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru0_tx/am263x-cc/icssm0-pru0_fw/ti-pru-cgt/makefile @@ -11,7 +11,7 @@ OUTPUT_NAME := pru_i2s_tdm4_am263x-cc_icssm0-pru0_fw # MCU+ projects: rename & move hex array output MCU_HEX_NAME := pru_i2s_tdm4_pru0_array.h HEX_ARRAY_PREFIX := pru_prupru_i2s0_image_0 -MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4/$(MCU_HEX_NAME) +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/am263x-cc/$(MCU_HEX_NAME) # which directories to search for assembly & C source files? FILES_PATH := ../../../../ diff --git a/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile index 552bad877..b9e90fb62 100644 --- a/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru1_rx/am261x-lp/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -11,7 +11,7 @@ OUTPUT_NAME := pru_i2s_tdm4_am261x-lp_icssm0-pru1_fw # MCU+ projects: rename & move hex array output MCU_HEX_NAME := pru_i2s_tdm4_pru1_array.h HEX_ARRAY_PREFIX := pru_prupru_i2s1_image_0 -MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4/$(MCU_HEX_NAME) +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/am261x-lp/$(MCU_HEX_NAME) # which directories to search for assembly & C source files? FILES_PATH := ../../../../ diff --git a/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile index 21f033761..215a8ae95 100644 --- a/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile +++ b/examples/pru_i2s/firmware/tdm4/pru1_rx/am263x-cc/icssm0-pru1_fw/ti-pru-cgt/makefile @@ -11,7 +11,7 @@ OUTPUT_NAME := pru_i2s_tdm4_am263x-cc_icssm0-pru1_fw # MCU+ projects: rename & move hex array output MCU_HEX_NAME := pru_i2s_tdm4_pru1_array.h HEX_ARRAY_PREFIX := pru_prupru_i2s1_image_0 -MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/tdm4/$(MCU_HEX_NAME) +MCU_HEX_PATH := $(OPEN_PRU_PATH)/examples/pru_i2s/firmware/am263x-cc/$(MCU_HEX_NAME) # which directories to search for assembly & C source files? FILES_PATH := ../../../../ diff --git a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec index 5414a885a..38fd02b06 100644 --- a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -38,8 +38,7 @@ -I${WORKSPACE_LOC}/pru_i2s_pru0_array_am261x-lp_icssm0-pru0_fw_ti-pru-cgt -I${WORKSPACE_LOC}/pru_i2s_pru1_array_am261x-lp_icssm0-pru1_fw_ti-pru-cgt -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/am261x-lp -I${OPEN_PRU_PATH}/examples/pru_i2s/pru_i2s_app -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/FreeRTOS-Kernel/include -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F diff --git a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile index cdb4070ff..bbaa15697 100644 --- a/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/pru_i2s/pru_i2s_app/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile @@ -60,8 +60,7 @@ INCLUDES_common := \ -I${OPEN_PRU_PATH}/source \ -I${OPEN_PRU_PATH}/source/i2s \ -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware \ - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s \ - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 \ + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/am261x-lp \ -I${OPEN_PRU_PATH}/examples/pru_i2s/pru_i2s_app \ -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/FreeRTOS-Kernel/include \ -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F \ diff --git a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec index ad5a2b529..92cad59df 100644 --- a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -38,8 +38,7 @@ -I${WORKSPACE_LOC}/pru_i2s_pru0_array_am263x-cc_icssm0-pru0_fw_ti-pru-cgt -I${WORKSPACE_LOC}/pru_i2s_pru1_array_am263x-cc_icssm0-pru1_fw_ti-pru-cgt -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/am263x-cc -I${OPEN_PRU_PATH}/examples/pru_i2s/pru_i2s_app -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/FreeRTOS-Kernel/include -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F diff --git a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile index 804c4f48d..40382d808 100644 --- a/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/pru_i2s/pru_i2s_app/am263x-cc/r5fss0-0_freertos/ti-arm-clang/makefile @@ -62,8 +62,7 @@ INCLUDES_common := \ -I${OPEN_PRU_PATH}/source \ -I${OPEN_PRU_PATH}/source/i2s \ -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware \ - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/i2s \ - -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/tdm4 \ + -I${OPEN_PRU_PATH}/examples/pru_i2s/firmware/am263x-cc \ -I${OPEN_PRU_PATH}/examples/pru_i2s/pru_i2s_app \ -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/FreeRTOS-Kernel/include \ -I${MCU_PLUS_SDK_PATH}/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F \ diff --git a/pru_rules.mak b/pru_rules.mak index d1e583bfa..3fc12e960 100644 --- a/pru_rules.mak +++ b/pru_rules.mak @@ -163,6 +163,7 @@ post-build: -$(CAT) $(OPEN_PRU_PATH)/source/firmware/pru_load_bin_copyright.h $(TARGET_HEX) > $(TARGET_HEX).temp -$(MOVE) $(TARGET_HEX).temp $(TARGET_HEX) ifeq ($(BUILD_MCUPLUS),y) + -$(MKDIR) $(dir $(MCU_HEX_PATH)) -$(COPY) $(TARGET_HEX) $(MCU_HEX_PATH) endif @echo ' ' From e4150c400130f5b131c02cf0f8161524762bfecb Mon Sep 17 00:00:00 2001 From: Ayushman Date: Thu, 26 Nov 2026 13:40:13 +0530 Subject: [PATCH 10/10] pru_i2s: fix the driver and directory sections of the README - remove PRUI2S_pruGpioPadConfig() and PRUICSS_intcSetSysEvtChMap(), they do not exist. The pins are configured by SysConfig - PRUI2S_initPpBufs() is static and called by PRUI2S_open(), do not list it as an API - PRUI2S_open() does not initialize the INTC, the application calls PRUICSS_intcInit() before PRUI2S_init() - say that PRUI2S_applyAppConfig() is part of the example, not of the driver library - directory structure: list pru_i2s_app_config.c/.h, source/i2s and the real names of the generated headers Signed-off-by: Ayushman --- examples/pru_i2s/README.md | 50 ++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/examples/pru_i2s/README.md b/examples/pru_i2s/README.md index cdbd273e9..acf0d339a 100644 --- a/examples/pru_i2s/README.md +++ b/examples/pru_i2s/README.md @@ -176,19 +176,27 @@ pru_i2s/ │ │ └── am263x-cc/ │ ├── tdm4/ # TDM4 protocol (parallel structure) │ ├── am261x-lp/ # Generated firmware array headers for AM261x (build output) -│ │ └── pru_i2s_pru0/1_array.h, pru_i2s_tdm4_pru0/1_array.h +│ │ ├── pru_i2s_pru0_array.h, pru_i2s_pru1_array.h +│ │ └── pru_i2s_tdm4_pru0_array.h, pru_i2s_tdm4_pru1_array.h │ └── am263x-cc/ # Generated firmware array headers for AM263x (build output) -│ └── pru_i2s_pru0/1_array.h, pru_i2s_tdm4_pru0/1_array.h +│ └── (same files as am261x-lp) ├── pru_i2s_app/ # R5F host application │ ├── board/ # Board support files │ │ ├── ioexp_tca6416.c # IO expander driver │ │ └── ioexp_tca6416.h │ ├── pru_i2s_diagnostic.c # Main application +│ ├── pru_i2s_app_config.c/.h # Application configuration (PRUI2S_applyAppConfig) │ ├── data.h # Test data │ ├── am261x-lp/r5fss0-0_freertos/ │ └── am263x-cc/r5fss0-0_freertos/ ├── lib/ # Driver library (build output of make libs, not checked in) └── images/ # Documentation images + +source/i2s/ # I2S driver library source, outside of this example +├── pru_i2s_drv.c/.h # Driver +├── pru_i2s_config.h # Driver configuration +├── icss_pru_i2s_fw.h # Firmware register layout shared with the PRU firmware +└── makefile # Builds the library, run through make libs in this example ``` --- @@ -201,20 +209,27 @@ pru_i2s/ - Set `DEVICE` environment variable in `imports.mak` - Ensure CCS utils are in PATH (for gmake on Windows) -**Build the driver library, then the firmware and application:** +**Build the driver library first, then the firmware and application.** +Run both commands for the device you are building for, in this order: ```bash cd examples/pru_i2s -make DEVICE=am261x libs # Build the driver library for AM261x -make DEVICE=am261x # Build the firmware and application for AM261x -make DEVICE=am263x libs # Build the driver library for AM263x -make DEVICE=am263x # Build the firmware and application for AM263x + +# AM261x +make DEVICE=am261x libs # 1. Build the driver library +make DEVICE=am261x # 2. Build the firmware and application + +# AM263x +make DEVICE=am263x libs # 1. Build the driver library +make DEVICE=am263x # 2. Build the firmware and application ``` -The driver library is built separately from the application. The application -only links the existing library, and stops with an error if the library is -missing. Run `make libs` first on a fresh clone, and again after any change to -the driver source in `source/i2s/`. Library files are not checked in. Building -from the root of the repository with `make` also builds the library first. +The driver library is built separately from the application. `make` in this +directory does **not** build the library. The application only links the +existing library, and stops with an error if the library is missing. Run +`make libs` first on a fresh clone, and again after any change to the driver +source in `source/i2s/`. Library files are not checked in. Running `make` from +the root of the repository builds the library first, so the two steps are not +needed there. Use `make libs PROFILE=debug` to build the debug library for a debug build of the application. The default is `release`, set `PROFILE` in `imports.mak`. @@ -311,17 +326,20 @@ The R5F application uses SysConfig to configure PRUICSS: **Initialization:** ```c +PRUICSS_intcInit() // Initialize the PRU-ICSS INTC (MCU+ SDK, called by the application before PRUI2S_init) PRUI2S_init() // Read firmware config, update driver tables PRUI2S_getInitCfg() // Get buffer sizes, sampling freq, slot width PRUI2S_paramsInit() // Set default parameters -PRUI2S_open() // Clear IMEM/DMEM, init INTC, download firmware -PRUI2S_pruGpioPadConfig() // Configure I2S signal pins -PRUI2S_initPpBufs() // Initialize ping-pong buffers +PRUI2S_open() // Clear IMEM/DMEM, download firmware, initialize the ping-pong buffers ``` +The I2S signal pins are configured by SysConfig, the driver does not configure them. +The driver library (`source/i2s/`) does not contain the application configuration +(`PRUI2S_applyAppConfig()`). It is part of the example, in +`pru_i2s_app/pru_i2s_app_config.c`. + **Interrupt Management:** ```c -PRUICSS_intcSetSysEvtChMap() // Map system events to channels PRUI2S_enableInt() // Enable TX/RX interrupts PRUI2S_disableInt() // Disable interrupts PRUI2S_clearInt() // Clear interrupt flags