Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: drivers: spi: spi_loopback: test failed since #34731 is merged #35539

Closed
ABOSTM opened this issue May 21, 2021 · 7 comments
Closed

tests: drivers: spi: spi_loopback: test failed since #34731 is merged #35539

ABOSTM opened this issue May 21, 2021 · 7 comments
Assignees
Labels
area: SPI SPI bus area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: medium Medium impact/importance bug Regression Something, which was working, does not anymore
Milestone

Comments

@ABOSTM
Copy link
Collaborator

ABOSTM commented May 21, 2021

Describe the bug
Since merge of #34731 drivers/spi: STM32: This solves SPI infinite loop on Transceive
tests/drivers/spi/spi_loopback/ is failed on

  • nucleo_f103rb,
  • nucleo_f746zg
  • stm32f3_disco

To Reproduce
Steps to reproduce the behavior:

  1. west build -p auto -b nucleo_f746zg tests/drivers/spi/spi_loopback/
  2. west flash
  3. See error

Expected behavior
test passed

Logs and console output

*** Booting Zephyr OS build v2.6.0-rc1-284-gc00504e875e2  ***
Running test suite test_spi
===================================================================
START - test_spi_loopback
I: SPI test on buffers TX/RX 0x20010131/0x20010a1a
I: SPI test slow config
I: Start complete multiple
I: CS control inhibited (no GPIO device)
I: Passed
I: Start complete loop
I: Passed
I: Start null tx
I: Passed
I: Start half start
I: Passed
I: Start half end
E: Buffer contents are different: 0x38,0x39,0x61,0x62,0x63,0x64,0x65,0x66,
E:                            vs: 0x35,0x36,0x37,0x38,0x39,0x61,0x62,0x63,

    Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/spi/spi_loopback/src/spi.c:382: spi_rx_half_end: (1 is true)
Buffer contents are different
 FAIL - test_spi_loopback in 0.54 seconds
===================================================================
Test suite test_spi failed.
===================================================================
PROJECT EXECUTION FAILED

Environment (please complete the following information):

  • OS: Linux,
  • Toolchain Zephyr SDK
  • Commit SHA 5f61d89
@ABOSTM ABOSTM added bug The issue is a bug, or the PR is fixing a bug area: SPI SPI bus platform: STM32 ST Micro STM32 area: Tests Issues related to a particular existing or missing test labels May 21, 2021
@erwango erwango added this to the v2.6.0 milestone May 21, 2021
@galak galak added the Regression Something, which was working, does not anymore label May 21, 2021
@galak
Copy link
Collaborator

galak commented May 21, 2021

Wonder if this is effectively a duplicate of #35297

@galak galak added the priority: medium Medium impact/importance bug label May 21, 2021
@jfischer-no
Copy link
Collaborator

Similar on nucleo_f413zh, I came across this while testing an SPI device. On nucleo_f413zh it is a bit different, data in RX buffer is shifted up one octet, reverting 0129884 fixes the issue.

*** Booting Zephyr OS build v2.6.0-rc1-299-gd999d5eb64f4  ***
Running test suite test_spi
===================================================================
START - test_spi_loopback
I: SPI test on buffers TX/RX 0x20000131/0x2000098e
I: SPI test slow config
I: Start complete multiple
I: CS control inhibited (no GPIO device)
I: Passed
I: Start complete loop
I: Passed
I: Start null tx
I: Passed
I: Start half start
I: Passed
I: Start half end
E: Buffer contents are different: 0x38,0x39,0x61,0x62,0x63,0x64,0x65,0x66,
E:                            vs: 0x37,0x38,0x39,0x61,0x62,0x63,0x64,0x65,

@ddkn
Copy link

ddkn commented May 24, 2021

I have a similar issue with the nucleo_f767zi, as seen here #35561, where @jfischer-no pointed it out.

After trying out what @jfischer-no said by reverting git revert 0129884, I get the following output:

*** Booting Zephyr OS build v2.6.0-rc1-321-gda844ad39fe7  ***
Running test suite test_spi
===================================================================
START - test_spi_loopback
I: SPI test on buffers TX/RX 0x20020131/0x20020a1a
I: SPI test slow config
I: Start complete multiple
I: CS control inhibited (no GPIO device)
E: Buffer contents are different: 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x61,0x62,0x63,0x64,0x65,0x66,0x00,
E:                            vs: 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

    Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/spi/spi_loopback/src/spi.c:151: spi_complete_multiple: (1 is true)
Buffer contents are different
 FAIL - test_spi_loopback in 0.50 seconds
===================================================================
Test suite test_spi failed.
===================================================================
PROJECT EXECUTION FAILED

    Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/spi/spi_loopback/src/spi.c:489: spi_async_call_cb: (ret is true)
one or more events are not ready

This is with a nucleo_f767zi.conf as a copy of nucleof746zg.conf.

@ddkn
Copy link

ddkn commented May 25, 2021

Does anyone know of a commit state where the nucleo-f103rb or nucleo-f767zi was working for SPI? I have both boards to test with, as well as the nucleo-L152.

@ABOSTM
Copy link
Collaborator Author

ABOSTM commented May 26, 2021

@ddkn
you can either go back to sha1: 13303c4
or simply revert #34731 (aka sha1 0129884)
I hope it will fix your SPI issue.

affrinpinhero-2356 added a commit to affrinpinhero-2356/zephyr that referenced this issue May 26, 2021
This commit reverted while loop on tx only.
This commit solves SPI loopback failure and SPI wrong behaviour on RX.
fix:
* zephyrproject-rtos#35297
* zephyrproject-rtos#35539

Revert "drivers/spi: STM32: This solves SPI infinite loop on Tranceive"

This reverts commit 50c2acb.

Signed-off-by: Affrin Pinhero <affrin.pinhero@hcl.com>
@ddkn
Copy link

ddkn commented May 26, 2021

Hi @ABOSTM,

Thanks for the response. I had tried the revert earlier, which had the buffer issue I mentioned. Where 013303c4 gives the same error message, but then @FRASTM in #35561 pointed out I need to connect D11 -> D12 for the loopback to work correctly (I assumed it was doing something internal). It works, now.

*** Booting Zephyr OS build v2.6.0-rc1-51-g13303c4351d9  ***
Running test suite test_spi
===================================================================
START - test_spi_loopback
I: SPI test on buffers TX/RX 0x20020131/0x20020a1a
I: SPI test slow config
I: Start complete multiple
I: CS control inhibited (no GPIO device)
I: Passed
I: Start complete loop
I: Passed
I: Start null tx
I: Passed
I: Start half start
I: Passed
I: Start half end
I: Passed
I: Start every 4
I: Passed
I: Start async call
I: Passed
I: SPI test fast config
I: Start complete multiple
I: CS control inhibited (no GPIO device)
I: Passed
I: Start complete loop
I: Passed
I: Start null tx
I: Passed
I: Start half start
I: Passed
I: Start half end
I: Passed
I: Start every 4
I: Passed
I: Start async call
I: Passed
I: Start complete loop
I: CS control inhibited (no GPIO device)
I: Passed
I: Start complete loop
I: CS control inhibited (no GPIO device)
I: Passed
I: All tx/rx passed
 PASS - test_spi_loopback in 0.75 seconds
===================================================================
Test suite test_spi succeeded
===================================================================
PROJECT EXECUTION SUCCESSFUL

galak pushed a commit that referenced this issue May 26, 2021
This commit reverted while loop on tx only.
This commit solves SPI loopback failure and SPI wrong behaviour on RX.
fix:
* #35297
* #35539

Revert "drivers/spi: STM32: This solves SPI infinite loop on Tranceive"

This reverts commit 50c2acb.

Signed-off-by: Affrin Pinhero <affrin.pinhero@hcl.com>
@galak
Copy link
Collaborator

galak commented May 26, 2021

Fixed by #35661

@galak galak closed this as completed May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: SPI SPI bus area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: medium Medium impact/importance bug Regression Something, which was working, does not anymore
Projects
None yet
Development

No branches or pull requests

6 participants