【发布时间】:2016-03-22 11:59:18
【问题描述】:
我正在制作一个从天线发出 40khz 信号的项目。 我发现信号不太准确,所以我决定尝试实时内核。
我在我的 Raspberry-Pi 2B 上运行 Raspbian Jessie。 全新安装后,脚本运行没有任何问题。 bcm2835_delayMicroseconds 可以运行。
我按照本教程http://www.frank-durr.de/?p=203 编译并安装了 RT 内核。 但是,该脚本无法再成功运行。 显示“HIGH SLEEP”后,它被暂停了。
这是代码sn-p:
fprintf(stdout , "HIGH\n");
bcm2835_gpio_write(PIN, HIGH);
fprintf(stdout , "SLEEP\n");
bcm2835_delayMicroseconds(12);
fprintf(stdout , "LOW\n");
bcm2835_gpio_write(PIN, LOW);
fprintf(stdout , "SLEEP\n");
bcm2835_delayMicroseconds(12);
编译内核时有什么遗漏吗?
【问题讨论】:
-
你能不能试着写一个除了delayMicroseconds什么都不做的程序并调试它?
-
这是其他人报告几乎相同的问题(但后来它自行消失了):groups.google.com/forum/#!topic/bcm2835/ys4aWbllqjo
-
@JohnZwinck 我对C不熟悉。如何调试它?运行时错误是否有任何错误日志?谢谢。
-
#include
#include #include #include #define PIN RPI_V2_GPIO_P1_07 int main(int argc, char *argv[ ]){ fprintf(stdout , "开始\n"); if( bcm2835_init() -
刚刚写了一个小脚本,第一个“SLEEP”之后就挂了……
标签: linux real-time raspbian preempt-rt