学到更多FAQsTutorials

25 posts / 0 new
Last post
本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
DSP例子

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?

谢谢

本杰明

关键词:
设备:
PM_Dialog
Offline
Last seen:6 days 13 hours ago
Staff
Joined:2018-02-08 11:03
嗨Benjamindu,

嗨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

本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
Hi dialog,

Hi dialog,

非常感谢您的快速回复。

我的代码如附件中,似乎没有未折叠的数据。

I still think spi i conflicts with uart

as uart has no use in my project,

你能帮忙告诉我如何阻止它吗?然后我可以测试UART与SPI冲突。

谢谢

(我测试SPI在其他示例中,它运作良好)

Attachment:
本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
l think spi_trabsanction is

l think spi_trabsanction is the only reason result in the conflict

谢谢

本杰明

PM_Dialog
Offline
Last seen:6 days 13 hours ago
Staff
Joined:2018-02-08 11:03
嗨Benjamindu,

嗨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

本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
Hi dialog,

Hi dialog,

从系统启动,UART之间几乎没有交互

我的重大修改如下

void timer_callback(void)

{

INT ISSS;

iSSS=spi_transaction(0x80040001);

// ISSS =(ISSS >> 5)&0xFFFF;

// ISSS / = 64;

// ISSS = 1023;

arch_printf("TTTTT\t");

}

#ifdef cfg_printf_uart2.

GPIO_ConfigurePin( 2, 8, OUTPUT, PID_UART2_TX, false );

gpio_configurepin(2,9,输入,pid_uart2_rx,false);

#万一

GPIO_ConfigurePin( 0, 0, OUTPUT, PID_SPI_CLK, false );

gpio_configurepin(0,2,输出,pid_spi_en,true);

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);

timer_init();

timer0_register_callback(timer_callback);

输出如下,然后它停止,大约15s,它失败了。附加是修改的整个文档。

SPSS Init

ttttt其他msgid 3328

TTTTT TTTTT TTTTT TTTTT TTTTT TTTTT

Attachment:
本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
Hi dialog,

Hi dialog,

修改了4个文件,所有内容都在上面的.pdf只需将它们复制并粘贴到相应的文件中,然后可以测试它。

谢谢a lot for you help

本杰明

2019.10.17

PM_Dialog
Offline
Last seen:6 days 13 hours ago
Staff
Joined:2018-02-08 11:03
嗨Benjamindu,

嗨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

本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
Hi dialog,

Hi dialog,

我增加了db_heap_sz 2次和4次,但仍然崩溃,差异是db_heap_sz的较大尺寸,崩溃时间越长。

你能帮忙说在哪里使用内存吗?

你有其他方法来避免崩溃吗?

谢谢

本杰明

本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
Hi dialog,

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?

谢谢

本杰明

本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
Hi dialog,

Hi dialog,

也许SPI与其他中断发生冲突?

as spi can work well independent ly.

谢谢

本杰明

PM_Dialog
Offline
Last seen:6 days 13 hours ago
Staff
Joined:2018-02-08 11:03
嗨Benjamindu,

嗨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

本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
Hi Dialog,

Hi Dialog,

以下3个文件修改:

arch_main.c

user_periph_setup.c.

da1458x_config_basic.h

我复制了3个文件的内容及其在PDF文档中的修改,第3个由///////////////////////////////////////////////////////Benjamin添加。

我用sdk3.x uart_slave测试了相同的代码,它有效。

谢谢

本杰明10月23日。

Attachment:
本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
Hi dialog,

Hi dialog,

我的项目是使用DSP来阅读Throngh Spi,我认为应该是可能的。

谢谢

本杰明

oct 24th

本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
Hi dialog,

Hi dialog,

你能给我一个回复吗?

谢谢

Benjamindu 10月25日

本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
Hi dialog,

Hi dialog,

你说还有待定的消息,请你给出一个消息吗?

谢谢

本杰德杜

本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
任何人都可以告诉我如何使用

任何人都可以告诉我如何使用spi and at the same time,also can connect over ble?

本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
Hi dialog,

Hi dialog,

我测试的项目是dsps_device.uvprojx,附加的修改后的3个文件

谢谢

本杰明

PM_Dialog
Offline
Last seen:6 days 13 hours ago
Staff
Joined:2018-02-08 11:03
嗨Benjamindu,

嗨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_easy_timer()API。每次计时器到期时,都会触发注册的回调,因此您需要注册回调以与SPI Flash进行交互。请记住,DSP默认使用扩展睡眠模式,因此包括SPI的所有外设块都将关闭。

谢谢, PM_Dialog

PM_Dialog
Offline
Last seen:6 days 13 hours ago
Staff
Joined:2018-02-08 11:03
嗨Benjamindu,

嗨Benjamindu,

刚看到您附加的修改文件。我会尝试在干净的sps_device项目中测试它。您有定制董事会,或者您正在使用我们的任何DKS?此外,您还有另一个运行SPS_HOST固件的DA14585,还是您正在使用我们的DSP移动应用程序来连接?

谢谢, PM_Dialog

本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
Hi Dialog,

Hi Dialog,

UART不是必须的,我用UART以一种简单的方法来输出数据来观察在调试期间的代码,但我测试了我的代码,如果我不使用UART来淘汰任何东西,那么程序仍然可以崩溃,仍然可以崩溃在Skd3.x中,我使用slave_uart和master_uart示例,UART与SPI良好。

我测试了SPI_FLASH示例,它可以与我的SPI设备交互。

我的要求是通过SPI读取数据并将数据发送到对等设备(EITH到MOBILE或SPS_HOST)

Do you mean extended sleep mode will disable SPI? and SPI is stopped and maybe this is the reason why the program crashed?

谢谢

本杰明

本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
Hi Dialog,

Hi Dialog,

Yes I'm using a customer board.

我使用sps_host固件,我也可以使用移动应用程序,两个都可以连接到dsps_device

Hope you can have a test of my code and help me to found out where does the problem is.

谢谢

本杰明

PM_Dialog
Offline
Last seen:6 days 13 hours ago
Staff
Joined:2018-02-08 11:03
Hi Benjamin,

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

本杰明Du
Offline
Last seen:10小时34分钟前
Joined:2016-03-14 02:38
Hi,

Hi,

I tested active mode, and it seems works, I will do more tests to confirm it.

谢谢

本杰明

PM_Dialog
Offline
Last seen:6 days 13 hours ago
Staff
Joined:2018-02-08 11:03
Hi Benjamin,

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