how to erase spi flash memory on xk1A?

If you have a simple question and just want an answer.
jigneshprajapati
Member
Posts: 10
Joined: Tue May 13, 2014 12:54 pm

how to erase spi flash memory on xk1A?

Post by jigneshprajapati »

I want to erase spi flash memory using linflash api or flash.h. I have written small program which is given below.#include #include #include #define MAX_PSIZE 256/* initializers defined in XN file* and available via platform .h */ fl_SPIPorts SPI = { PORT_SPI_MISO , PORT_SPI_SS , PORT_SPI_CLK , PORT_SPI_MOSI , XS1_CLKBLK_1 }; fl_BootImageInfo b;int main () {/* main application - calls upgrade* to perform an in - field upgrade */ fl_connect ( SPI ); fl_deleteImage(b); fl_disconnect (); return 0;}when i build the program it gives error that Undefined reference to 'fl_connect' ,Undefined reference to 'fl_deleteImage', Undefined reference to 'fl_disconnect'. and also how delete spi flash memory using command prompt?


User avatar
sethu_jangala
XCore Expert
Posts: 589
Joined: Wed Feb 29, 2012 10:03 am

Post by sethu_jangala »

you are getting errors because, the library flash is not being recognised. You need to add the flash in your application Makefile as shown below:XCC_FLAGS = -g -O3 -lflashYou can get more details about library flash APIs from the following link:https://www.xmos.com/support/xtools/doc ... 0Pr...Also, have a look at the xflash command line manual:https://www.xmos.com/support/xtools/doc ... Flash%20Pr...