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.

[参考译文] AM62A7:在 System_init 函数之前在 SBL 中使用 i2c

Guru**** 2032800 points
Other Parts Discussed in Thread: SYSCONFIG
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1391930/am62a7-using-i2c-in-sbl-before-the-system_init-function

器件型号:AM62A7
主题中讨论的其他器件:SysConfig

工具与软件:

您好、TI:

我们想要在 SBL 的第一级初始化 DDR 之前使用 i2c 配置 PMIC、但发现初始化 DDR 和 i2c 的代码位于 System_init 函数中、该函数已自动生成。 在初始化 DDR 之前、我需要执行什么操作才能使用 I2C?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你好、吴

    感谢您的提问。

    请确认您是否在讨论屏幕截图顶部提到的文件目录?

    请允许我们在 System_init ()内部查看 I2C 初始化的位置,因为根据我的理解 Drivers_open ()负责此功能。

    请期待在几个工作日内得到回复。

    此致、

    Vaibhav

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你好 

    我所说的正是屏幕截图上的文件,很抱歉我再次确认 I2C 初始化在 Drivers_open() 函数中。

    DDR 的初始化在 System_init()中、它还会配置时钟、以此类推。

    但我们要在 DDR 初始化之前配置 PMIC、此过程需要 I2C。

    根据我的理解,我应该不能修改 System_init(),因为它是自动生成的。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、Wu

    感谢您的耐心。

    根据我的理解、我不应该修改 System_init ()、因为它是自动生成的。

    是的、以上理解是正确的。 您将无法编辑 system_init() 因为它是通过 SysConfig 自动生成的。

    若要按用户定义的顺序初始化外设、可创建另一个包含名称的函数  _System_init() 并复制生成的 SysConfig 内容 system_init() 位置。 可以在自定义函数中更改外设初始化的顺序。  

    现在在 main.c 中注释 System_init()函数调用并调用创建的自定义函数。

    请查找以下示例代码。

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /* main.c */
    void _System_init(void)
    {
    /* DPL init sets up address transalation unit, on some CPUs this is needed
    * to access SCICLIENT services, hence this needs to happen first
    */
    Dpl_init();
    /* We should do sciclient init before we enable power and clock to the peripherals */
    /* SCICLIENT init */
    {
    int32_t retVal = SystemP_SUCCESS;
    retVal = Sciclient_direct_init();
    DebugP_assertNoLog(SystemP_SUCCESS == retVal);
    }
    PowerClock_init();
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    请告知我们上述解决方案是否有效。

    此致、

    Tushar