iMX8MN ECSPI Master multi burst SS_CTL

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

iMX8MN ECSPI Master multi burst SS_CTL

5,325 次查看
ycx
Contributor I

Hi,

I try to have a master send multi burst (21) of size 8 bits each on ECSPI1 from cortex M7. I want to keep CS/SS low during the transfer of 21 bursts.

As per reference manual I configure the following : 

config->channel           = kECSPI_Channel0;
config->burstLength = 8;
config->samplePeriodClock = kECSPI_spiClock;
config->baudRate_Bps = 10000000;
config->chipSelectDelay = 0;
config->samplePeriod = 0;
config->txFifoThreshold = 1;
config->rxFifoThreshold = 0;
/* Default configuration of channel */
ECSPI_GetDefaultChannelConfig(&config->channelConfig);

config->channelConfig.channelMode = kECSPI_Master;

 

ECSPI_CONREG_SMC set to 0

ECSPI_CONFIGREG_SS_CTL set to 1

 

Fill the TxData buffer with ECSPI_MasterTransferNonBlocking and then put ECSPI_CONREG_XCH to 1.

What I see on logic analyzer still has the CS/SS rising between bursts : 

ycx_0-1634820306407.png

What am I missing ? 

Thanks.

0 项奖励
回复
10 回复数

5,290 次查看
Yuri
NXP Employee
NXP Employee

@ycx 
Hello,

  hope the following clarifies the issue.

https://community.nxp.com/t5/i-MX-Processors/imx8-ecspi-Master-Mode-with-SS-CTL-Control/m-p/984674

 

Regards,
Yuri.

0 项奖励
回复

5,282 次查看
ycx
Contributor I

Hi Yuri,

It does not help as the issue is not resolved.

In the chip errata I found an entry that looks like my issue :

ERR009535: ECSPI: Burst completion by SS signal in slave mode is not functional.

But specified only for slave mode. Are you sure it is not the case also for master mode ?

Thanks,
Yann

0 项奖励
回复

5,278 次查看
Yuri
NXP Employee
NXP Employee

@ycx 

Yes, ERR009535 is for the SPI slave mode.

For the master mode - It is needed to avoid situations, when FIFO
is underflowed (empty) - then the SS is not negated.

Or - to use a GPIO instead of the SS.

~Yuri.

 

0 项奖励
回复

5,275 次查看
ycx
Contributor I

Yuri,

FIFO is filled with 21x uint32 before XCH is set to 1, so it is not underflowed after each value is sent and SS should remain negated during sending of these 21 values.

I cannot use GPIO.

Regards,
Yann

0 项奖励
回复

5,270 次查看
Yuri
NXP Employee
NXP Employee

@ycx 
Hello,

   please try ECSPIx_CONREG[BURST_LENGTH] = 21 x 32 -1

Regards,
Yuri.

0 项奖励
回复

5,266 次查看
ycx
Contributor I

Still no : 

ycx_0-1635240121326.png

I really tried all the combinations.

Yann

0 项奖励
回复

5,262 次查看
kef2
Senior Contributor V

Hi

I believe @Yuri meant 21*8-1. You want to sent 21 octets, not 21 * 32 bit words. What you see in your last waveform should be SS toggling each 512 bits. 512 bits is eCSPI single burst limit. As well

 

FIFO is filled with 21x uint32 before XCH is set to 1

 

You should fill FIFO writing 32bit words (21+(4-1)) / 4 times. First write should include first (21 % 4) bytes, the rest of writes should write next 4 bytes each time. 

Or, as it was already suggested, toggle SS from software.

 

Edit: Sorry, BURST_LEN of ECSPIx_CONREG register should be limited to 512 bytes, not bits. Field limits 0..0xFFF should mean 1..4096 bits, or up to 512 bytes.

Edward

5,244 次查看
Yuri
NXP Employee
NXP Employee

@kef2 
@ycx 
Hello,

  Note: bytes should be packed into 32-bit FIFO words.

Regards,
Yuri.

0 项奖励
回复

5,248 次查看
ycx
Contributor I

Hi Edward,

Thank you for your proposition. 

Indeed this can be achieve but unfortunately the daisy chained slaves that I access need some wait states in between words which I don't know how to add if burst length is anything other than 8.

Regards,
Yann

0 项奖励
回复

5,239 次查看
kef2
Senior Contributor V

Hm,

If slaves are slow, then lowering clock rate should help. If indeed you need pause between each burst of 8 bits, then clearly you should toggle SS from software.

Edward

 

0 项奖励
回复