你好:
我用的板子是beagleboneblack,按照TI的PRU Training: Hands-on Labs例子一步步调试LAB 4: Introduction to Linux driver。
1.firmware编译也成功。
2.linux按例子烧到SD卡启动,SD是按照默认系统烧录
3.按例子把对应文件拷贝到文件系统
实际执行时,也没任何提示错误,但对应的LED灯没闪烁。后面我添加了一段全部闪烁代码,对应IO口也没任何反应,不知是哪里出错了,还是缺了什么配置,急切盼望解答!!!
修改后的例子:
#include <stdint.h> #include <pru_cfg.h> /*TODO: Include intc.h */ #include <pru_intc.h> #include "resource_table_1.h" volatile register uint32_t __R30; volatile register uint32_t __R31; /* Defines */ #define PRU1 #define HOST1_MASK (0x80000000) #define PRU0_PRU1_EVT (16) /*TODO: Define toggling the BLUE LED */ #define TOGGLE_BLUE (__R30 ^= (1 << 3)) void main(){ volatile uint32_t gpo; /* Configure GPI and GPO as Mode 0 (Direct Connect) */ CT_CFG.GPCFG0 = 0x0000; /* Clear GPO pins */ __R30 &= 0xFFFF0000; /* Spin in loop until interrupt on HOST 1 is detected */ while(1){ #if 1 // TOGGLE_BLUE; // __delay_cycles(100000000); gpo = __R30; gpo ^= 0xF; __R30 = gpo; __delay_cycles(100000000); // half-second delay #else if (__R31 & HOST1_MASK){ TOGGLE_BLUE; /* Clear interrupt event */ CT_INTC.SICR = 16; /*TODO: Clear event 16*/; /* Delay to ensure the event is cleared in INTC */ __delay_cycles(5); } #endif } }
一位TI芯片的老程序员。
Jian Zhou:
你的PRU程序在CCS下调试可以正常工作么?
tao jiang6:
回复 Jian Zhou:
公司没购买仿真器,我直接在linux下跑的。请问仿真器买哪款?我是beaglebone black板子
tao jiang6:
回复 Jian Zhou:
我淘宝购买个xds100v2可以吗?
Jian Zhou:
回复 tao jiang6:
可以,BBB的板子上要焊一个JTAG插针。
tao jiang6:
回复 Jian Zhou:
ccs6下通过jtag跑例子,出现问题
CortxA8: Output: ****** PRU Cape PINMUX is being configured ***** PRU_Cape_Init() cannot be evaluated.Could not write 0x44E10990: execution state prevented access at *((unsigned int *) 0x44e10990)=(0|5) [PRU_CAPE.gel:40] at PRU_PINMUX_Config() [PRU_CAPE.gel:25] at PRU_Cape_Init()
请帮忙指导下