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.

[参考译文] AM4376:Python 脚本自动运行

Guru**** 2551110 points
Other Parts Discussed in Thread: AM4376, TMDSEVM437X

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/606254/am4376-python-script-autorun

器件型号:AM4376
主题中讨论的其他器件:TMDSEVM437X

您好!

我想在 SDK 中添加我的 python 脚本、然后  在其加电时在 TI AM4376 EVM 板上运行它。

我怎么能做到这一点?

此致、

Dhara

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    软件团队已收到通知。 他们将在这里作出回应。
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    非常感谢

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

    您好 Dhara、

    您可以创建个在启动时启动 python 脚本的 systemd 服务。
    请查看 帖子以了解更多信息。

    此致、
    Kemal

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

    我有 TI AM4376 EVM 板- TMDSEVM437X (www.ti.com/.../tmdsevm437x )、它已经安装了可引导 SD 卡及其库文件和 SDK。

    我想在 SD 卡中添加我的脚本以及此 SDK、并将其加载到 EVM 板中。 首先、我编写了一个基本代码、以打印"hello world"。

    我该怎么做???

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

    将其粘贴到您的终端上、然后检查其功能:

    Cat << EOM >/lib/systemd/system/dhara.service
    [装置]
    描述= Dhara
    Before = serial-getty@ttyO2.servICE
    
    [服务]
    ExecStart=/usr/bin/python /home/root/dhara.py
    StandardOutput=journal+console
    
    [安装]
    WantedBy=multi-user.target
    EOM
    cat << EOM >/home/root/dhara.py
    print ("Hello World!")
    EOM
    
    chmod 644 /lib/systemd/system/dhara.service
    chmod 755 /home/root/dhara.py
    systemctl 启用 dhara.service
    systemctl daemon-reload
    ls