嗨,对话,
我用的是DSP的例子,我遇到了一个问题希望能对你有所帮助。
我用一个计时器通过spi读取数据,每次大约1s,但是在读取5到6次后它就停止了(附页1),再过10秒,程序就失败了(附页2)。
can you help to analyse why?
我使用的例子是dsps\u设备,可能uart中断与spi冲突?如果是,如何停止uart?
Thanks
Benjamin
Keywords:
Device:
Hi BenjaminDu,
Τplatform\ reset\ func()由platform\ reset()调用,platform\ reset()由ROM代码实现。得到此断言的最可能原因是内存不足,因为您可能会尝试分配从不使用的消息。例如,如果正在分配通知消息,并且连接间隔很小,则消息会堆积起来,直到连接事件到达,但是如果连接间隔很大,则在连接事件到达之前内存就会耗尽。
谢谢,下午好
嗨,对话,
Thanks a lot for your quick reply.
My code as in the attached, there seems no unconsumed data.
我仍然认为spi I与uart冲突
因为uart在我的项目中没有用处,
can you help to tell me how to stop it? then I can test if uart conflicts with spi.
Thanks
(I test spi in other example, it works well)
我认为spi是导致冲突的唯一原因
Thanks
Benjamin
Hi BenjaminDu,
设备是从闪存引导还是从系统RAM引导?您是否一直在与UART交互?我将尝试复制它。如果你能与我分享你所做的修改,这将是非常有帮助的。
谢谢,下午好
嗨,对话,
Boot from system, there is little interact between uart
My major modification as following
void timer\u回调(void)
{
int iSSS;
iSSS=spi\ U事务(0x80040001);
/ /空间站= (iss > > 5) &0xFFFF;
//iSSS/=64;
//iSSS=1023;
拱门打印(“TTTTT\t”);
}
#ifdef CFG_PRINTF_UART2
GPIO\U配置引脚(2,8,输出,PID\U UART2\U TX,false);
GPIO_ConfigurePin( 2, 9, INPUT, PID_UART2_RX, false );
#endif
GPIO\u ConfigurePin(0,0,输出,PID\u SPI\u CLK,false);
GPIO_ConfigurePin( 0, 2, OUTPUT, PID_SPI_EN, true );
GPIO\u ConfigurePin(0,5,INPUT,PID\u SPI\u DI,false);
GPIO\u ConfigurePin(0,6,OUTPUT,PID\u SPI\u DO,false);
SPI\u Pad\u t SPI\u CS\u Pad;
spi_CS_Pad.pin = 2; //2 or
spi\ CS公司_Pad.port =0; // SPI\ U端口;
spi\ u init(&spi\ u CS\ u Pad,spi\ u MODE\ u 32位,spi\ u ROLE\ u MASTER,spi\ u CLK\ u IDLE\ u POL\ u LOW,spi\ u PHA\ u MODE\ u 0,spi\ u MINT\ u DISABLE,spi\ u XTAL\ u DIV\ u 8);
timer_init();
timer0_register_callback(timer_callback);
The output as following, then it stops, about 15s, it fails. attached is the whole doc that modified.
SPSS初始化
TTTTT other msgid 3328
ttttttttttttttttttttttttttttttttttttttttttt
嗨,对话,
Total 4 documents modified,all in the above .pdf simply copy them and paste into the corresponding doc, then you can test it.
非常感谢你的帮助
Benjamin
2019.10.17
Hi BenjaminDu,
platform\u reset\u func()是由于内存不足造成的,因此能否通过在da1458x\u config\u advanced.h头文件中定义DB\u heap\u SZ来增加堆大小?
谢谢,下午好
嗨,对话,
I increased DB_HEAP_SZ 2 times and 4 times, but still it crashes, the difference is the bigger size the DB_HEAP_SZ, the longer time it took to crash.
can you help to say where the memory is used?
Do you have other way to avoid crashing ?
Thanks
Benjamin
嗨,对话,
以前我用的是SDK3.xuart\u slave,DB\u HEAP\u SZ是1024,还是很好用的,我按照你的建议换了新的SDK,但是崩溃了,如上图所示,我觉得是串口内存消耗的原因,因为我的项目没有用到串口,你能帮我建议怎么停止串口吗?
Thanks
Benjamin
嗨,对话,
Maybe spi conflict with other interrupt?
因为spi可以独立工作。
Thanks
Benjamin
Hi BenjaminDu,
问题是由于内存不足。为了复制您的问题,您能总结一下您所做的所有修改吗?DSP具有UART和BLE活动,因此我不确定这是否可以实现,因为系统将由于挂起的消息而耗尽内存。你在另一个SDK项目中复制过吗?
谢谢,下午好
嗨,对话,
Following 3 files modified:
主拱门
user_periph_setup.c
da1458x\配置\基本.h
I copied the contents of the 3 files and their modifications in the PDF document, the 3 are separated by ///////////you can find the modifications where there is //Benjamin added.
I tested the same code with SDK3.x uart_slave, and it works.
Thanks
Benjamin Oct. 23rd.
嗨,对话,
My project is to use dsps to read throngh spi, I think it should be possible.
Thanks
Benjamin
10月24日
嗨,对话,
can you give me a response?
Thanks
BenjaminDUOct. 25
嗨,对话,
you said there are pending messages, can you please give example which message?
Thanks
BenjaminDU
任何人都可以告诉我如何使用spi,同时,也可以通过ble连接?
嗨,对话,
The project I tested is dsps_device.uvprojx, the modified 3 files as attached
Thanks
Benjamin
Hi BenjaminDu,
您不能同时进行UART和SPI活动。SDK的ble\u app\u安全示例使用SPI flash n order存储绑定数据。请遵循用户\u CFG\u APP\u BOND\u DB\u USE\u SPI\u FLASH。为了初始化spiflash并与之交互,我建议您使用我们的api。您还可以将spi\u flash示例作为参考(6.0.10.511\projects\target\u apps\peripheral\u examples\spi)。您能澄清一下您对DSP和SPI闪存的要求吗?
You should use the app_easy_timer() API. Every time that the timer expired, the registered callback will be triggered, so you need to register the callback for interacting with SPI flash. Keep in mind that DSP uses extended sleep mode by default, so all the peripheral blocks including the SPI will be powered down.
谢谢,下午好
Hi BenjaminDu,
Just seen your attached modified file. I will try to test it in a clean sps_device project. Do you have a custom board, or you are using any of our DKs? Also, do you have another DA14585 running the sps_host firmware or you are using our DSPS mobile application to connect?
谢谢,下午好
嗨,对话,
UART is not a must, I use UART to output data in a easy way to observer the code runing during debug, but I tested my code, if I don't use the UART to out put anything, still the program can crash, also in SKD3.x, I use slave_uart and master_uart example,UART works well with SPI.
I tested SPI_flash example, and it can interact with my SPI device well.
My requirement is to read data by SPI and send the data to a peer device(eith to mobile or sps_host)
你的意思是延长睡眠模式会禁用SPI吗?SPI被停止了,也许这就是程序崩溃的原因?
Thanks
Benjamin
嗨,对话,
是的,我用的是客户板。
I use the sps_host firmware, and I can also use the mobile application , both of them can connect to the dsps_device
希望你能有一个测试我的代码,并帮助我找出哪里有问题。
Thanks
Benjamin
你好,本杰明,
当处于睡眠模式时,所有外围模块包括I2C、UART、SPI均断电。在dsp示例中,默认情况下,睡眠模式是扩展睡眠模式。在UART的情况下,使用硬件流控制,以便在有可用数据发送或接收时唤醒设备。你能在活动模式下试试吗?
谢谢,下午好
你好,
我测试了主动模式,它似乎工作,我会做更多的测试,以确认它。
Thanks
Benjamin
你好,本杰明,
延长睡眠模式是一个问题,因为,正如我在前面的回答中提到的,所有外围模块都是在睡眠模式下通电的。
谢谢,下午好