8M板子,测距初始化完成,接收数据的时候貌似是堆栈溢出,求解
/* Clear reception timeout to start next ranging process. */dwt_setrxtimeout(0);
printf("清除接收超时以开始下一个测距过程 \r\n");
/* Activate reception immediately. */
dwt_rxenable(0);
printf("接收使能 \r\n");
/* Poll for reception of a frame or error/timeout. See NOTE 7 below. */
while (!((status_reg = dwt_read32bitreg(SYS_STATUS_ID)) & (SYS_STATUS_RXFCG | SYS_STATUS_ALL_RX_ERR)))
{ };
if (status_reg & SYS_STATUS_RXFCG)
{
/* Clear good RX frame event in the DW1000 status register. */
dwt_write32bitreg(SYS_STATUS_ID, SYS_STATUS_RXFCG | SYS_STATUS_TXFRS);
/* A frame has been received, read it into the local buffer. */
frame_len = dwt_read32bitreg(RX_FINFO_ID) & RX_FINFO_RXFL_MASK_1023;
if (frame_len <= RX_BUFFER_LEN)
{
dwt_readrxdata(rx_buffer, frame_len, 0);
}
/* Check that the frame is a poll sent by "DS TWR initiator" example.
* As the sequence number field of the frame is not relevant, it is cleared to simplify the validation of the frame. */
printf("判断是否是测距发起者 \r\n");
if(rx_buffer%ANCHOR_MAX_NUM != ANCHOR_IND)
continue;
死在了红色代码。。。。 米兰卡 发表于 2019-4-26 09:26
死在了红色代码。。。。
把里面printf 去掉,用LED观察现象 注释掉了。。然后debug 死在了这。。 米兰卡 发表于 2019-4-26 09:59
注释掉了。。然后debug 死在了这。。
你STM32 型号是什么?
你怎么判断死到红色标记的地方? 红色标记的地方?
你的板子有LED嘛? 用LED指示程序跑到的位置,不要用printf
printf 会占用太多时间,导致无线收发数据有问题
C8T6 没焊LED。。。
用的debug,,void decamutexoff(decaIrqStatus_t s) //在这里放置一个函数,在关键部分结束时重新启用中断
{
if(s) { //需要检查端口状态,因为我们不能在STM ARM上使用级别敏感中断
port_EnableEXT_IRQ();
}
}这个函数之后
return 0 之后就跳到了while 1硬件故障。。
R14 0xFFFFFFF9 供电问题。。= = 但是又不行了。。。 米兰卡 发表于 2019-4-26 11:33
但是又不行了。。。
这个后期旺旺交流得知结果应该是连线问题
希望下次登陆论坛把最后处理结果方法写一些,多谢! tuzhuke 发表于 2019-4-30 16:03
这个后期旺旺交流得知结果应该是连线问题
希望下次登陆论坛把最后处理结果方法写一些,多谢!
有一个问题就是供电问题,据说DWM1000启动电流很大,我看坛主都是用的充电宝,充电宝好像瞬间可以提供1A的电流
供电问题也值得大家警惕,据说用什么USB-TTL取点有可能出问题
页:
[1]
2