你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

STM32MP135D OPTEE I2C配置问题?

[复制链接]
FanS2018 提问时间:2024-9-10 09:59 / 未解决

大家好!

我使用的是STM32MP135DAE7,官方TF-A、OPTEE源码中使用I2C4挂载PMIC,我更改为I2C5后,程序下载失败,相关配置内容如下。请各位大神帮忙,看看哪有不妥?

1.TF-A中:

dts中与I2C4源码相比,更换了I2C5接口,指定I2C5时钟源CLK_I2C5_HSI

i2c5 { pinctrl-names = "default"; pinctrl-0 = <&i2c5_pins_a>; i2c-scl-rising-time-ns = <185>; i2c-scl-falling-time-ns = <20>; clock-frequency = <400000>; status = "okay";

    pmic: stpmic@33 {
            compatible = "st,stpmic1";
            reg = <0x33>;

            status = "okay";

            regulators {
                    compatible = "st,stpmic1-regulators";
                    buck1-supply = <&vin>;
                    buck2-supply = <&vin>;
                    buck3-supply = <&vin>;
                    buck4-supply = <&vin>;
                    ldo1-supply = <&vin>;
                    ldo2-supply = <&vin>;//llsdtest
                    ldo4-supply = <&vin>;
                    ldo5-supply = <&vin>;
                    ldo6-supply = <&vin>;
                    vref_ddr-supply = <&vin>;
                    pwr_sw1-supply = <&bst_out>;
                    pwr_sw2-supply = <&v3v3_ao>;

                    vddcpu: buck1 {
                            regulator-name = "vddcpu";
                            regulator-min-microvolt = <1350000>;
                            regulator-max-microvolt = <1350000>;
                            regulator-always-on;
                            regulator-over-current-protection;
                    };

                    vdd_ddr: buck2 {
                            regulator-name = "vdd_ddr";
                            regulator-min-microvolt = <1350000>;
                            regulator-max-microvolt = <1350000>;
                            regulator-always-on;
                            regulator-over-current-protection;
                    };

                    vdd: buck3 {
                            regulator-name = "vdd";
                            regulator-min-microvolt = <3300000>;
                            regulator-max-microvolt = <3300000>;
                            regulator-always-on;
                            st,mask-reset;
                            regulator-over-current-protection;
                    };

                    vddcore: buck4 {
                            regulator-name = "vddcore";
                            regulator-min-microvolt = <1250000>;
                            regulator-max-microvolt = <1250000>;
                            regulator-always-on;
                            regulator-over-current-protection;
                    };

                    vdd_adc: ldo1 {
                            regulator-name = "vdd_adc";
                            regulator-min-microvolt = <2500000>;
                            regulator-max-microvolt = <2500000>;
                            regulator-always-on;//llsdtest
                    };

                    /*llsdtest*/
                    vdd_v3v3: ldo2 {
                            regulator-name = "vdd_v3v3";
                            regulator-min-microvolt = <3300000>;
                            regulator-max-microvolt = <3300000>;
                            regulator-always-on;
                    };

                    vdd_usb: ldo4 {
                            regulator-name = "vdd_usb";
                            regulator-min-microvolt = <3300000>;
                            regulator-max-microvolt = <3300000>;
                            regulator-always-on;
                    };

                    vdd_sd: ldo5 {
                            regulator-name = "vdd_sd";
                            regulator-min-microvolt = <3300000>;
                            regulator-max-microvolt = <3300000>;
                            //regulator-boot-on;
                            regulator-always-on;
                    };

                    v1v8_periph: ldo6 {
                            regulator-name = "v1v8_periph";
                            regulator-min-microvolt = <1100000>;
                            regulator-max-microvolt = <1100000>;
                            regulator-always-on;
                    };

                    vref_ddr: vref_ddr {
                            regulator-name = "vref_ddr";
                            regulator-always-on;
                    };

                    bst_out: boost {
                            regulator-name = "bst_out";
                    };

                    v3v3_sw: pwr_sw2 {
                            regulator-name = "v3v3_sw";
                            regulator-active-discharge = <1>;
                            regulator-always-on;
                    };
            };
    };

};

rcc { //secure-status = "disable"; st,clksrc = < CLK_MPU_PLL1P CLK_AXI_PLL2P CLK_MLAHBS_PLL3 CLK_CKPER_HSE CLK_RTC_LSE CLK_SDMMC1_PLL4P CLK_SDMMC2_PLL4P CLK_STGEN_HSE CLK_USBPHY_HSE //CLK_I2C4_HSI//llsd CLK_I2C5_HSI//llsd CLK_USBO_USBPHY CLK_I2C12_HSI CLK_UART2_HSI CLK_UART4_HSI

; };

2.OPTEE中:

dts中与I2C4比,修改了节点&etzpc,加密的GPIO由I2C4改为I2C5,更换I2C接口,定义I2C5时钟源

&etzpc { st,decprot = < DECPROT(STM32MP1_ETZPC_ADC1_ID, DECPROT_NS_RW, DECPROT_UNLOCK) DECPROT(STM32MP1_ETZPC_ADC2_ID, DECPROT_NS_RW, DECPROT_UNLOCK) DECPROT(STM32MP1_ETZPC_BKPSRAM_ID, DECPROT_S_RW, DECPROT_UNLOCK)

            DECPROT(STM32MP1_ETZPC_DCMIPP_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
            DECPROT(STM32MP1_ETZPC_DDRCTRLPHY_ID, DECPROT_NS_R_S_W, DECPROT_UNLOCK)
            DECPROT(STM32MP1_ETZPC_ETH1_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
            DECPROT(STM32MP1_ETZPC_ETH2_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
            DECPROT(STM32MP1_ETZPC_FMC_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
            DECPROT(STM32MP1_ETZPC_HASH_ID, DECPROT_S_RW, DECPROT_UNLOCK)//llsd
            DECPROT(STM32MP1_ETZPC_I2C3_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
            DECPROT(STM32MP1_ETZPC_I2C4_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
            DECPROT(STM32MP1_ETZPC_I2C5_ID, DECPROT_S_RW, DECPROT_UNLOCK)//llsd1
            ......
      >;

};

&gpiof { st,protreg = < (TZPROT(3)) >; };

&gpiod { st,protreg = < (TZPROT(7)) >; };

&gpioh { st,protreg = < (TZPROT(13)) >; };

&gpiof { st,protreg = < (TZPROT(8)) >; };

&i2c5 { pinctrl-names = "default"; pinctrl-0 = <&i2c5_pins_a>; i2c-scl-rising-time-ns = <185>; i2c-scl-falling-time-ns = <20>; clock-frequency = <400000>; status = "okay";

    /*llsd2*/
    pmic: stpmic@33 {
    ......
    };

};

&rcc { compatible = "st,stm32mp13-rcc", "syscon"; //pinctrl-0 = <&rcc_mco_pins_a>; pinctrl-names = "default";

    st,clksrc = <
            CLK_MPU_PLL1P
            CLK_AXI_PLL2P
            CLK_MLAHBS_PLL3
            CLK_RTC_LSE
            CLK_MCO1_HSE
            CLK_MCO2_DISABLED
            CLK_CKPER_HSE
            CLK_ETH1_PLL4P
            CLK_ETH2_PLL4P
            CLK_SDMMC1_PLL4P
            CLK_SDMMC2_PLL4P
            CLK_STGEN_HSE
            CLK_USBPHY_HSE
            //CLK_I2C4_HSI//llsd
            CLK_I2C5_HSI//llsd
      ......
      >

...... };

比较怀疑是OPTEE配置问题,参照I2C4配置的,还未看出有什么不妥,麻烦大家了,谢谢

收藏 评论1 发布时间:2024-9-10 09:59

举报

1个回答
STMCU-管管 回答时间:2024-10-10 16:35:52

你已经将I2C5的时钟源设置为CLK_I2C5_HSI。确保这个时钟源已经被正确配置,并且I2C5的时钟频率符合PMIC的要求。STM32MP系列的I2C时钟频率通常设置为400kHz

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32Cube扩展软件包
意法半导体边缘AI套件
ST - 理想汽车豪华SUV案例
ST意法半导体智能家居案例
STM32 ARM Cortex 32位微控制器
关注我们
st-img 微信公众号
st-img 手机版