This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: RTOS SDK - 如何修改預設I2C bus

Part Number: TDA4VM


如題, 因為我司的相機只支持FPC接口,所以只能使用其他組的I2C bus (I2C3).

簡單來說原本SDK預設是I2C1, 現在需要把I2C3也移到RTOS使用

使用條件: I2C3 <-> I2C mux <-> I2C8 <-> DS960 DES <-> cable <-> DS960 SER <-> OV5640

我在Linux下這條路是可以執行的,但沒辦法使用virtual channel這個功能(只能跑一路), 老美官方回應是說virtual chanel這功能只有實作在RTOS.

SDK版本: ti-processor-sdk-rtos-j721e-evm-08_01_00_13

嘗試自己改一下發現我找不到改I2C bus的地方, 修改如下:

1. Linux SDK要修改 arch/arm64/boot/dts/ti/k3-j721e-vision-apps.dts

&main_i2c3 {
   status = "disabled";
};

2. RTOS SDK需要新增i2c pinmux設定, 我是設定在vision_apps如下:

utils/misc/src/app_pinmux.c

int32_t appInit()
app_pinmux_cfg_t pinmux_cfg;

#ifdef ENABLE_DSS_HDMI
pinmux_cfg.enable_hdmi = TRUE;
#endif
@@ -392,6 +392,8 @@ dsfjsdhfjkh
pinmux_cfg.enable_i2c1 = TRUE; /* i2c is needed for on board HDMI mux config, eDP to HDMI adapter config */
#endif

+ pinmux_cfg.enable_i2c3 = TRUE; /* TN i2c3 mux */
+
appSetPinmux(&pinmux_cfg);
}

utils/misc/include/app_misc.h

@@ -79,6 +79,7 @@ typedef struct
{
uint32_t enable_hdmi;
uint32_t enable_i2c1;
+ uint32_t enable_i2c3;
} app_pinmux_cfg_t;

platform/j721e/rtos/common/app_init.c

+static pinmuxPerCfg_t gI2c3PinCfg[] =
+{
+ /* MyI2C3 -> I2C3_SCL -> T26 */
+ {
+ PIN_MMC2_CLK, PIN_MODE(4) | \
+ ((PIN_PULL_DIRECTION | PIN_INPUT_ENABLE) & (~PIN_PULL_DISABLE))
+ },
+ /* MyI2C3 -> I2C3_SDA -> T25 */
+ {
+ PIN_MMC2_CMD, PIN_MODE(4) | \
+ ((PIN_PULL_DIRECTION | PIN_INPUT_ENABLE) & (~PIN_PULL_DISABLE))
+ },
+
+ {PINMUX_END}
+};

另外我在imaging資料夾下的iss_sensors.c 試著打印目前i2c的接口

執行single_camera_demo時發現依然是6, 請問我還需要改哪裡嗎

謝謝