Help, SPIFI step by step

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

Help, SPIFI step by step

2,477 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rodri on Tue May 10 11:21:01 MST 2016
Hi,

I'm so confused with this interface, can somebody help me?

If is possible I need a tutorial of using SPIFI with a flash device that is not included in the Library device list.

thanks in advance!

regards
Labels (1)
Tags (1)
0 Kudos
Reply
10 Replies

1,792 Views
rodrigosnider
Contributor I

Hi,

First of all thank you for your complete answer.

Sorry but I'm not familiar with linker scripts, where I can find those .ltd files? or what I must do?

I'm very noob with ARM cortex MCUs, I'm trying to understand how it works but it is very complex...

Thank you!

PD: In my oppinion LPCware was better than this site, now I can't find the forums.

0 Kudos
Reply

1,792 Views
rodrigosnider
Contributor I

Okey, I found how to do it. I used "Relocating majority of application into RAM" procedure.

Now, at startup the code is copied to Ram, but except the main function. When I debug, I can see that my code is over 0x10000000 adrress but in the main section, all the instructions are: "movs r0,r0", and my mcu freezes after boot.

Any idea about what is happening?

Thank you!

regards.

0 Kudos
Reply

1,792 Views
lpcware
NXP Employee
NXP Employee
bump
0 Kudos
Reply

1,792 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Jun 09 00:56:53 MST 2016
LPC4370 is a flashless device, which means when you create a project for this part, you need to tell the tools something about the external flash that is connected in your system.

First of all, go and read :

[list]
  [*]The LPCXpresso IDE User Guide, in particular the section on the memory configuration editor
  [*]https://www.lpcware.com/content/faq/lpcxpresso/lpc18-lpc43-spifi-flash-drivers
[/list]

Make sure that the LPC-Link2 you are using as a debug probe (the one connected to your PC over USB) has jumper JP2 closed, so that it provides power to the target LPC-Link2. Leave JP1 open.

Make sure that the target LPC-Link2 has JP1 closed and JP2 open.

Normally, code that you program into flash will be run directly from the flash. It will only be downloaded into RAM to execute if you take steps to cause this to happen. More information on that at:

https://www.lpcware.com/content/faq/lpcxpresso/relocating-code-flash-ram

You can also download code directly into the RAM and run from there if you don't specify a flash device in your project setup. But you will need to read this if you do that:

https://www.lpcware.com/content/faq/lpcxpresso/debugging-lpc18xxlpc43xx-ram-images


With regards to SPIFI device support, the LPCSPIFIlib can be extended to support further parts. But if you really want to handle SPIFI yourself, I suggest you start off by reading:

https://www.lpcware.com/content/blog/introduction-spifi

I suggest that you go back to basics though and start off by just looking at the examples supplied in the LPC4370/Link2 LPCOpen package. You really appear to be trying to jump in at the deep end without understanding the basics.

Also, go and watch the videos linked to from:

http://nxp.com/pages/:LPCXPRESSO

Regards,
LPCXpresso Support
0 Kudos
Reply

1,792 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rodri on Tue Jun 07 11:02:23 MST 2016
Sorry, can you helpme?
0 Kudos
Reply

1,792 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rodri on Tue May 17 07:02:41 MST 2016
HI,

1. I have 2 link2 boards, 1 as debug probe and the other as a target.
2. Is the default link2 device (W25Q80)
3. No, is link2.
4. Mi code is placed at W25Q80, the same memory that I'm triying to read/write. But when MCU boots from flash it moves the code to internal RAM, correct? it should not be a problem.
5. No, my code is only for a read/write test, so I cleared all the useless code/interrupts.
6. Because in the future I want to use other device, unsuported by this lib. (N25Q00AA13G).

Maybe I need an example, it should clarify me. With and without lib, if you have i will really appreciate, I'm so lost.

Thanks and regards
0 Kudos
Reply

1,792 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon May 16 05:04:10 MST 2016
We really need more information than you have supplied to offer any help.

1 - are you using an LPC-Link2 as a debug probe or a target (it can work in both modes)
2 - what is the SPI flash device you are trying to program. Is this the device on the LPC-Link2 or another device.
3 - is this your own board design?
4 - from what memory device is your code running when it tries to 'reset SPIFI'
5 - do you have any interrupts running?
6 - is there a reason you don't wish to use the LPCspifilib

Yours,

LPCXpresso-support
0 Kudos
Reply

1,792 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rodri on Mon May 16 04:10:53 MST 2016
I'm using LPC link2 with default flash device.

This code is executed in the main function, after chip and board init. When I'm debuging, a message such "no source available for 0x10401626" appears, and then MCU don't response until I reset it.
When I program release version and execute it, MCU gets freeze (only if I include these lines in the program).
0 Kudos
Reply

1,792 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Sun May 15 09:19:18 MST 2016
So is the code you are executing running out of the SPIFI memory when you reset it?

And what device are you trying to add support for. In many cases, adding a new device is simply a matter of adding a new entry to the table of support devices (extracting the required parameters from the devices datasheet).

Regards,
LPCXpresso Support
0 Kudos
Reply

1,792 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rodri on Fri May 13 19:43:52 MST 2016
I'm trying to make my own lib.

When my MCU execute this line:

Quote:
LPC_SPIFI->STAT |= 0x10;//Reset SPIFI


Debug is lost, also if I use release version, MCU becomes freeze, I don't know what is happening.

Anybody has idea about SPIFI?

thanks
0 Kudos
Reply