SPI Flash Example for xmc4500 Relax Kit

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
User17149
Level 2
Level 2
First solution authored
I cannot get the external (not the one onboard in the processor) SPI Flash on the relax kit to work

I migrated the sample app SPI_EXAMPLE_XMC45 to XMC4500-F100x1024 and adjusted the pins according to the Relax Kit Board User‘s Manual Figure 6 Table (Page 13)

4764.attach

I also tried all the 4 different clock settings

5227.attach

Still, in main.c:139 (see attaches main.c) the status read after a write enable returns tmp == 0x0, which indicates an error

N25Q03_WriteEnable();

/* Read Status registers */
tmp = N25Q03_StatusRead();
if (tmp != 0x0002) /* not enabled */
return 2;


I also replaced the provided flash chip on the relax kit board, with a Cypress S25FL128L Flash chip and still get the same result (with all 4 clock settings).

Any ideas what else needs to be adjusted?

It would great if infineon could provide one SPI Flash Sample for the relaxkit (and not just for the xmc4500) because after all the idea behind the relax kit is that it is packaging of components that work together.

thank you and best regards

Kuros Yalpani
0 Likes
6 Replies
SudheeshK
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted
Hello,

Could you please change the clock setting to "High if inactive, transmit of falling clock edge, receive on rising clock edge" and test again"?

Thanks and Regards,
Sudheesh
0 Likes
User17149
Level 2
Level 2
First solution authored
Hello Sudheesh,

Thank you very much for your reply. I just saw your post now, for some reason I do not receive notifications on my thread. I tried what you said but it does not work and also with the QSPI example.
What I do not understand is why infineon does not provide a working sample for the relax kit? After all it is a platform to try and extend the base software. It seems to be
just a matter of configuration. Thanks again...
0 Likes
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked
Hello,

Note that, the example code contains the commands and function definitions tuned for N25Q03 memory chip. Did you modify the N25Q03.c file with the right command structure for the Cypress S25FL128L Flash chip?

If yes, please share these files and also the datasheet for the external memory chip you are interfacing with. That will give us more insight into why it's failing.

Regards,
Dheeraj
0 Likes
lock attach
Attachments are accessible only for community members.
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked
Dear Users,

Attaching XMC 4500 relax kit based example for reference.

Best Regards,
Vasanth
0 Likes
User22217
Level 1
Level 1
First reply posted First question asked
Hi,
Flash N25Q03.
I need to save and read an struct to the flash.

example of the struct:

typedef struct TparDiv
{
uint32_t SsTime; //minutos
double SsTmax;
double SsPot;
double StByTemp;
uint32_t zCF;
uint32_t SisOp;
} TparDiv_t;


Declaration of the struct
TparDiv_t TparDiv;

code
if(DIGITAL_IO_GetInput(&BT_1))
{
N25Q03_WriteEnable();
st=N25Q03_StatusRead();
N25Q03_SectorErase( 0x00000000);
do
{
st = N25Q03_StatusRead();
} while (st & 0x0001); /* wait until busy=0 */



TparDiv.SsPot=40.0;
TparDiv.SisOp=2;

N25Q03_ProgrammPage( 0x00000000,(uint8_t *)&TparDiv,sizeof(TparDiv));

N25Q03_ReadPage(0,(uint8_t *)&readval,sizeof(readval));

Can any one help me with that?

i am trying using the N25Q03_ProgrammPage and the read page as well fuction but it´s not working

thanks in advance
0 Likes
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked
Hi Luis,

Could you please start a new thread rather than appending question to an older thread. If you want to refer this thread, you can always add a link to this thread. This will help us to isolate issues, based on specific issues.

Best Regards,
Vasanth
0 Likes