External data Flash SPI

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

External data Flash SPI

1,005 Views
marcos_chiele
Contributor I

Hello All.

I am trying to communicate an RX1051 microcontroller with an external data flash through SPI.

Actually, communication is working well, I am able to send a command and receive the answer.

However, when I try to send a sequence of bytes to write a page (usually 256 bytes), the communication is interrupted after some bytes.

I checked the SDK example, but in the example, the CS is changed after each byte, it can not occur to me. The CS must be down before the first byte and must be high only after the last byte.

can you give me some help?

Labels (1)
0 Kudos
5 Replies

898 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Marcos, 

Unfortunately, it is not possible to modify this functionality of the chip select signal. As a workaround, you can use a normal GPIO instead of the chip select of the module. This way you can manually send the signal to low and sending it high until you finish sending the data. Keep in mind that when you do this, you have to verify that this signal will fulfill the timing parameters that your memory is expecting. 

Have a great day,

Victor

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct"button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored

Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

------------------------------------------------------------------------------- 

0 Kudos

898 Views
Masmiseim
Senior Contributor I

Hello,

 

I think with setting the CONTC Flag in the TCR register you should be able to keep the chip select Signal low.

TCR_CONTC.png

Best regards

0 Kudos

898 Views
marcos_chiele
Contributor I

Hello guys, thanks for the tips.

Actually, I did some tests with TransferBlocking function, and it's working well.

I configured the xfer struct with the flag "kLPSPI_MasterPcsContinuous". The CS is not going high during the transfer, so its ok for me.

Now, a new problem is occurring.

When I try to read some data array from my external memory, if the size is "big", a hard fault is occurring. I am reading only 32 bytes each time. If I try to read 64 bytes, hard fault...

Do you have some ideas about that?

0 Kudos

898 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Marcos, 

I'm glad to hear that the chip select problem is fixed now!

Regarding the new behavior that you are facing, could you please provide more information about the hard fault that you are getting? Are you able to track this issue in the debug session to see where exactly this hard fault is happening? What is happening with the SPI bus once the hard fault occurs? Also, if you could explain how you are reading the 64 bytes it would be really helpful.


Sorry for the multiple questions but since I cannot reproduce this behavior on my end, I need to have as much information as possible to try to find the root cause of this behavior.

Regards, 

Victor 

0 Kudos

898 Views
marcos_chiele
Contributor I

Hello Victor.

Actually I was using the RX and TX buffers with different sizes.

Using them with the same size, it's working fine now.

Thank you very much.

Marcos Roberto CHIELE

Valeo Thermal Bus Systems

Development Engineer

Valeo Climatização do Brasil – Veículos Comerciais S/A

+55 (54) 2101 5895

Avenida Rio Branco 4688 | B. São Cristóvão

<https://maps.google.com/?q=AvenidaRioBranco4688%7CB.S%C3%A3oCrist%C3%B3v%C3%A3o95060-145CaxiasdoSul%E2%80%93RS%7C+Brasil&entry=gmail&source=g>

95060-145 Caxias do Sul – RS | Brasil

<https://maps.google.com/?q=AvenidaRioBranco4688%7CB.S%C3%A3oCrist%C3%B3v%C3%A3o95060-145CaxiasdoSul%E2%80%93RS%7C+Brasil&entry=gmail&source=g>

www.valeo-thermalbus.com/br

On Thu, Jun 25, 2020 at 8:44 PM victorjimenez <admin@community.nxp.com>

0 Kudos