SPIFI flash loader troubleshooting

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

SPIFI flash loader troubleshooting

810 Views
jm_buis
Contributor I

Hello,

I am using the Hitex LPC4350 (flashless) evaluation board. I would like to have my code running from the (external) SPI flash chip that is on the devboard (Spansion type, should be supported since I found several examples for this specific board). I am working in IAR, I found a pre-written flash loader for SPIFI that should work with my setup, but I am having a hard time getting it working.

In my linker file I tried placing the readonly section of my code at the address of the SPIFI memory that is in the manual (0x1400 0000) and the readwrite, cstack and heap sections in SRAM. However, when I try to flash, an error pops up saying the flash loader tries to write outside the flash memory (giving 0x1400 0000 as invalid address). The SPI flash peripheral is mapped to address 0x0000 0000 (shadow register), but if I understand correctly the shadow register can only be used for read operations, so the flash loader should not be able to write any code to that address.

I also looked at the code of the flash loader itself, but there's not really any useful comments on how to use it. In the readme it says that the flash loader expects the application to be linked at address 0x000 0000, but I'm not sure what that means, since this is not a valid location to store my application before it gets programmed in flash. I've been working on it for a while now, but I can't get it working and I'm not sure how to continue now. Does anybody have an idea of where to start from here?

Labels (3)
0 Kudos
4 Replies

569 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Jan,

     About the code works in the external QSPI flash, you totally can use our Hitex LPC4350 Lpcopen code, which can be downloaded from this link, IAR and MDK project:

https://www.nxp.com/downloads/en/libraries/lpcopen_3_02_keil_iar_hitex4350.zip 

   You can test the blinky-spifi_hitex_eva_4350 project. 

   I don't know when you use the according flashloader, do you also change the linker file? The linker file also need to relocated to flash address 0x1400 0000.

pastedImage_8.png

pastedImage_9.png

Wish it helps you!

If you still have question about it, please kindly let me know!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

569 Views
jm_buis
Contributor I

Thank you for your elaborate answer and the screenshots Kerry Zhou, very helpful!

Unfortunately I can't get it working just yet. I've tried to use the same addresses and linker/board files as in the screenshots, both for my own project and for the example blinky project, but no matter what I do, I get the "Writing outside flash memory at address 0x1400000" error when I try to flash.. Any more ideas?

Also, do I need to adapt the flash file itself as well? When I open the flash file, it says base address 0x00000000, is that correct?

Also also,  is address 0x94000000 and offset or an absolute address (also, what is the reason for this)?

0 Kudos

569 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Jan,

  What's the debugger you are using?

   Could you also give me a screen shoot about your address error?

Have a great day,
Kerry

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

569 Views
jm_buis
Contributor I

Hi Kerry Zhou,

In the meantime I got the parallel flash (NOR) that's on the board working, but I would still like to know what is going wrong with regard to the SPIFI. I can also get applications to work if I write to RAM only.

So the setup I'm using is:

Hitex A4 board with LPC4350. IDE is IAR Workbench 7.40. I'm using a J-Link (Plus) JTAG debugger to write to the memory. Firmware is J-Link V9 (should be up to date for the version of IAR I'm using). Below the complete debug log, including the error.

Flash_error.PNG

0 Kudos