-
Notifications
You must be signed in to change notification settings - Fork 2
Am263x: PRU-I2S #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Pending Items: |
96bf0b7 to
a27184b
Compare
|
Hey @rajul-bhambay, what is TDM4? I assume something to do with time-domain multiplexing, instead of a typo for TDA4? |
Hey @nsaulnier-ti , TDM4 (time division multiplexing 4 channels) is a mode of communication of audio signals. We have 2 modes, I2S and TDM4/TDM8 which is suppported by the TI's TAS6424Q1 coded (class-D amplifier). |
26e87e1 to
29b5691
Compare
| @@ -0,0 +1,186 @@ | |||
| %%{ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this file. Can we remove?
| @@ -0,0 +1,77 @@ | |||
| %%{ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this file. Can we remove?
| @@ -0,0 +1,52 @@ | |||
| /* | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this file. Can we remove?
| @@ -0,0 +1,280 @@ | |||
| /* | |||
| * Copyright (C) 2021 Texas Instruments Incorporated | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update copyright year in all files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this file to board sub-folder as it is not a core example function
| /* Function Definitions */ | ||
| /* ========================================================================== */ | ||
|
|
||
| int32_t TCA6416_open(TCA6416_Config *config, const TCA6416_Params *params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need this code now? Is this not supported in MCU+ SDK SysConfig under IOEXP module?
| #define TEST_PRUI2S0_IDX ( 0 ) /* Test PRU I2S 0 index */ | ||
| #define TEST_PRUI2S1_IDX ( 1 ) /* Test PRU I2S 1 index */ | ||
|
|
||
| #define TDM4 ( 1 ) /* TDM4 mode (change to 0 for I2S)*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we have tested both modes. Can you confirm?
| */ | ||
|
|
||
|
|
||
| void i2s_i2c_io_expander(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's review if this can be removed - by using SysConfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you review this?
| /* debug, increment ISR count */ | ||
| gPruI2s1RxIsrCnt++; | ||
| /* debug, drive GPIO high */ | ||
| GPIO_pinWriteHigh(CONFIG_GPIO_DEBUG1_BASE_ADDR, CONFIG_GPIO_DEBUG1_PIN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put this GPIO code under some debug macro? Else it adds unnecessary latency to ISRs
| @@ -0,0 +1,200 @@ | |||
| /* | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this to SysConfig?
|
Can we merge commit? Don't think we need 4 |
cd4d050 to
172a2d0
Compare
pratheesh-ti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Complete the documentation changes to merge
source/pru_i2s/driver/pru_i2s_drv.c
Outdated
| @@ -0,0 +1,2692 @@ | |||
| /* | |||
| * Copyright (C) 2021 Texas Instruments Incorporated | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the copyright year
source/pru_i2s/driver/pru_i2s_drv.c
Outdated
|
|
||
| #include <stdint.h> | ||
| #include <drivers/hw_include/cslr.h> | ||
| #include <drivers\hw_include\am263x\cslr_iomux.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be consistent with use of "/" vs ""
source/pru_i2s/driver/pru_i2s_drv.c
Outdated
| #include <kernel/dpl/SemaphoreP.h> | ||
| #include <drivers\hw_include\am263px\cslr_intr_r5fss0_core0.h> | ||
| #include <drivers\pinmux\am263x\pinmux.h> | ||
| //#include "ti_drivers_config.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove if not relevant
source/pru_i2s/driver/pru_i2s_drv.c
Outdated
| #define PRUI2S_PRU_INTC_SYSEVT2_IDX ( 2 ) /* I2S error system event index */ | ||
|
|
||
| /* Number INTC channels per PRU */ | ||
| #define PRUI2S_PRUICSS_INTC_NUM_CHANNELS_PER_PRU \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next line is not really warranted here?
| pSwipAttrs->rxPin[i].pinNum = temp8b; | ||
| } | ||
|
|
||
| /* TBD: SoC PAD address lookup */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove if not relevant anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file seems to redefine a bunch of functions definted in pruicss driver in MCU+ SDK. Is this intentional?
| @@ -0,0 +1,200 @@ | |||
| /* | |||
| * Copyright (c) 2021, Texas Instruments Incorporated | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the year
| @@ -0,0 +1,280 @@ | |||
| /* | |||
| * Copyright (C) 2021 Texas Instruments Incorporated | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this file to board sub-folder as it is not a core example function
| @@ -0,0 +1,113 @@ | |||
| ; | |||
| ; Copyright (c) 2021, Texas Instruments Incorporated | |||
| ; All rights reserved. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add firmware design document in md format here under firmware/I2S/docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check this comment @rajul-bhambay
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| */ | ||
|
|
||
| #include <stdio.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Readme.md following other examples in open-pru, explaining the examples and other details
034f165 to
52e4c10
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest adding firmware documentation. Can do dedicated PR for this
|
@dhavaljk @manojKoppolu @rajul-bhambay let's discuss the overall structure of this project and the source folder, perhaps on Wednesday's meeting? I am trying to understand the logic of the overall project structure (e.g., not actually including any PRU code under examples, keeping it all under source), and function of different folders (especially .meta). If we want to keep the proposed structure of "source" [1], we would need to move the files a bit: source
[1] https://confluence.itg.ti.com/display/ProcSW/OpenPRU+Repository+Structure+Proposal |
nsaulnier-ti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to understand the logic behind the folder structures before we merge this in. Best to discuss verbally in the team meeting.
|
/review |
| PRUI2S_IoBuf rdIoBuf; | ||
| PRUI2S_IoBuf wrtIoBuf; | ||
| int32_t status = PRUI2S_DRV_SOK; | ||
| #ifdef _DBG_PRUI2S_RX_TO_TX_LB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is loopback mode tested and/or documented?
| DebugP_log("Build timestamp : %s %s\r\n", __DATE__, __TIME__); | ||
|
|
||
| /* Debug, configure GPIO */ | ||
| #ifdef SOC_AM263X |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No tabs for #ifdef and #endif
|
|
||
| /* Debug, configure GPIO */ | ||
| #ifdef SOC_AM263X | ||
| GPIO_setDirMode(CONFIG_GPIO_DEBUG0_BASE_ADDR, CONFIG_GPIO_DEBUG0_PIN, CONFIG_GPIO_DEBUG0_DIR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add comment to describe the use of these GPIOs?
| return; | ||
| } | ||
| /* Check PRU I2S0 instance is Tx only */ | ||
| DebugP_assert((swipAttrs.numTxI2s > 0) && (swipAttrs.numRxI2s == 0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we documenting that default mode is TX and this line needs to be updated if any configuration change is done?
| /* debug, increment ISR count */ | ||
| gPruI2s0TxIsrCnt++; | ||
| /* debug, drive GPIO high */ | ||
| #ifdef SOC_AM263X |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should this be specific to AM263x only?
| /* Get error status */ | ||
| PRUI2S_getErrStat(handle, &errStat); | ||
|
|
||
| if (errStat & ERROR_BIT_POSITION(I2S_ERR_OVR_BN)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are all these error cases tested?
0106a2f to
c6bc845
Compare
514366f to
2c46065
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed?
c8d1d4b to
50bd104
Compare
|
Resolved Build issues for R5F and PRU firmware projects |
| CONTIUNE_INIT: | ||
| ;Clear registers R0-R29. 4*30=120 bytes | ||
| ZERO &r0, 120 | ||
| LDI32 r30, 0x0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zero &r0, 128 shall do and remove both ldi32s?
| .endif | ||
|
|
||
| LDI32 scratchreg2, I2S_TX_INSTANCE_PING_PONG_STAT_ADD | ||
| LDI32 scratchreg0, 0x2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LDI is sufficient
| SBBO &scratchreg0, scratchreg2, 0, 1 | ||
|
|
||
| ;I2S_RX_INSTANCE_PING_PONG_STAT_ADD = I2S_TX_INSTANCE_PING_PONG_STAT_ADD+1 | ||
| LDI32 scratchreg0, 0x1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LDI is sufficient
| ;If set, this means underflow has happened. | ||
| ;Below Initializations can be avoided but after power on, registers | ||
| ;may contain random addresses and may result in accessing illegal addresses. | ||
| LDI32 ch0_data_tx, 0x0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zero &ch0_data_tx, 4
| ;Below Initializations can be avoided but after power on, registers | ||
| ;may contain random addresses and may result in accessing illegal addresses. | ||
| LDI32 ch0_data_tx, 0x0 | ||
| LDI32 scratchreg0, 0x0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zero &scratchreg0, 4
|
|
||
| ; Load pin mask registers | ||
| .if $isdefed("I2S_TX") | ||
| LDI32 i2s_instance_fs_pin_pos, I2S_INSTANCE_FS_PIN_POS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be LDI, given constant is 16-bit
| ;If set, this means underflow has happened. | ||
| ;Below Initializations can be avoided but after power on, registers | ||
| ;may contain random addresses and may result in accessing illegal addresses. | ||
| LDI32 ch0_data_tx, 0x0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be LDI, given constant is 16-bit
| ;Below Initializations can be avoided but after power on, registers | ||
| ;may contain random addresses and may result in accessing illegal addresses. | ||
| LDI32 ch0_data_tx, 0x0 | ||
| LDI32 scratchreg0, 0x0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be LDI, given constant is 16-bit
| ;may contain random addresses and may result in accessing illegal addresses. | ||
| LDI32 ch0_data_tx, 0x0 | ||
| LDI32 scratchreg0, 0x0 | ||
| LDI32 tx_buf_size, 0x0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be LDI, given constant is 16-bit. Looks to combine if contiguous
| @@ -0,0 +1,113 @@ | |||
| ; | |||
| ; Copyright (c) 2021, Texas Instruments Incorporated | |||
| ; All rights reserved. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check this comment @rajul-bhambay
50bd104 to
4a6cef1
Compare
|
Need to move firmware design mentioned in example/pru_i2s_diagnostics/readme.md to source/pru_i2s/docs/readme.md |
nsaulnier-ti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical changes are readme and project level makefile. Would like a discussion on the other comments.
| @@ -0,0 +1,47 @@ | |||
| include ../../imports.mak | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rajul-bhambay please update the project makefile based on the latest empty project example:
https://github.com/TexasInstruments/open-pru/blob/main/examples/empty/makefile
You will update these sections:
- project information
- Target definitions
And these sections will be unmodified:
- Prebuild checks (unless you want to add another dependency other than MCU+ SDK)
- Make and clean commands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for highlighting that. Made the changes now
| - Code Composer Studio 12.81 | ||
| - Sysconfig 1.23.1 | ||
| - mcu_plus_sdk_am263x | ||
| - mcu_plus_sdk_am261x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there minimum MCU+ SDK requirements? Or only minimum SysConfig version requirements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mentioned now
| @@ -0,0 +1,90 @@ | |||
| ################################################################################ | |||
| # Automatically-generated file. Do not edit! | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we expect that customers will be modifying the I2S firmware? (e.g., customer porting to AM263Px, AM64x R5F, etc).
If yes, my preference would be to align the PRU makefiles with the other PRU makefiles in the open-pru repo:
https://github.com/TexasInstruments/open-pru/blob/main/examples/empty/firmware/am261x-lp/icss_m0_pru0_fw/ti-pru-cgt/makefile
| include $(OPEN_PRU_PATH)/imports.mak | ||
| SYSCFG_DIR := $(CCS_PROJECT_DEBUG)/syscfg | ||
| CG_TOOL_ROOT := $(CGT_TI_PRU_PATH) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is PRU linker.cmd file generated by SysConfig?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never mind, I see that a shared linker.cmd file seems to be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the linker file. Somehow i missed to remove that after moving memory related things to memory configurator in sysconfig
| @@ -0,0 +1,88 @@ | |||
| /****************************************************************************/ | |||
| /* ICSSG_PRU.cmd */ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Help me understand the vision for this linker.cmd file.
- It used to be PRU_ICSSG, and has been modified for AM26x
- It CANNOT be used for both PRU_ICSSG and PRU-ICSS in its current state, since AM243x/AM64x only have 12kB IRAM
- It still lists a bunch of PRU_ICSSG stuff, like a memory allocation for RTU
- PRU_SHAREDRAM could be a memory conflict if both PRU0 & PRU1 have a dbgBuf region
- please verify how you want to be using the memory regions (e.g., do PRU0 and PRU1 ever need to be referring to the same memory region? or are they always going to be using separate memory?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for highlighting this. Let me change it wrt AM26x.
dbgBuf region is not used by any core (maybe it was added to have a debug region for initial version of firmware for AM243x/64x).
- TDM functionality - I2S functionality Fixes: PINDSW-8487,9295 Signed-off-by: Rajul Bhambay <r-bhambay@ti.com>
4a6cef1 to
049eaaf
Compare
| @@ -0,0 +1,88 @@ | |||
| /****************************************************************************/ | |||
| /* ICSSG_PRU.cmd */ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace these files with the standard ASM linker.cmd file:
https://github.com/TexasInstruments/open-pru/blob/main/examples/empty/firmware/am261x-lp/icss_m0_pru0_fw/ti-pru-cgt/linker.cmd
https://github.com/TexasInstruments/open-pru/blob/main/examples/empty/firmware/am261x-lp/icss_m0_pru1_fw/ti-pru-cgt/linker.cmd
you can also get the templates from source directory:
https://github.com/TexasInstruments/open-pru/tree/main/source/linker_cmd/asm_code/am263x
Most projects either have functions named pru_io_<function_name>, or have files that are named <filename>_pru_io. Remove all of these unneeded pru_io references. Paths to the MCU+ SDK with /pru_io/ in the path are preserved. TODO: Re-run these commands after these PRs are merged: * #8 * #81 Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
Most projects either have functions named pru_io_<function_name>, or have files that are named <filename>_pru_io. Remove all of these unneeded pru_io references. Paths to the MCU+ SDK with /pru_io/ in the path are preserved. TODO: Re-run these commands after these PRs are merged: * #8 * #81 Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
Most projects either have functions named pru_io_<function_name>, or have files that are named <filename>_pru_io. Remove all of these unneeded pru_io references. Paths to the MCU+ SDK with /pru_io/ in the path are preserved. TODO: Re-run these commands after these PRs are merged: * #8 * #81 * #87 grep -rli '_pru_io' | xargs -i@ sed -i 's/_pru_io//g' @ grep -rli 'pru_io_' | xargs -i@ sed -i 's/pru_io_//g' @ Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
|
@rajul-bhambay Please move the firmware sources to example folder from firmware to align with rest of the examples as discussed. We can merge post that |
Most projects either have functions named pru_io_<function_name>, or have files that are named <filename>_pru_io. Remove all of these unneeded pru_io references. Paths to the MCU+ SDK with /pru_io/ in the path are preserved. TODO: Re-run these commands after these PRs are merged: * #8 grep -rli '_pru_io' | xargs -i@ sed -i 's/_pru_io//g' @ grep -rli 'pru_io_' | xargs -i@ sed -i 's/pru_io_//g' @ Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
User description
Fixes: PINDSW-8487
PR Type
Enhancement
Description
• Complete PRU I2S driver implementation with comprehensive API for initialization, open/close, read/write operations
• Support for both I2S and TDM4 modes with interleaved/non-interleaved data format conversion
• PRU firmware binaries and assembly code for both TX and RX operations on PRU0 and PRU1
• Interrupt handling with callback mechanisms for Tx, Rx, and error events
• Hardware abstraction layer for PRU firmware loading, ICSS INTC configuration, and GPIO setup
• Diagnostic application with FreeRTOS support for AM263X and AM261X platforms
• TCA6416 IO expander driver for hardware configuration
• Build system integration with makefiles, linker scripts, and project configurations
• Runtime Object View (ROV) configuration for debugging support
Diagram Walkthrough
File Walkthrough
20 files
pru_i2s_drv.c
Complete PRU I2S driver implementation with hardware abstractionsource/pru_i2s/driver/pru_i2s_drv.c
• Complete PRU I2S driver implementation with initialization,
open/close, read/write operations
• Support for both interleaved and
non-interleaved data formats with conversion functions
• Interrupt
handling for Tx, Rx, and error events with callback mechanisms
•
Hardware abstraction for PRU firmware loading, ICSS INTC
configuration, and GPIO setup
main.c
FreeRTOS main application for AM263x PRU I2S diagnosticexamples/pru_i2s_diagnostic/single_channel/am263x-cc/r5fss0-0_freertos/main.c
• FreeRTOS main application entry point for AM263x platform
• Task
creation and scheduler initialization for PRU I2S diagnostic example
•
System and board initialization with proper task stack allocation
pru_i2s_drv.h
PRU I2S Driver Header Implementationsource/pru_i2s/include/pru_i2s_drv.h
• Complete PRU I2S driver header file with comprehensive API
definitions
• Defines data structures for configuration, parameters,
and I/O buffers
• Includes function declarations for driver
initialization, open/close, read/write operations
• Contains
hardware-specific constants and register definitions for AM263X and
AM261X SoCs
pru_i2s_diagnostic.c
PRU I2S Diagnostic Application Implementationexamples/pru_i2s_diagnostic/pru_i2s_diagnostic.c
• Complete diagnostic application for PRU I2S functionality testing
•
Implements Tx/Rx interrupt handlers with error handling and statistics
tracking
• Supports both TDM and I2S modes with configurable firmware
selection
• Includes I2C IO expander configuration for AM263X hardware
setup
icss_pru_i2s_fw.h
TDM4 Firmware Register Definitionssource/pru_i2s/firmware/TDM4/icss_pru_i2s_fw.h
• Firmware register definitions and bit field mappings for TDM4 mode
•
Defines register offsets, addresses, and bit field masks for PRU I2S
firmware
• Includes ping-pong buffer control and error status register
definitions
icss_pru_i2s_fw.h
I2S Firmware Register Definitionssource/pru_i2s/firmware/I2S/icss_pru_i2s_fw.h
• Firmware register definitions and bit field mappings for standard
I2S mode
• Identical structure to TDM4 version with same register
layout and definitions
• Provides firmware interface constants for I2S
protocol implementation
ioexp_tca6416.c
TCA6416 IO Expander Driver Implementationexamples/pru_i2s_diagnostic/board/ioexp_tca6416.c
• I2C IO expander driver implementation for TCA6416 chip
• Provides
functions for opening, configuring, and controlling GPIO pins
•
Includes I2C transaction handling and register read/write operations
pru_i2s_interface.h
New I2S firmware interface header with pin configurationssource/pru_i2s/firmware/I2S/pru_i2s_interface.h
• Added new assembly header file defining I2S interface constants and
pin configurations
• Includes conditional compilation for different
SoCs (AM263X, AM261X) and PRU instances
• Defines pin mappings, buffer
addresses, error positions, and interrupt event numbers
• Contains
configuration for both TX and RX I2S instances with different pin
assignments
pru_i2s_interface.h
New TDM4 firmware interface header with TDM-specific configurationssource/pru_i2s/firmware/TDM4/pru_i2s_interface.h
• Added TDM4 variant of I2S interface header with similar structure to
I2S version
• Includes same SoC and PRU conditional compilation
support
• Defines TDM-specific constants like
TDM_CHANNELSandMAX_TDM_CHANNELS• Contains different
BYTES_TO_LOADvalue (2) andsamples per channel (16) for TDM mode
data.h
I2S diagnostic example data definitions and buffer configurationsexamples/pru_i2s_diagnostic/data.h
• Added comprehensive data definitions for I2S diagnostic example
•
Defines buffer sizes, constants for audio processing, and error
handling
• Includes ping-pong buffer configurations and memory layout
definitions
• Contains pre-initialized TX buffer data with test
patterns
ioexp_tca6416.h
TCA6416 IO expander driver header with complete APIexamples/pru_i2s_diagnostic/board/ioexp_tca6416.h
• Added complete TCA6416 IO expander driver header file
• Defines API
functions for opening, configuring, and controlling IO expander
•
Includes data structures for configuration parameters and attributes
•
Provides constants for input/output modes and pin states
pru_i2s_tdm4_pru0_array.h
PRU0 TDM4 firmware binary arraysource/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru0_array.h
• Added compiled PRU0 firmware binary array for TDM4 mode
• Contains
both instruction array (
pru_prupru_i2s0_image_0_0) and data array•
Provides pre-compiled firmware ready for loading into PRU0
pru_i2s_pru0_array.h
PRU0 I2S firmware binary arraysource/pru_i2s/firmware/I2S/pru_i2s_pru0_array.h
• Added compiled PRU0 firmware binary array for standard I2S mode
•
Contains instruction and data arrays for PRU0 I2S firmware
• Provides
pre-compiled firmware binary ready for deployment
pru_i2s_tdm4_pru1_array.h
PRU1 TDM4 firmware binary arraysource/pru_i2s/firmware/TDM4/pru_i2s_tdm4_pru1_array.h
• Added compiled PRU1 firmware binary array for TDM4 mode
• Contains
instruction array and data array for PRU1 TDM4 firmware
• Provides
pre-compiled firmware for PRU1 in TDM4 configuration
pru_i2s_pru1_array.h
PRU1 I2S firmware binary arraysource/pru_i2s/firmware/I2S/pru_i2s_pru1_array.h
• Added compiled PRU1 firmware binary array for standard I2S mode
•
Contains instruction and data arrays for PRU1 I2S firmware
• Provides
pre-compiled firmware binary for PRU1 deployment
pru_i2s_regs.h
TDM4 PRU register definitions and mappingssource/pru_i2s/firmware/TDM4/pru_i2s_regs.h
• Added TDM4-specific register definitions and assignments
• Defines
PRU register mappings for TX/RX operations, counters, and buffers
•
Includes conditional compilation for different I2S modes (TX/RX)
•
Contains register assignments for ping-pong buffers and status
tracking
pru_i2s_regs.h
I2S PRU register definitions and mappingssource/pru_i2s/firmware/I2S/pru_i2s_regs.h
• Added I2S-specific register definitions and assignments
• Defines
PRU register mappings similar to TDM4 but for standard I2S
• Includes
register assignments for audio data, buffers, and control
• Contains
conditional compilation for TX/RX modes and profiling
main.c
AM261X I2S diagnostic main application with FreeRTOSexamples/pru_i2s_diagnostic/single_channel/am261x-lp/r5fss0-0_freertos/main.c
• Added main application file for AM261X LaunchPad I2S diagnostic
•
Implements FreeRTOS-based main function with task creation
• Calls
pru_i2s_diagnostic_mainfunction and handles task management•
Includes standard system and board initialization
fw_regs.asm
I2S firmware register initialization assemblysource/pru_i2s/firmware/I2S/fw_regs.asm
• Added firmware register initialization assembly file for I2S
•
Defines firmware register section with configuration values
• Includes
conditional compilation for different TX configurations
• Sets up pin
numbers, buffer addresses, and system event numbers
fw_regs.asm
TDM4 firmware register initialization assemblysource/pru_i2s/firmware/TDM4/fw_regs.asm
• Added firmware register initialization assembly file for TDM4
•
Similar structure to I2S version with TDM4-specific configurations
•
Defines register section with buffer addresses and pin assignments
•
Includes conditional compilation for different modes and PRU instances
8 files
pru_i2s_pruss_intc_mapping.h
PRUSS interrupt controller mapping definitions and macrossource/pru_i2s/include/pru_i2s_pruss_intc_mapping.h
• PRUSS interrupt controller mapping definitions and constants
•
System event, channel, and host interrupt mapping macros
• INTC
initialization data structure template with proper MISRA C compliance
syscfg_c.rov.xs
ROV configuration for AM261x FreeRTOS debuggingexamples/pru_i2s_diagnostic/single_channel/am261x-lp/r5fss0-0_freertos/ti-arm-clang/syscfg_c.rov.xs
• Runtime Object View (ROV) configuration file for debugging support
•
FreeRTOS ROV integration for AM261x platform
product.json
Product Metadata Configuration Update.metadata/product.json
• Added include path for sysconfig directory
• Added "/open_pru"
component to the components list
pru_i2s_master_icss.cmd
I2S PRU firmware linker command filesource/pru_i2s/firmware/I2S/pru_i2s_master_icss.cmd
• Added linker command file for I2S PRU firmware
• Defines memory
layout for ICSSG PRU with instruction and data memory sections
•
Includes peripheral memory mappings and section allocations
•
Configures firmware registers, output samples, and debug buffer
sections
pru_i2s_master_icss.cmd
TDM4 PRU firmware linker command filesource/pru_i2s/firmware/TDM4/pru_i2s_master_icss.cmd
• Added linker command file for TDM4 PRU firmware
• Identical
structure to I2S linker file with same memory layout
• Defines ICSSG
memory sections and peripheral mappings
• Configures section
allocations for TDM4 firmware variant
syscfg_c.rov.xs
ROV configuration for FreeRTOS debuggingexamples/pru_i2s_diagnostic/single_channel/am263x-cc/r5fss0-0_freertos/ti-arm-clang/syscfg_c.rov.xs
• Added Runtime Object View (ROV) configuration file
• Defines ROV
files for FreeRTOS debugging support
• Simple configuration file for
debugging tools integration
makefile_ccs_bootimage_gen
Boot image generation makefile with security featuresexamples/pru_i2s_diagnostic/single_channel/am261x-lp/r5fss0-0_freertos/ti-arm-clang/makefile_ccs_bootimage_gen
• Added comprehensive makefile for boot image generation
• Defines
build targets for different image formats (appimage, MCELF, signed)
•
Includes multi-core image generation and XIP support
• Contains
security features like image signing and encryption
makefile
Added I2S diagnostic example to build systemexamples/makefile
• Added
pru_i2s_diagnosticto the list of subdirectories to build•
Simple one-line addition to include new example in build system
37 files