Hi dialog,
I am using DSPS example,I met a problem hope you can help.
I used a timer to read data via spi about 1s a time, but it stops after 5 or 6 times reading(page1 in attached), and after another 10s , the program fails(page2).
你能帮我分析一下原因吗?
The example I use is dsps_device, maybe the uart intrupt conflict with spi? if so, how to stop uart?
谢谢
本杰明
关键词:
设备:
嗨BenjaminDu,
Τhe platform_reset_func() is invoked by the platform_reset(), which is implemented ROM code. The most possible reason why you get this assertion is due to insufficient memory, because you might try to allocate messages that you never consume. For example, if you are allocating notification messages and you have a small connection interval the messages are piled up until a connection event arrives, but with a large connection interval your run out of memory before the connection event arrives.
谢谢, PM_Dialog
Hi dialog,
非常感谢你的快速回复。
我的代码如附件所示,似乎没有未使用的数据。
I still think spi i conflicts with uart
as uart has no use in my project,
你能告诉我怎么阻止它吗?然后我可以测试uart是否与spi冲突。
谢谢
(我在另一个例子中测试spi,它工作得很好)
l think spi_trabsanction is the only reason result in the conflict
谢谢
本杰明
嗨BenjaminDu,
Is the device booting from flash or from System-RAM? Are you continuously interacting with the UART? I will try to replicate it. If you could share with me the modifications you have done, it would be very helpful.
谢谢, PM_Dialog
Hi dialog,
从系统启动时,uart之间几乎没有交互
我的主要修改如下
void timer_callback(void)
{
内景iSSS;
iSSS=spi_transaction(0x80040001);
//iSSS=(iSSS>>5)&0xFFFF;
//iSSS/=64;
//iSSS=1023;
arch_printf("TTTTT\t");
}
#ifdef CFG\u PRINTF\u UART2格式
GPIO_ConfigurePin( 2, 8, OUTPUT, PID_UART2_TX, false );
GPIO\U配置引脚(2,9,输入,PID\U UART2\U RX,假);
#结束
GPIO_ConfigurePin( 0, 0, OUTPUT, PID_SPI_CLK, false );
GPIO\u ConfigurePin(0,2,输出,PID\u SPI\u EN,真);
GPIO_ConfigurePin( 0, 5, INPUT, PID_SPI_DI, false );
GPIO_ConfigurePin( 0, 6, OUTPUT, PID_SPI_DO, false );
SPI_Pad_t spi_CS_Pad;
spi\ CS公司_Pad.pin码=2;//2或
spi_CS_Pad.port =0; // SPI_PORT;
spi_init(&spi_CS_Pad, SPI_MODE_32BIT, SPI_ROLE_MASTER, SPI_CLK_IDLE_POL_LOW, SPI_PHA_MODE_0, SPI_MINT_DISABLE, SPI_XTAL_DIV_8);
定时器_init();
定时器寄存器回调(定时器回调);
输出如下,然后它停止,大约15秒,它失败了。附件是修改的全部文件。
SPSS Init
TTTTT其他msgid 3328
TTTTT TTTTT TTTTT TTTTT TTTTT TTTTT
Hi dialog,
一共修改了4个文档,都在上面.pdf中,只需将它们复制粘贴到相应的文档中,就可以进行测试了。
谢谢a lot for you help
本杰明
2019.10.17
嗨BenjaminDu,
The platform_reset_func() is due to insufficient memory, so can you please try to increase the heap size by defining the DB_HEAP_SZ in the da1458x_config_advanced.h header file?
谢谢, PM_Dialog
Hi dialog,
我将DB\u HEAP\u SZ增加了2倍和4倍,但它仍然崩溃,不同的是DB\u HEAP\u SZ的大小越大,崩溃所用的时间越长。
你能帮我说说记忆是用在哪里的吗?
你有别的办法避免撞车吗?
谢谢
本杰明
Hi dialog,
Previously I use SDK3.x uart_slave,DB_HEAP_SZ is 1024, still it works well, I shifted to new SDK as you suggest, but it crashes as the above shows, I think it's due to series port memory consumption, as the series port is not used in my project, can you help to suggest how to stop the series port?
谢谢
本杰明
Hi dialog,
可能spi与其他中断冲突?
as spi can work well independent ly.
谢谢
本杰明
嗨BenjaminDu,
The problem is due to insufficient memory. Can you please summarize all the modifications you have done in order to replicate your issue? The DSPS has UART and BLE activity, so I am not very sure is this is achievable, because the system will run out of memory due to pending messages. Have you replicated in another SDK project?
谢谢, PM_Dialog
Hi Dialog,
修改了以下3个文件:
arch_main.c
用户\u periph\u setup.c
da1458x_config_basic.h
我在PDF文档中复制了3个文件的内容及其修改,3个文件之间用/////////分隔,您可以在添加了///的地方找到修改。
我用SDK3.xuart\u slave测试了相同的代码,它可以工作。
谢谢
本杰明10月23日。
Hi dialog,
我的计划是用DSP读spi,我认为这是可能的。
谢谢
本杰明
oct 24th
Hi dialog,
你能给我个答复吗?
谢谢
本贾明杜10月25日
Hi dialog,
你说有悬而未决的消息,你能举例说明哪条消息?
谢谢
本杰明DU
任何人都可以告诉我怎么用spi and at the same time,also can connect over ble?
Hi dialog,
我测试的项目是dsp_设备.uvprojx,修改后的3个文件如附件所示
谢谢
本杰明
嗨BenjaminDu,
You are not able to have UART and SPI activity at the same time. The ble_app_security example of the SDK uses SPI flash n order to store the bonding data. Please follow USER_CFG_APP_BOND_DB_USE_SPI_FLASH. In order to initialize and interact with SPI flash, I would suggest you to use our APIs. You can also take spi_flash example as a reference (6.0.10.511\projects\target_apps\peripheral_examples\spi). Can you please clarify which are your requirements with the DSPS and SPI flash?
你应该使用app\u easy\u timer()API。每次计时器过期时,都会触发已注册的回调,因此需要注册回调以与SPI flash交互。请记住,DSP在默认情况下使用扩展睡眠模式,因此包括SPI在内的所有外围模块都将断电。
谢谢, PM_Dialog
嗨BenjaminDu,
刚刚看到你的附件修改文件。我将尝试在一个干净的sps\u设备项目中测试它。您有定制板吗,或者您正在使用我们的DK?另外,您是否有另一个运行sps\主机固件的DA14585,或者您正在使用我们的DSPS移动应用程序进行连接?
谢谢, PM_Dialog
Hi Dialog,
UART不是必须的,我使用UART以一种简单的方式输出数据,以观察调试期间运行的代码,但是我测试了我的代码,如果我不使用UART输出任何东西,程序仍然可能崩溃,同样在SKD3.x中,我使用slave\u UART和master\u UART示例,UART与SPI配合得很好。
我测试了SPI\u flash示例,它可以与我的SPI设备很好地交互。
我的要求是通过SPI读取数据并将数据发送到对等设备(即移动或sps\主机)
Do you mean extended sleep mode will disable SPI? and SPI is stopped and maybe this is the reason why the program crashed?
谢谢
本杰明
Hi Dialog,
Yes I'm using a customer board.
我使用sps\主机固件,也可以使用移动应用程序,两者都可以连接到dsps\设备
Hope you can have a test of my code and help me to found out where does the problem is.
谢谢
本杰明
Hi Benjamin,
When in sleep mode, all the peripheral block including I2C, UART, SPI are powered down. In DSPS example, the sleep mode is extended sleep mode by default. In case of UART, Hardware Flow Control is used in order to wake up the device when there are available data to sent or received. Can you please try it in active mode?
谢谢, PM_Dialog
Hi,
I tested active mode, and it seems works, I will do more tests to confirm it.
谢谢
本杰明
Hi Benjamin,
The extended sleep mode was the issue because, as I mentioned in my previous answer, all the peripheral blocks are powered done in sleep mode.
谢谢, PM_Dialog