德州仪器
直播中

李麒铭

7年用户 1438经验值
私信 关注
[问答]

在SAMA5D4 xplained Ultra上编写Linux应用程序

我在SAMA5D4 xPlained Ultra板上设置了一个自定义的ubuntu内核。
我已按照eewiki网站上的说明进行操作,现在已启动并运行该板。
我现在想要编写一个非常简单的应用程序,以便在按下按钮时执行操作。
不幸的是,我无法在任何地方找到任何有关如何执行此操作的文档。
我已经交叉编译了一个hello world app,但就是这样。
你能为我指出正确的方向吗?
提前致谢!

以上来自于谷歌翻译


以下为原文

        I am setting up a custom ubuntu kernel on the SAMA5D4 xPlained Ultra board. I have followed the instructions on the eewiki site, and now have the board up and running. I now want to write a very simple app to carry out an action when the button is pressed on the board. Unfortunately I am unable to find any documentation anywhere on how to do this. I have cross compiled a hello world app, but that’s it. Can you point me in the right direction? Thanks in advance!

回帖(4)

郭雨桐

2018-10-24 15:59:09
你好,约翰,
抱歉耽搁了。
一种解决方案是使用gpio-keys绑定:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/input/gpio-keys.txt
您必须有一个等待该按键的应用程序,以产生您的实际应用程序。
问候,

以上来自于谷歌翻译


以下为原文

        Hi John,
Sorry for the delay.
One solution would be to use the gpio-keys binding:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/input/gpio-keys.txt
You’d have to have an application waiting for that keypress, to spawn your actual appilcation.
Regards,
举报

李一天

2018-10-24 16:10:53
嗨罗伯特,
谢谢你的建议。
但是,我的问题比基本更重要
这个!
除了非常简单之外,我完全无法编译任何东西
你好,世界。
我应该在原帖中更具体。
我需要
知道:
使用什么编译器版本
要使用哪些编译器选项
其中包括要使用的文件/目录
从内核和/或链接到哪些对象/库文件
工具链。
目前,我只是因不兼容而导致无休止的错误
应用程序之间,包含头文件和库 - 如此
作为硬浮动还是软浮动,VFP是否注册,遗留构造在
头文件。
我试图使用完全相同的编译器
对于应用程序开发的内核,但即便如此
有问题的。
任何提示或答案都会很棒!
我花了很多钱
令人沮丧的时间,似乎没有任何进展。
谢谢
约翰
约翰弗兰克姆
剑桥•创新•合作伙伴关系
07803 035490

以上来自于谷歌翻译


以下为原文

        Hi Robert,
Thanks for the suggestion. However, my question was more basic than
this! I am completely unable to compile anything beyond the very simple
helloworld. I should have been more specific in my original post. I need
to know:

  • What compiler version to use
  • What compiler options to use
  • which include files / directories to use
  • which object / library files to link to from the kernel and / or the
    toolchain.
At present, I just get endless errors caused by incompatibilities
between the application, included header files and the libraries - such
as hard or soft float, VFP registers or not, legacy constructs in the
header files. I am trying to use exactly the same compiler that was used
for the kernel for the application development, but even that seems
problematic.
Any hints or answers to this would be fantastic! I have spent many
frustrating hours and seem to be making no progress at all.
Thanks
John
John Frankham
cambridge•innovation•partnership
07803 035490
举报

郭雨桐

2018-10-24 16:21:32
你好,约翰,
这就是你应该在你的SAMA5D4上运行Debian或Ubuntu的原因,正如答案所示。
使用由Debian / Ubuntu提供的apt安装的gcc和库版本。
内核永远不会在启用浮点的情况下构建,因此您可以使用本机或基于x86的交叉编译器来构建它。
只需在SAMA5D4上构建您的应用程序,所有二进制文件和库都已根据此规范为Debian / Ubuntu的“ARMHF”编译:https://wiki.debian.org/ArmHardFloatPort
问候,

以上来自于谷歌翻译


以下为原文

        Hi John,
This is why you should run Debian or Ubuntu on your SAMA5D4, as the answer is. Use the version of gcc and libraries installed by apt provided by Debian/Ubuntu.  The kernel is never built with floating point enabled, so you can use native or a x86 based cross compiler to build it.  Just build your application on the SAMA5D4, all the binaries and libraries are already compiled for Debian/Ubuntu’s “ARMHF” based on this spec: https://wiki.debian.org/ArmHardFloatPort
Regards,
举报

李宏

2018-10-24 16:32:04
RobertCNelson:
你好,约翰,
抱歉耽搁了。
一种解决方案是使用gpio-keys绑定:
https://git.kernel.org/cgit/pc/kernel/git/torvalds/linux.git/tree/Documentation/mobiletree/bindings/input/gpio-keys.txt
您必须有一个等待该按键的应用程序,以产生您的实际应用程序。
问候,
我在编写应用程序时遇到了类似的问题但是我在使用gpio-keys绑定时解决了它。
非常感谢@RobertCNelson的解决方案。
非常感谢

以上来自于谷歌翻译


以下为原文

         RobertCNelson:
Hi John,
Sorry for the delay.
One solution would be to use the gpio-keys binding:
https://git.kernel.org/cgit/pc/kernel/git/torvalds/linux.git/tree/Documentation/mobiletree/bindings/input/gpio-keys.txt
You’d have to have an application waiting for that keypress, to spawn your actual appilcation.
Regards,
I was facing a similar issue while writing an application however I got it solved on using gpio-keys binding. Thanks a lot for the solution @RobertCNelson. Really appreciated
举报

更多回帖

发帖
×
20
完善资料,
赚取积分