SPIFI library for non-Keil development

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

SPIFI library for non-Keil development

2,367 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pcalton on Tue Aug 27 15:55:16 MST 2013
Are there any plans to release an LPCXpresso version of the spifi library?

We'd really like to use the SPIFI on our product, but all the of example projects I have seen have been Keil based and our IDE is not Keil.
Labels (1)
0 Kudos
Reply
15 Replies

2,263 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by embeddedguy on Wed Apr 30 10:10:27 MST 2014
I like MarcVonWindscooting's reply  8-)

I see that NXP has posted a new beta SPIFI library package for the LPC43xx on the LPCOpen related downloads' column for the Keil MCB board. 
http://www.lpcware.com/content/nxpfile/lpcopen-software-development-platform-lpc43xx-packages
0 Kudos
Reply

2,263 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MarcVonWindscooting on Sat Nov 02 14:39:01 MST 2013

Quote: pcalton

We have lost over a week of development time on this issue, eventually writing our own SPIFI driver with no working example (that show how the peripheral itself is manipulated to meet the requirements of a given SPIFI chip) to use as a guide.



No, you have not lost a week. You've won the understanding, that you cannot have the NXP support team provide you with the pre-build libraries for your commercial project on your favourite platform / IDE (acronym for "I don't edit"). Example code is not production code - at least to my understanding. Why at all not have the LPCXpresso team have provide support for your final product?? You use their chips, isn't that enough of honour?  :bigsmile:

I once used 'foreign' code (uIP) in one of our company's project. The final product turned out to be not stable, when running for months. Who is to blame? The author of uIP? Really?
I never did such again. uIP is open source. I don't understand it. The intersection of my coding style and uIP's coding style is plain empty besides uIP beeing plain illegal code for a modern C-compiler (restrict, type casts,...). But that's irrelevant. My project, my responsibility, my fault :exmark: No one else is to blame for 'lost time' or 'delays' or 'malfunction' except me, myself and I.

You should be proud of having built your own SPIFI driver and if you want to contribute to a community, you should share your code. Because that solved your problem, right?  ;-)
0 Kudos
Reply

2,263 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by noahk on Tue Sep 10 10:22:08 MST 2013
Hi pcalton,

I have posted a useful SPIFI example that demonstrates how to work with this peripheral without the use of a library. Please see
http://www.lpcware.com/content/forum/spifi-errata-and-part-version-information#comment-1023028

The thread also continues with some questions and answers on this example. I hope this helps you.

Let me know if you have any questions.

Noah
0 Kudos
Reply

2,263 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pcalton on Tue Sep 10 08:04:48 MST 2013
Hi LPCXpresso Support,

We are using Atollic, which is an eclipse based IDE. LPCware support Keil, IAR and LPCXpresso (which is also eclipse based). Asking for help on an unsupported platform doesnt tend to get very far, but a working example on a very similar platform can be a great aid to finding where a roadblock might exist in our IDE.

That said, the secrecy surrounding the SPIFI library is astonishing. We have lost over a week of development time on this issue, eventually writing our own SPIFI driver with no working example (that show how the peripheral itself is manipulated to meet the requirements of a given SPIFI chip) to use as a guide.
0 Kudos
Reply

2,263 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hlsa on Mon Sep 09 02:17:09 MST 2013
Hi kenh6942,

thank you for your response. Now SPIFI works.


However, I still do have these mysterious linker warnings and errors (yes, it works even though there is a linker error). Here an example:
c:/gcc/arm-2012q1/bin/../lib/gcc/arm-none-eabi/4.6.3/../../../../arm-none-eabi/bin/ld.exe: warning: C:\T\M4\Bsp\Cmsis\spifi_drv_M4.lib(spifi_rom_api.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/gcc/arm-2012q1/bin/../lib/gcc/arm-none-eabi/4.6.3/../../../../arm-none-eabi/bin/ld.exe: error: C:\T\M4\Bsp\Cmsis\spifi_drv_M4.lib(falcon_details.o): Conflicting CPU architectures 13/0


It seems that others already had the same problem, but I could not find any solution yet.
http://www.lpcware.com/content/forum/running-spi-flash


I don't feel good getting warnings & errors without knowing what is going on. Anybody an idea?


Best regards,
Holger

0 Kudos
Reply

2,263 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kenh6942 on Fri Sep 06 11:49:04 MST 2013
Holger,

Saw your post in the other forum; seemed more apt to respond to this one given the source of the problem. The library linked above is for LPC407x/408x, not LPC43xx. On the LPC407x/8x, the SPIFI peripheral is located at 0x20094000.

Mayhaps this library is what you need? http://www.lpcware.com/content/nxpfile/lpc4350apdlzip
0 Kudos
Reply

2,263 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Sep 02 04:03:43 MST 2013

Quote: pcalton
Using the spifi library you linked I get linker errors looking for __aeabi_memcpy4, __aeabi_memclr, etc.



These are standard ARM EABI (AEABI) functions, as per...

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.subset.swdev.abi/index.html

You originally mentioned LPCXpresso - where projects created by the project wizards will automatically pull in appropriate AEABI library code. However one of your later posts then appears to show that you are actually using Atollic. You'll need to check their documentation with regards to how to pull in AEABI library code.

Regards,
LPCXpresso Support
0 Kudos
Reply

2,263 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hlsa on Mon Sep 02 02:50:31 MST 2013
Using GCC 4.6.3 I do have a similar problem.

Here is my code:
void FvSpifiInit(void)
{
  int32_t ret = 0;
 
  LPC_SCU->SFSP3_3 = SSP_IO | 3;  /* P3_3: SPIFI_SCLK */
  LPC_SCU->SFSP3_4 = SSP_IO | 3;  /* P3_4: SPIFI_IO3 */
  LPC_SCU->SFSP3_5 = SSP_IO | 3;  /* P3_5: SPIFI_IO2 */
  LPC_SCU->SFSP3_6 = SSP_IO | 3;  /* P3_6: SPIFI_IO1 */
  LPC_SCU->SFSP3_7 = SSP_IO | 3;  /* P3_7: SPIFI_IO0 */
  LPC_SCU->SFSP3_8 = SSP_IO | 3;  /* P3_8: SPIFI_/CS */
 
  /* Enable clock source for SPIFI */
  LPC_CGU->BASE_SPIFI_CLK = 1<<24 | 1<<11; /* clock source IRC 12 MHz */
 
  ret = pSpifi->spifi_init(&obj, 3, S_RCVCLK | S_FULLCLK, 12);   
}


pSpifi points correctly to spifi_table, which is linked into my program code (0x1a035198). The spifi functions from the library are also correctly linked into the program (e.g. spifi_init at 0x1a01309c).


During linking, I get the following warning:
ld.exe: warning: C:\T\IPD10G2\M4\Bsp\Cmsis\spifi_drv_M4.lib(spifi_rom_api.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail

Running the program ends in an exception.
I debugged the assembler code of the spifi library: in the init function a ldr-Instruction loads data from 0x29004018 (see screenshot), which is obviously an invalid address.

I use the library which is mentioned above (file size: 35468 bytes). My controller is a LPC4357.


What's going wrong?


Best regards,
Holger
0 Kudos
Reply

2,263 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pcalton on Sat Aug 31 19:30:35 MST 2013
Using the spifi library you linked I get linker errors looking for __aeabi_memcpy4, __aeabi_memclr, etc.

This seems similar to the issue at http://www.lpcware.com/content/forum/emwin-linking-gnu-tools-arm where the solution was to use a library 'compiled using gcc compiler "arm-none-eabi-gcc"'

0 Kudos
Reply

2,263 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Fri Aug 30 13:15:00 MST 2013
Hi pcalton,
Please use spifi library from below link, only if your device is LPC408x_7x
http://www.lpcware.com/content/nxpfile/lpc407x-and-lpc408x-cmsis-compliant-standard-peripheral-firmw...

For LPC4357 you need to have library from LPC43xx driver

0 Kudos
Reply

2,263 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Fri Aug 30 09:40:37 MST 2013

Quote: pcalton
Are there any plans to release an LPCXpresso version of the spifi library?

We'd really like to use the SPIFI on our product, but all the of example projects I have seen have been Keil based and our IDE is not Keil.



There is an LPC18/43 SPIFI flash programmer project supplied in the LPCXpresso examples directory which use the SPIFI library code.

Regards,
LPCXpresso Support
0 Kudos
Reply

2,263 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pcalton on Fri Aug 30 07:58:12 MST 2013
static SPIFI_RTNS * pSpifi;
void SPIFI_Init(void)
{
pSpifi = &spifi_table;
}


SPIFI_Init doesnt do anything else yet because Im just trying to see if I can get the library to even link with GCC

Is there a reason that the source for this code isnt open?
0 Kudos
Reply

2,263 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Thu Aug 29 17:56:21 MST 2013
Hi pcalton,
Please post your code.
0 Kudos
Reply

2,263 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pcalton on Thu Aug 29 08:08:58 MST 2013
I have to rename the file from spifi_drv_M4.lib to libspifi_drv_M4.a for it to be found.

When I then compile I get a bunch of errors and warnings of the follow form for what seems like every .o in the library

c:/program files (x86)/atollic/truestudio for arm pro 4.1.0/armtools/bin/../lib/gcc/arm-atollic-eabi/4.7.3/../../../../arm-atollic-eabi/bin/ld.exe: warning: C:/mypath\libspifi_drv_M4.a(spifi_rom_api.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail

c:/program files (x86)/atollic/truestudio for arm pro 4.1.0/armtools/bin/../lib/gcc/arm-atollic-eabi/4.7.3/../../../../arm-atollic-eabi/bin/ld.exe: error: C:/mypath\libspifi_drv_M4.a(falcon_details.o): Conflicting CPU architectures 13/0


My target is the LPC4357 and the library is the M4 variant, so Im not sure why there should be conflicting CPU architectures.
0 Kudos
Reply

2,263 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Wed Aug 28 20:20:10 MST 2013
Hi pcalton,
Did you try to link the currently available library? It should work.
Please post your feedback on the forum.
0 Kudos
Reply