LPC54018 W25Q128JVFM Program flash issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC54018 W25Q128JVFM Program flash issue

1,540 Views
Renuga_AKAS
Contributor I

Hi,

    I tried to download 1MB program on winbond W25Q128JVFM external flash through LPC54018 microcontroller using ULINK2 debugger (Platform: Keil microvision IDE). But the debugger failed to download the code with "Erase failed" or "Erase done. Programming failed" or "Content mismatch error" such error messages. Here i have attached xip_debug.ini file and linker script file for reference.

xip_debug.ini

_WDWORD(0x40000200, 0x02783); /* Enable IOCON SPIFI clock */

_WDWORD(0x4000105C, 0x00000326); /* PIO0_23 SPIFI_CSN */
_WDWORD(0x40001060, 0x00000326); /* PIO0_24 SPIFI_IO(0)*/
_WDWORD(0x40001064, 0x00000326); /* PIO0_25 SPIFI_IO(1)*/
_WDWORD(0x40001068, 0x00000326); /* PIO0_26 SPIFI_CLK */
_WDWORD(0x4000106C, 0x00000326); /* PIO0_27 SPIFI_IO(2)*/
_WDWORD(0x40001070, 0x00000326); /* PIO0_28 SPIFI_IO(3)*/

_WDWORD(0x40000630, 0x00000010); /* Enable FRO HF power */
_WDWORD(0x40000500, 0x40A65769); /* Set FRO 96Mhz */
_WDWORD(0x400002A0, 0x00000003); /* SPIFI clock set to FRO */


_WDWORD(0x40000390, 0x00000000); /* SPIFI clock div to 1 */

_WDWORD(0x4008001C, 0x10); /* SPIFI reset */

_WDWORD(0x40080000, 0x600FFFFF); /* SPIFI init */

_WDWORD(0x40080018, 0x0B810000); /* SPIFI CMD read */

LPC54018_spifi_flash.scf

#if (defined(XIP_IMAGE))
#define m_interrupts_start 0x10000000
#define m_interrupts_size 0x00000200
#else
#define m_interrupts_start 0x00000000
#define m_interrupts_size 0x00000200
#endif

#if (defined(XIP_IMAGE))
#define m_text_start 0x10000200
#define m_text_size 0x00FFFE00
#else
#define m_text_start 0x00000200
#define m_text_size 0x0002FE00
#endif

#if (defined(XIP_IMAGE))
#define m_data_start 0x00000040
#define m_data_size 0x0002FFC0
#else
#define m_data_start 0x20000000
#define m_data_size 0x00028000
#endif

#define m_usb_sram_start 0x40100000
#define m_usb_sram_size 0x00002000

 

Can anyone suggest a solution to download code on external flash memory?

0 Kudos
7 Replies

1,478 Views
Renuga_AKAS
Contributor I

Hi,

    In our customized LPC54018 board (208 pins), upto 500kb we're able to flash program using the default FLM file provided by keil uvision software tool. But while trying to flash more than 500 kb, it shows "Contents mismatch at: 10000000H (Flash=10H Required=00H) !" error and verification failed. Also i tried the same with LPC54018 EVK board (180 pins), it works on both MCUxpresso and keil uvision tool by using a ULINK2 debugger toolchain.

Is any possibilities on changes in configuration of FLM file from LPC54018 (180 to 208 pins)?

Renuga_AKAS_0-1664201519539.png

 

0 Kudos

1,498 Views
Renuga_AKAS
Contributor I

Hi,
Thanks for the replay. Even though, "Programming Algorithms" for LPC54018 W25Q128JVFM added by the steps provided in the "Help->uVision Help". Still we cannot flash the programming of 16MBytes. I have added the screen shots for your reference. As well as, I cannot find the “FlashDev.c” and “FlashPrg.c” files for the programming algorithm "LPC540xx W25Q128JVFM SPIFI" (Default file given by keil uvision). Can you help us for this?

 

0 Kudos

1,511 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

After you launch the Keil tools, pls click the "Help->uVision Help", you will get the image.

Then click the "Programming Algorithms", and select the corresponding Flash Programming Algorithms for the LPC54018 W25Q128JVFM .

Hope it can help you

BR

XiangJun Rong

xiangjun_rong_0-1663919716442.png

 

0 Kudos

1,480 Views
Renuga_AKAS
Contributor I

Hi,

    We have tried another way to flash download the 5MB code on LPC54018-EVK board using MCUxpresso tool through ULINK2. It works fine. But in our customized 208 pin board, it showed "unable to connect wire for probe index 1" & "Error: Wire ACK fault - target connected?". I have attached the screenshots for your reference. For our customised 208 pin LPC54018 board, is LPC540xx_SPIFI_SFDP.cfx file or LPC540xx_part.xml file needed any changes in the configuration? (or) is there any FLM file in MCUxpresso for flashing the code on LPC54018 board.

Renuga_AKAS_0-1664191366996.png  Renuga_AKAS_1-1664191389758.png 

Renuga_AKAS_2-1664191424787.png  Renuga_AKAS_3-1664191464146.png

 

 

0 Kudos

1,465 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Pls refer to the following figure, try to use LPC540xx_SPIFI_GENERIC.cfx to download code.
On MCUXpresso tools, you can click Project->Properties->MCU Setting, you will see the LinkServer Flash driver menu.
Hope it can help you

 

xiangjun_rong_1-1664269898332.png

 

 

BR

XiangJun Rong

 

0 Kudos

1,443 Views
Renuga_AKAS
Contributor I

Hi,

    Thanks for the solution. We're able to flash 16MB program on external NOR flash (W25Q128JVFM) through MCUXpresso tool (using ULINK2) with the help of LPC54xx_SPIFI_GENERIC.cfx file.

0 Kudos

1,495 Views
Renuga_AKAS
Contributor I

Hi,

    We also tried to create a FLM file by following the flash programming algorithm creation steps provided by keil. Still we're getting content mismatched error and a "verification failed" error. Attached a the screenshots of the error message and also our "FlashDev.c" and "FlashPrg.c" code. Is there any other way to download 16MB code on external NOR flash (W25Q128JVFM).

The following images are screenshots of error message:

Renuga_AKAS_0-1664176483512.png

Renuga_AKAS_1-1664176499161.png

The following code is content of "FlashDev.c"

struct FlashDevice const FlashDevice = {
FLASH_DRV_VERS, // Driver Version, do not modify!
"LPC540xx W25Q128JVFM SPIFI", // Device Name
EXTSPI, // Device Type
0x10000000, // Device Start Address
0x01000000, // Device Size (16MB)
256, // Programming Page Size (16 pages a 256)
0, // Reserved, must be 0
0xFF, // Initial Content of Erased Memory
300, // Program Page Timeout 300 mSec
3000, // Erase Sector Timeout 3000 mSec

// Specify Size and Address of Sectors
0x001000, 0x000000, // Sector Size 4kB (4096 Sectors)
SECTOR_END
};

The attached document "FlashPrg.c" for your reference.

 

0 Kudos