SPI Flash Read write failure

23个帖子/ 0新
Last post
Lane
Offline
最后一次露面:2周4天前
Joined:2015-07-14 14:21
SPI Flash Read write failure

嗨对话框
I used a external Flash W25x20 for Data storage,but when SPI Initialization is complete,I can‘t read the JEDEC_ID by “ jedec_id = spi_read_flash_jedec_id();” in function spi_flash_auto_detect();
Interface Settings in set_pad_functions() as follow:

gpio_configurepin(gpio_port_0,gpio_pin_0,输出,pid_spi_clk,false);
GPIO\ U配置引脚(GPIO\ U端口\ U 0,GPIO\ U引脚\ U 6,输出,PID\ U SPI\ U DO,false);
GPIO\ U配置引脚(GPIO\ U端口\ U 0,GPIO\ U引脚\ U 3,输出,PID\ U SPI\ U EN,true);
GPIO_ConfigurePin( GPIO_PORT_0, GPIO_PIN_5, INPUT, PID_SPI_DI, true );

And it initialization before main loop:
spi_flash_init(0x40000,0x100);
spi_flash_enable(gpio_port_0,gpio_pin_3);
/*
************************************************************************************
*主循环
************************************************************************************
*/
而(1)
{
}
我无法读取函数spi_flash_auto_detect()中的jedec_id。是什么不正确。

设备:
mt_dialog.
Offline
最后一次露面:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
嗨巷,

嗨巷,

Please have a look at the spi_flash example in the peripheral_examples directory in the SDK5 to check how the JEDEC_ID is read from the spi_flash_auto_detect() function. The example code is able to read a W25X20 spi memory flash as is, without any modifications.

谢谢mt_dialog.

Mahesh
Offline
最后一次露面:3年3个月前
Joined:2016-01-04 14:03
Hi,

Hi,
I have taken the "ble_app_peripheral" example and done some changes in the code. As of now I am using Keil uVision V5.17.0.0 (trail version) and using SDK (DA14583)

Case 1: Working in RAM, but not working in FLASH
It is working fine in RAM (i.e. developing mode). If the same code I am downloading in FLASH by using "SmartSnippets" tool, it is not working. Even I couldn't able to see the BLE device name on the mobile side android app (while down loading the image in FLASH).

程序尺寸:CODE = 19784 RO-DATA = 3276 RW-DATA = 80 ZI-DATA = 8924

案例2:不在RAM和Flash中工作
如果代码大小如下所述,则应用程序映像在RAM和闪存中都不起作用。

程序大小:代码=21612 RO数据=3276 RW数据=80 ZI数据=9004

请帮我解决这个问题。
There is any memory constrains. How much memory of Primary and secondary boot loader codes will occupy in the RAM usage in DA14583.

lt_dialog(未经验证)
Hi,

Hi,
通过SmartSnippet将固件下载到Flash时,请确保选择“可启动”。或者您还可以通过定义宏CFG_PrintF来启用日志打印,以查看固件是否成功执行。

Mahesh
Offline
最后一次露面:3年3个月前
Joined:2016-01-04 14:03
Hi,

Hi,
Instead of using CFG_PRINTF, I have used the LED indication on the Development boards. I have commented my code, put the LED related code in the BLE peripheral code. I have put the application image (having LED code+BLE peripheral code) in the flash. It is working in flash. If I am including my code (having My application code+LED code+BLE peripheral code), both together are working in RAM. But if the code (having My application code+LED code+BLE peripheral code) down loaded in the flash, then it is not working. Even LED blinking also not coming. I am suspecting the code size may creating an issue. I am following correct procedure and able to access the flash to write the application image. I am facing the issue with the higher size of code only. Please help to resolve the issue.

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
嗨mahesh,

嗨mahesh,

在583中没有任何特殊的代码限制,它对于从Sysram运行的代码有点奇怪(我想通过keil下载它)而不是通过代码大小通过闪存工作。我想代码没有出于某种原因从闪存启动,或者如果您使用睡眠,它可能不会醒来。可以检查您是否可以使用Proximity示例通过Flash启动,其代码比自定义应用程序更大(代码= 23636 RO-DATA = 3220 RW-DATA = 128 ZI-DATA = 8008)。另外要检查应用程序启动是否正确并启动您可以在系统从PeripH_Init函数中启动时打开该LED,只需检查应用程序靴子。

谢谢mt_dialog.

Mahesh
Offline
最后一次露面:3年3个月前
Joined:2016-01-04 14:03
Hi,

Hi,
I tried with "prox_reporter" example. Prox_reporter in working in both RAM and Flash but the code size is
程序大小:Code=22868 RO data=3220 RW data=128 ZI data=8008(在uVision V5.17.0.0中)。
我会按照你的建议检查的。这里的疑问是,我的应用程序映像正在RAM中工作,为什么它不能在Flash中工作。
是任何上下文将在那里。

lt_dialog(未经验证)
Hi,

Hi,
通过SmartSnippets将固件闪存到闪存中时是否选择了bootable?另外,记得在写之前做一次擦除。

Mahesh
Offline
最后一次露面:3年3个月前
Joined:2016-01-04 14:03
Hi

Hi
我正在擦除,然后刻录应用程序图像。我只选择可启动..

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
嗨mahesh,

嗨mahesh,

关于距离的例子中,我一直都在in a modified proximity program that why my proximity code is larger, but even so the image is larger than the custom program that you are trying to download, so i dont think that there is an issue with the size. It must be something wrong with the application, in your custom code are you interfacing at all with the SPI ? Also please make sure that your code boots from the SPI, make sure that the program is downloaded in the 580 upon start up, try to check it with the LED in the peripheral initialization.

谢谢mt_dialog.

Mahesh
Offline
最后一次露面:3年3个月前
Joined:2016-01-04 14:03
Hi

Hi
I have two custom applications (i.e. custom1 and custom2). In custom1, I am using SPI to get application specific data from the flash. In custom2, I am not using SPI at all. For both custom1 and custom2 applications, I am facing same issue (i.e. working in RAM (in development mode) and not working in Flash (i.e. run mode) ). Please give the information, what are the configurations I need to do, to run the application image in run mode (i.e. to boot from the flash memory).

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
嗨mahesh,

嗨mahesh,

没有特定的配置来运行SPI的自定义应用程序,您需要做的就是只需刻录应用程序,使用智能片段并将图像标记为SM请求时可引导。由于您能够通过SPI运行其他应用程序(参考设计等)但不是您的自定雷竞技安卓下载义应用程序,我怀疑问题在于您的自定义应用程序代码(当您说自定义1和Custom 2时,我想您的意思是应用程序配置文件包含在您的自定义代码中)。由于您与SPI内存进行了接口,并且它在SRAM上工作,但在通过SPI启动时,我怀疑您的代码的SPI访问有问题,您可以尝试从自定义应用程序中删除SPI访问并尝试从spi启动。也许与您提到的应用程序特定数据有一些冲突,如何通过智能片段和总数标题程序员将这些数据加载到SPI的数据?检查存储这些数据的偏移量。

谢谢mt_dialog.

Mahesh
Offline
最后一次露面:3年3个月前
Joined:2016-01-04 14:03
Hi,

Hi,
我正在使用Smart Scippet工具在闪存中编写特定于应用程序的数据。我正在从0x16000位置写出特定于应用程序的数据。

Mahesh
Offline
最后一次露面:3年3个月前
Joined:2016-01-04 14:03
Hi,

Hi,
无论我是否可以将应用程序图像和应用程序特定数据保留在DA14583的内部闪光灯中的任何内存区域中。

Every time I am reading 1024 bytes of Application specific data from the Flash. Is any limitation in the size of data can be read from the flash at a time.
最初的5到6个读取周期(即从Flash读取1024字节),它很快就完成了。但在这之后,每一个读取周期大约需要10秒。我不明白,为什么要花这么多时间从Flash读取1024字节。只有在应用程序映像是用Flash编程的情况下,才会占用这么多时间。在开发模式下,阅读周期很快就结束了。我怀疑引导加载程序代码干扰发生在两者之间。请给出解决阅读周期延迟的方法。

lt_dialog(未经验证)
Hi,

Hi,
我们仍然需要缩小你首先遇到的问题。
从那些长期读数读数仍然正确的值读数仍然是预期的吗?
What is the sleep setting in your project, ARCH_SLEEP_OFF, ARCH_EXT_SLEEP_ON or ARCH_DEEP_SLEEP_ON? Please use ARCH_SLEEP_OFF if not, just for simplifying the problem.
Could you also monitor the SPI CS pin? In the case of long-time reads, the SPI CS pin shall be observed staying low for long time.
你能用更小的数据块(比如512/256字节)连续读取数据,看看结果是什么吗?

There's no particular limitations to SPI reads.
应用程序运行时,引导加载程序不存在。

Mahesh
Offline
最后一次露面:3年3个月前
Joined:2016-01-04 14:03
Hi,

Hi,
它需要很长时间,而且读取的值不是预期的值。
Sleep setting in our project is ARCH_SLEEP_OFF only.
How to observe the SPI CS status. To which pin I need to connect the CRO probe.
我试图在每次迭代中读取256个字节,但仍然我得到了所有的零。

Please help me to check the status of SPI CS pin, while reading the data from the internal Flash.

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
嗨mahesh,

嗨mahesh,

它听起来像你的SPI处于电源下行模式,您是否在开始阅读前重新启用您的SPI,您是否调用SPI_FLASH_RELEASE_FROM_POWER_DOWN();为了将SPI从电源释放出来?583 OTP中的二级引导加载程序将在启动后关闭闪光灯。CS引脚是583芯片上的2_3引脚。

谢谢mt_dialog.

Mahesh
Offline
最后一次露面:3年3个月前
Joined:2016-01-04 14:03
Hi,

Hi,
这些信息对我确定问题有很大帮助。
我尝试了“spi_flash_release_from_power_down()”功能但不起作用。后来我尝试了“spi_flash_enable()”功能,使用此功能,我能够正确读取特定于应用程序的数据。

非常感谢你提供的信息。

我需要一些关于我可以保持在内部闪存(可以工作)中的单个应用程序映像的最大大小的信息。这意味着我想知道应用程序大小限制。

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
嗨mahesh,

嗨mahesh,

在flash中烧录并从580运行的最大应用程序取决于580而不是flash。限制是可用的系统内存42KB,因为您必须计算交换的内存、堆等,有关这方面的更多信息,请查看UM-B-011内存映射和散点文件。还要注意,keil在评估许可证上有32K的限制。

谢谢mt_dialog.

Mahesh
Offline
最后一次露面:3年3个月前
Joined:2016-01-04 14:03
Hi,

Hi,
我已经拍了BLE外围代码并编辑。截至目前,我能够在BLE外设中使用写回调并通知回调。但我无法使用带有BLE外围代码的读回调。请提供指导,我可以获得读回调。哪个文件和功能,我需要用来将从BLE客户端(即移动设备)的READCALL访问到BLE服务器(即对话框半导体)开发板。雷竞技电竞平台

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
嗨mahesh,

嗨mahesh,

Read callback ? You mean a callback that will indicate that a client has read the data from the peer, this kind of handler doesn't exist, the indications that the client reads from your peer doesn't reach the application level.

谢谢mt_dialog.

Mahesh
Offline
最后一次露面:3年3个月前
Joined:2016-01-04 14:03
Hi,

Hi,
我用I2C从设备接口DA14583。有时我能够从I2C从设备读取数据。但是,有时候处理令人震惊
“等待\u直到\u NO \u MASTER \u ACTIVITY()”(即在I2C驱动器中)无限期。处理器被上述指令击中的任何特定原因。

请指导我解决这个问题。

lt_dialog(未经验证)
嗨mahesh,

嗨mahesh,
could you create another thread for this i2c problem you met? It would be easier for forum users to search for similar topics. Thank you for your understanding.

Topic locked