External flash memory connected to DA14585 fails programming

Learn MoreFAQsTutorials

7 posts / 0 new
Last post
anushiya
Offline
Last seen: 7 months 1 day ago
Joined: 2017-12-20 02:30
External flash memory connected to DA14585 fails programming

Hi,
A custom board with DA14585 and flash memory AT25XE011 is connected to the development board DA14580-DEVKT-P_VC via JTAG connection.
Using SmartSnippet Studio V1.6.3.918 Kiel IDE I could run the firmware on debug mode.

I am trying to program the external flash memory and it is throwing our errors. I have attached 2 screen shots. Hope you can see the problem with them.

1) I opened SmartSnippets tool Box and selected JTAG serial number and chip version DA14585_00

2) Press connect and the tool said successfully configured SPI flash ports and pins

3) SPI_CLK: P0_0; SPI_EN: P0_3; SPI_DI: P0_5; SPI_DO: P0_6
JTAG pin connections are VBAT = 3.2V; GND; SW_CLK; and SWDIO

4) When I press "Erase", it gives an error
[ERROR SPI Flash @18-05-08 13:14:00] SPI Memory erasing failed.

5) When I try to burn I get:
[ERROR SPI Flash @18-05-08 13:15:10] Adddittional error info at JTAG address 0x81FEC (MSB first): FF FF FF F8
[ERROR SPI Flash @18-05-08 13:15:10] Memory burning failed.

Thank you for your assistance

Device: 
Device Number: 
DA14585 and AT25XE011
PM_Dialog
Offline
Last seen: 20 hours 40 min ago
Staff
Joined: 2018-02-08 11:03
Hi anushiya,

Hi anushiya,

 

The SmartSnippets toolbox uses the flash_programmer project in order to burn the SPI flash. The Adesto 25XE011 SPI Flash is not supported from the default flash programmer. In order to use this type of memory, you should modify the flash programmer and add the configurations of that SPI Flash. You can find the flash programmer project in the following path of the SDK:

 

DA1458x_SDK\5.0.4\utilities\flash_programmer

 

When you build the flash_programmer project you have two options, to build it as programmer_jtag or as programmer_uart. In your case, you should build it as programmer_jtag. After modifying and building the flash programmer project, you should copy the jtag_programmer.bin from the Out_jtag folder and paste it (with the same name) in the SmartSnippetsStudio\Toolbox\common_resources path, which is located in the installation folder of the tool.  After that, you could download firmware into the Adesto 25XE011 SPI Flash

 

Thanks, PM_Dialog

anushiya
Offline
Last seen: 7 months 1 day ago
Joined: 2017-12-20 02:30
Thank you very much for your

Thank you very much for your advice. I did the changes, compiled and copied jtag_programmer.bin from the Out_jtag folder and paste it in the SmartSnippetsStudio\Toolbox\common_resources path as jtag_programmer.bin as well as jtag_programmer_585.bin as that folder had both files initially. But the same error is coming up. I have attached the flash_programmer project file and a word file with all the changes I made.

can you please let me know what mistake I am making please?

Attachment: 
PM_Dialog
Offline
Last seen: 20 hours 40 min ago
Staff
Joined: 2018-02-08 11:03
Hi anushiya,

Hi anushiya,

 

I am not able to replicate your problem because we don’t have this type of SPI flash, so we can’t test your code. Please try to debug your code in order to find the cause of that error. I suggest you to build the flash_programmer project as programmer_uart ,run it in debug mode and then try to connect the SPI flash from SmartSpippets through UART. With that procedure you can find where your code hits.

 

Thanks, PM_Dialog

anushiya
Offline
Last seen: 7 months 1 day ago
Joined: 2017-12-20 02:30
Hi,

Hi,
I am not requesting you to debug the code in real time.
Since Dialog staff are experienced with the flash programmer code Dialog staff will know where exactly information is needed to be added in-order to add a different flash memory.
I just wanted you to visually check whether I have added information in all the relevant places. BTW, we chose AT25XE011 as the document AN-B-055 on page 22 of 24 stated that it is supported.

On the other hand, if you could send me a flash programmer template code with comments about what information to be included and mark it with a common marker (some thing like TODO with an example above the TODO line), then it will be easier for the user to identify all information to be included when they try to introduce a different flash memory.

Thank you

Some questions in my mind in-regard to the changes I made are

in spi_flash.c I included
{AT25XE011_JEDEC_ID, AT25XE011_JEDEC_ID_MATCHING_BITMASK, AT25XE011_TOTAL_FLASH_SIZE, AT25XE011_PAGE_SIZE, AT25XE011_MEM_PROT_BITMASK, AT25XE011_MEM_PROT_NONE},
as the 7th item in the list
const SPI_FLASH_DEVICE_PARAMETERS_BY_JEDEC_ID_t SPI_FLASH_KNOWN_DEVICES_PARAMETERS_LIST[]

which created the need to change
1) The count to 7 from 6 in spi_flash.h
// Definitions for the various SPI Flash Devices
#define SPI_FLASH_DEVICES_SUPPORTED_COUNT (7) // AK: 7 before 6
2) And then include (Index starts from 0 in this list, So I had to use 6. But 6 and numbers after 6 is already used in SPI Flash device definitions. So I am confused here.
// AK. AT25XE011, AT25DF011
#define SPI_FLASH_DEVICE_INDEX_AT25XE011 6 //??
#define AT25XE011_JEDEC_ID 0x1F4200
#define AT25XE011_JEDEC_ID_MATCHING_BITMASK 0xFFFF00
#define AT25XE011_TOTAL_FLASH_SIZE 0x20000
#define AT25XE011_PAGE_SIZE 0x100
#define AT25XE011_MEM_PROT_BITMASK 4
#define AT25XE011_MEM_PROT_NONE 0
#define AT25XE011_MEM_PROT_ENTIRE_MEMORY_PROTECTED 4

I also included the following lines in user_periph_setup.h
#define AT25XE011_MANF_DEV_ID (0x1F42) // AK: AT25XE011 Manufacturer and ID
#define AT25XE011_SIZE 131072 // AK: SPI Flash memory size in bytes
#define AT25XE011_PAGE 256 // AK: SPI Flash memory page size in bytes

Have I correctly included all configuration information in the right place in flash programmer project or Am I missing anything or Included wrong information?

PM_Dialog
Offline
Last seen: 20 hours 40 min ago
Staff
Joined: 2018-02-08 11:03
Hi anushiya,

Hi anushiya,

The flash AT25XE011 is not supported from the SDK and also the document, mentions in table 6 all the memories that are supported, from the adesto family the AT25DN011, AT25DF011, AT25DS011 and not the AT25XE011 (the document mentions only that type of flash on table 7: Performance of the SPI memories supported I will try to find out why we mention that flash in the doc, since I don’t see the reference of that flash type in the flash programmer). Regarding the additions that you made in the code, you are correct (you didn't have to change the whatever you changed in the periph_setup.h file, but even if you did it doesn't matter since those defines are not used, the values from the spi_flash.h are used), regarding the index that you used, that depends on the place that you will assign the flash in the SPI_FLASH_KNOWN_DEVICES_PARAMETERS_LIST[], in your case this 6 as you have inserted. So if the flash that you are using has the same commands as the adesto already used in the programmer (check the spi_flash.h) WRITE_ENABLE, READ_DATA etc, and the connection are proper, you should be ok. If not you will to try to access the flash and debug the fw in order to see why you cannot interface with the flash. As far as I can tell from the datasheet of the flash that you mentioned I see that the commands used are identical, and the flash should work even without the mods adding a new flash, since the recon of the flash occurs via the JEDEC ID which are identical to the already existing Adesto of the flash programmer.

Thanks PM_dialog

anushiya
Offline
Last seen: 7 months 1 day ago
Joined: 2017-12-20 02:30
As PM_dialog confirmed, the

As PM_dialog confirmed, the AT25XE011 configuration change in flash_programmer is accepted by smart snippets toolbox when flash_programmer was compiled and the jtag_programmer.bin from the Out_jtag folder is copied and pasted it with the name jtag_programmer_585.bin in the SmartSnippetsStudio\Toolbox\common_resources path.

The VCC and nCS were having proper voltages. But the problem faced was, due to accelerometer LIS2DH12TR (which was NOT powered up) sharing the SPI lines SI, SO and SCK with AT25XE011, the voltage of SI and SCK were pulled down below 1.5V resulting in the flash memory not reacting to the commands. Once the accelerometer LIS2DH12TR is removed from the custom board, the flash was able to be programmed.

Thank you very much for your help PM_Dialog.