Hi dialog
我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();
我nterface Settings in set_pad_functions() as follow:
GPIO_ConfigurePin( GPIO_PORT_0, GPIO_PIN_0, OUTPUT, PID_SPI_CLK, false );
GPIO_ConfigurePin( GPIO_PORT_0, GPIO_PIN_6, OUTPUT, PID_SPI_DO, false );
GPIO_ConfigurePin( GPIO_PORT_0, GPIO_PIN_3, OUTPUT, PID_SPI_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);
/*
************************************************************************************
* Main loop
************************************************************************************
*/
while(1)
{
}
我can't read the JEDEC_ID in function spi_flash_auto_detect().is that any incorrect .

Hi Lane,
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.
Thanks MT_dialog
Hi,
我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
我t 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).
Program Size: Code=19784 RO-data=3276 RW-data=80 ZI-data=8924
Case 2: Not working both in RAM as well as in FLASH
我f the code size is as mentioned below, Application image is not working in both RAM and FLASH.
Program Size: Code=21612 RO-data=3276 RW-data=80 ZI-data=9004
Please help me resolve the issue.
There is any memory constrains. How much memory of Primary and secondary boot loader codes will occupy in the RAM usage in DA14583.
Hi,
When downloading your firmware to flash via SmartSnippets, please make sure 'bootable' is selected. Or you could also enable the log printing by defining the macro CFG_PRINTF to see if the firmware executes successfully.
Hi,
我nstead 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.
Hi Mahesh,
There isn't any special code limitation in the 583, Its a bit weird for the code to run from SYSRAM (i suppose that you download it via keil) and not to work via the flash due to code size. I suppose that the code doesn't boot from the flash at all for some reason or in case you use sleep perhaps it doesn't ever wake up. Can check if you can boot via flash using the proximity example, its has larger code than your custom application (Code=23636 RO-data=3220 RW-data=128 ZI-data=8008). Also to check if your application boots properly and starts you can turn on that LED when the system starts in the periph_init function just to check if the application boots.
Thanks MT_dialog
Hi,
我tried with "prox_reporter" example. Prox_reporter in working in both RAM and Flash but the code size is
Program Size: Code=22868 RO-data=3220 RW-data=128 ZI-data=8008 (In uVision V5.17.0.0).
我will check as per your suggestion. Here doubt is, my application image is working RAM, why it is not working in the Flash.
is any context will be there like this.?
Hi,
我s bootable selected when flashing the firmware into flash via SmartSnippets? Also, remember to do an erase before write.
Hi
我am erasing and then burning the application image. I have selected bootable only..
Hi 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.
Thanks MT_dialog
Hi
我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).
Hi Mahesh,
There is no specific configuration to run a custom application from the SPI, all you need to do is to just burn the application, using smart snippets and tag the image as bootable when the SM ask you to. Since you are able to run other applications (reference designs, etc) through the SPI but not your custom application i suspect that the problem lies in your custom application code (when you say custom 1 and custom 2 i suppose that you mean the application profiles that are included in your custom code). Since you are interfacing with the SPI memory and it works over SRAM but not when booted via SPI i would suspect that something is wrong with the SPI access that your code does, you can try to remove the SPI access from your custom application and try to boot from SPI. Perhaps there is somekind of conflict with the application specific data that you mention, how those data are loaded to the SPI, via Smart Snippets and the propriety header programmer ? check the offset where those data are stored.
Thanks MT_dialog
Hi,
我am using Smart Snippet tool to write the application specific data in the Flash. I am writing Application specific data from 0x16000 location onwards.
Hi,
Whether I can keep the Application image and Application specific data in any of the memory regions apart from the internal Flash of the 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.
我nitial 5 to 6 cycles of reading (i.e. 1024 bytes reading from Flash), it is finishing quickly. But after that for every reading cycle it is taking approximately 10seconds. I am not getting Idea, why it is taking this much time to read 1024 bytes from Flash. This much time is taking only if the application image is programmed in Flash. In development mode , reading cycles are finishing very quickly. I am suspecting Boot loader code interference occurring in between. Please give idea to resolve this delay in reading cycle.
Hi,
We still need to narrow down the problem you met first.
我s value read from those long-time reads still correct as expected?
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.
And could you do successive reads with smaller chunks, say 512/256 bytes or etc., and see what the result is?
There's no particular limitations to SPI reads.
And the bootloader does not exist when the application runs up.
Hi,
我t is taking long-time as well as the read values not the expected one.
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.
我tried to read 256 bytes in each iteration, but still I am getting all zeros.
Please help me to check the status of SPI CS pin, while reading the data from the internal Flash.
Hi Mahesh,
我t sounds like your SPI is in power down mode, are you re-enabling your SPI before start reading, do you invoke spi_flash_release_from_power_down(); in order to release the SPI from power down ? The secondary bootloader in the 583 OTP will power down the flash after booting. The CS pin is the 2_3 pin on the 583 chip.
Thanks MT_dialog
Hi,
This information help me a lot to identify the issue.
我tried "spi_flash_release_from_power_down()" function but not working. Later I tried "spi_flash_enable()" function, with this function I am able to read the application specific data correctly.
Thank you very much for the information.
我need some information regarding the Maximum size of single Application image I can keep in internal flash (which can work). That means I want know the Application size limitation.
Hi Mahesh,
The maximum application that you burn in flash and run from the 580 depends on the 580 and not the flash. The limitation is the 42KB of Sysram available, in that you will have to calculate the exchanged memory the heaps etc, for more info about this please check the UM-B-011 Memory map and scatter file. Also be aware that keil has a 32K limitation with the evaluation licence.
Thanks MT_dialog
Hi,
我have taken BLE Peripheral code and edited. As of now I am able to use Write call back and Notify callback in the BLE peripheral. But I am not able to use read callback with the BLE peripheral code. Please give guidance where I can get the read callbacks. Which file and function, I need to use to access the Readcall back from the BLE client (i.e. Mobile device) to BLE Server (i.e. Dialog Semiconductors) development board.
Hi 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.
Thanks MT_dialog
Hi,
我am interfacing DA14583 with an I2C slave device. Some times I am able to read the data from the I2C slave device. But some times the Processing is getting struck at
"WAIT_UNTIL_NO_MASTER_ACTIVITY()" (i.e. in the I2C drive) for indefinite time. Any specific reason that the processor getting struck at the mentioned instruction.
Please guide me to resolve this issue.
Hi 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.