eren-terzioglu commented on issue #13855:
URL: https://github.com/apache/nuttx/issues/13855#issuecomment-2426461702

   Hi @FelipeMdeO ,
   
   I checked the issue and seems it is some kind of feature. Code flow works 
like that:
   
   - Master devices creates an interrupt and 
`[spislave_periph_interrupt](https://github.com/apache/nuttx/blob/master/arch/risc-v/src/common/espressif/esp_spi_slave.c#L599)`
 funtion handles that interrupt
   - Interrupt handler recieves the incoming value into rx buffer
   - Interrupt handler starts transaction what is in the tx buffer (which is 
all zeros in this case)
   - After write operation code goes to 
`[spi_slave_write](https://github.com/apache/nuttx/blob/master/drivers/spi/spi_slave_driver.c#L392)`
 function
   - 
`[SPIS_CTRLR_ENQUEUE](https://github.com/apache/nuttx/blob/master/drivers/spi/spi_slave_driver.c#L437)`
 macro calls there end it goes to 
`[spislave_enqueue](https://github.com/apache/nuttx/blob/master/arch/risc-v/src/common/espressif/esp_spi_slave.c#L247)`
 function [which copies data from rx buffer to tx 
buffer](https://github.com/apache/nuttx/blob/master/arch/risc-v/src/common/espressif/esp_spi_slave.c#L932)
   
   this is the reason why first returned value is all zeros. Because first 
return value is not data that we recieved, what we have in tx buffer to send 
which is all zeros in this case
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to