SPIFI with LPC1857

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

SPIFI with LPC1857

Jump to solution
1,693 Views
Suresh1994
Contributor II

Dear Concern,

We are trying to interface WinBond W25R128JV with LPC1857. We have successfully achieved programming the same using JTAG and OpenOCD but we are facing problems in programming the same with flash magic UART and bootloader. As we looked onto this forum we have made all the necessary changes to the best of our knowledge but in vain.

  • We have taken the LPC1857 Keil example and modified the sector size from 256KB to 4 KB that is relevant to present SPIFI. We have cross-checked the addressing values with the IRAM and IROM on the Keil "options for target" We have generated a hex file and placed it in the folder and it appears as valid. Now we used hardware pins P2.9, 2.8, 1.2, 1.1 as low. We have made ISP pin P2.7 as low and reset the board.
  • It goes into ISP mode and we have tried to use program an application and the bootloader we have created but Flash Magic stops abruptly and closes itself or it gives the error message "Bootloader in RAM is not executing(2)"

We have few doubts about the above setup actually.

  • We are using Just U0 RX, Tx, and gnd to the interface. After thorough research, by seeing Keil mcb schematics we found that RTS and DTR signals are being used but not in any other Schematics of Keil MCB boards. Do we really require it?? If yes, what is the role?
  • Can you briefly explain the steps to be followed on hardware and software to successfully achieve.

Awaiting for your reply
Regards
R Suresh

Labels (1)
0 Kudos
1 Solution
1,445 Views
Suresh1994
Contributor II

Hey Everyone,

Finally, We could solve the problem. Here is the complete solution If you are struggling with loading hex files onto SPIFI using ISP.

Hardware Requirements:

You Just need Tx(P2_0), Rx(P2_1) and Gnd connected to your ISP Programmer. 

Software Requirements:

You need Two hex files, one is end application hex file which you want to put into SPIFI say application.hex and then the bootloader hex file and obviously the Flash Magic(Latest recommended)

Steps:

1. To modify the boot loader, open the example given in C:\Program Files (x86)\Flash Magic\Bootloaders\External Memory\S25FL129P\LPC1857-Keil and then modify FlashPrg.c descriptor to specific values needed(mostly Sector Size, bytes to program at once).  BaudRate = 57600 at both places recommended as we observed data loss for greater baudrates. modifying description is optional.

Suresh1994_0-1640698871793.png

2. Change the Output options as you wish and you get a bootloader hex file to be placed on the location C:\Program Files (x86)\Flash Magic\Bootloaders.

3. Now the important step to generate application hex file with adrress mapping to 0x8000 0000 to 0x87FF FFFF but NOT 0x1400 0000 to 0x17FF FFFF. Its because of the above descriptor and description from the Manual

Suresh1994_1-1640699226178.png

4. Once both hex files are ready, Open Flash Magic, Change the device to External Memory-> UART. You should see your bootloader hex file there and choose it.  Choose the application hex file too.

Suresh1994_3-1640699571173.png

5. Click start and first Erasing happens and then programming. Because the LPC18xx series support XIP, the program should start itself on reset.

Hope this have helped you and have a great day.

To some users, this is not a place where you learn free and charge someone to acheive the same. Kindly have some Ethics and support the OPEN Community. 

Keep smiling and spread the Knowledge.

Regards

Suresh

 

 

 

View solution in original post

4 Replies
1,446 Views
Suresh1994
Contributor II

Hey Everyone,

Finally, We could solve the problem. Here is the complete solution If you are struggling with loading hex files onto SPIFI using ISP.

Hardware Requirements:

You Just need Tx(P2_0), Rx(P2_1) and Gnd connected to your ISP Programmer. 

Software Requirements:

You need Two hex files, one is end application hex file which you want to put into SPIFI say application.hex and then the bootloader hex file and obviously the Flash Magic(Latest recommended)

Steps:

1. To modify the boot loader, open the example given in C:\Program Files (x86)\Flash Magic\Bootloaders\External Memory\S25FL129P\LPC1857-Keil and then modify FlashPrg.c descriptor to specific values needed(mostly Sector Size, bytes to program at once).  BaudRate = 57600 at both places recommended as we observed data loss for greater baudrates. modifying description is optional.

Suresh1994_0-1640698871793.png

2. Change the Output options as you wish and you get a bootloader hex file to be placed on the location C:\Program Files (x86)\Flash Magic\Bootloaders.

3. Now the important step to generate application hex file with adrress mapping to 0x8000 0000 to 0x87FF FFFF but NOT 0x1400 0000 to 0x17FF FFFF. Its because of the above descriptor and description from the Manual

Suresh1994_1-1640699226178.png

4. Once both hex files are ready, Open Flash Magic, Change the device to External Memory-> UART. You should see your bootloader hex file there and choose it.  Choose the application hex file too.

Suresh1994_3-1640699571173.png

5. Click start and first Erasing happens and then programming. Because the LPC18xx series support XIP, the program should start itself on reset.

Hope this have helped you and have a great day.

To some users, this is not a place where you learn free and charge someone to acheive the same. Kindly have some Ethics and support the OPEN Community. 

Keep smiling and spread the Knowledge.

Regards

Suresh

 

 

 

1,641 Views
Anonymous-III
Contributor III

Hi @Suresh1994,

We have also faced similar issue, but we were able to solve the problem.

You can contact us for further details.

Thanks

Tags (2)
1,674 Views
nxf77486
NXP TechSupport
NXP TechSupport

Hello @Suresh1994 ,

Just to have more info related to your ticket, are you including the sections of memory that are in the User Manual, chapter 5,  5.4.5.7 RAM used by ISP and 5.4.5.8 RAM used by IAP command handler.

Also in the Table 19 you will find the Winbond supported.

User Manual

https://www.nxp.com/webapp/Download?colCode=UM10430

0 Kudos
1,668 Views
Suresh1994
Contributor II

Dear @nxf77486,

We have taken the sample code given by Flash Magic External bootloader section code(attached). The flashprg.c for given S25L129P example is as follows. We have just modified the programmable sector size for

Suresh1994_1-1634018988658.png

To answer your question, No we are not using the specified RAM space. you can see that being highlighted in the screenshot.

Kindly look into the attached code and guide accordingly.

0 Kudos