Skip to content

SPI::write: fix number of transmitted symbols. #9624

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

Merged
merged 2 commits into from
May 2, 2019

Conversation

mprse
Copy link
Contributor

@mprse mprse commented Feb 6, 2019

Description

This is a fix to issue reported by @jeromecoutant : spi communication problem with ism43362 module on spi feature branch.

It looks like there is a bug in SPI::write. Independently on symbol size number of transferred symbols should be always 1. This PR should fix this problem.

mbed test -t GCC_ARM -m DISCO_F413ZH -n tests-netsocket-dns -v

| target               | platform_name | test suite          | result | elapsed_time (sec) | copy_method |
|----------------------|---------------|---------------------|--------|--------------------|-------------|
| DISCO_F413ZH-GCC_ARM | DISCO_F413ZH  | tests-netsocket-dns | OK     | 140.31             | default     |
mbedgt: test suite results: 1 OK
mbedgt: test case report:
| target               | platform_name | test suite          | test case                             | passed | failed | result | elapsed_time (sec) |
|----------------------|---------------|---------------------|---------------------------------------|--------|--------|--------|--------------------|
| DISCO_F413ZH-GCC_ARM | DISCO_F413ZH  | tests-netsocket-dns | ASYNCHRONOUS_DNS                      | 1      | 0      | OK     | 0.27               |
| DISCO_F413ZH-GCC_ARM | DISCO_F413ZH  | tests-netsocket-dns | ASYNCHRONOUS_DNS_CACHE                | 1      | 0      | OK     | 0.69               |
| DISCO_F413ZH-GCC_ARM | DISCO_F413ZH  | tests-netsocket-dns | ASYNCHRONOUS_DNS_CANCEL               | 1      | 0      | OK     | 5.35               |
| DISCO_F413ZH-GCC_ARM | DISCO_F413ZH  | tests-netsocket-dns | ASYNCHRONOUS_DNS_EXTERNAL_EVENT_QUEUE | 1      | 0      | OK     | 3.49               |
| DISCO_F413ZH-GCC_ARM | DISCO_F413ZH  | tests-netsocket-dns | ASYNCHRONOUS_DNS_INVALID_HOST         | 1      | 0      | OK     | 1.66               |
| DISCO_F413ZH-GCC_ARM | DISCO_F413ZH  | tests-netsocket-dns | ASYNCHRONOUS_DNS_NON_ASYNC_AND_ASYNC  | 1      | 0      | OK     | 0.79               |
| DISCO_F413ZH-GCC_ARM | DISCO_F413ZH  | tests-netsocket-dns | ASYNCHRONOUS_DNS_SIMULTANEOUS         | 1      | 0      | OK     | 1.2                |
| DISCO_F413ZH-GCC_ARM | DISCO_F413ZH  | tests-netsocket-dns | ASYNCHRONOUS_DNS_SIMULTANEOUS_CACHE   | 1      | 0      | OK     | 0.86               |
| DISCO_F413ZH-GCC_ARM | DISCO_F413ZH  | tests-netsocket-dns | ASYNCHRONOUS_DNS_SIMULTANEOUS_REPEAT  | 1      | 0      | OK     | 65.63              |
| DISCO_F413ZH-GCC_ARM | DISCO_F413ZH  | tests-netsocket-dns | ASYNCHRONOUS_DNS_TIMEOUTS             | 1      | 0      | OK     | 3.04               |
| DISCO_F413ZH-GCC_ARM | DISCO_F413ZH  | tests-netsocket-dns | SYNCHRONOUS_DNS                       | 1      | 0      | OK     | 0.12               |
| DISCO_F413ZH-GCC_ARM | DISCO_F413ZH  | tests-netsocket-dns | SYNCHRONOUS_DNS_INVALID               | 1      | 0      | OK     | 31.99              |
| DISCO_F413ZH-GCC_ARM | DISCO_F413ZH  | tests-netsocket-dns | SYNCHRONOUS_DNS_MULTIPLE              | 1      | 0      | OK     | 0.5                |
mbedgt: test case results: 13 OK

Please note that to run the test spi support for DISCO_F413ZH needs to be enabled.

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@jeromecoutant @ithinuel

@jeromecoutant
Copy link
Collaborator

Independently on symbol size number of transferred symbols should be always 1

Maybe API should be updated to remove this "fixed" (not useful) parameter ?

@mprse
Copy link
Contributor Author

mprse commented Feb 6, 2019

Maybe API should be updated to remove this "fixed" (not useful) parameter ?

This parameters are required by the new SPI HAL API:
https://github.com/ARMmbed/mbed-os/blob/feature-hal-spec-spi/docs/design-documents/hal/0000-spi-overhaul.md

@ciarmcom ciarmcom requested review from ithinuel and a team February 6, 2019 10:00
@ciarmcom
Copy link
Member

ciarmcom commented Feb 6, 2019

@mprse, thank you for your changes.
@ithinuel @ARMmbed/mbed-os-maintainers please review.

@adbridge
Copy link
Contributor

adbridge commented Feb 6, 2019

@mprse Looks like you have some formatting issues, can you please take a look at the astyle failures.

@mprse
Copy link
Contributor Author

mprse commented Feb 6, 2019

@mprse Looks like you have some formatting issues, can you please take a look at the astyle failures.

Style issue has been fixed.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 11, 2019

@ithinuel Final approval?

Ci triggered meantime

Copy link
Member

@ithinuel ithinuel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mbed-ci
Copy link

mbed-ci commented Feb 11, 2019

Test run: FAILED

Summary: 3 of 8 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-IAR
  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 11, 2019

[Error] BufferedSpi.h@71,0: #262: not a class or struct name from the build failures, please review

@mprse
Copy link
Contributor Author

mprse commented Feb 14, 2019

The build error is very odd. We got mbed-os build error for DISCO_L475VG_IOT01A board only. Build error is caused by the wifi-ism43362 driver which uses SPI and SPI is disabled for this board on the feature branch.

d -o BUILD/tests/DISCO_L475VG_IOT01A/GCC_ARM/wifi-ism43362/ISM43362/ATParser/ATParser.o ./wifi-ism43362/ISM43362/ATParser/ATParser.cpp
[Error] BufferedSpi.h@71,32: expected class-name before '{' token

@0xc0170 @cmonr Why wifi-ism43362 driver is included in the CI build for DISCO_L475VG_IOT01A ? I checked that it is not in case DISCO_F413ZH.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 14, 2019

@0xc0170 @cmonr Why wifi-ism43362 driver is included in the CI build for DISCO_L475VG_IOT01A ? I checked that it is not in case DISCO_F413ZH.

I don't see anything related set in targets.json file, could be set in CI config? @ARMmbed/mbed-os-test Please review

@cmonr
Copy link
Contributor

cmonr commented Feb 15, 2019

@mprse Could this line be the source of problems? https://github.com/ARMmbed/mbed-os/blob/feature-hal-spec-spi/targets/targets.json#L3748

When the feature branch was last rebased, was it tested against CI?

@mprse
Copy link
Contributor Author

mprse commented Feb 19, 2019

@mprse Could this line be the source of problems? https://github.com/ARMmbed/mbed-os/blob/feature-hal-spec-spi/targets/targets.json#L3748

I don't think so. The branch was recently rebased and CI has passed here last time:
PR #7976
Above PR was the last modification on the feature branch I think:
https://github.com/ARMmbed/mbed-os/commits/feature-hal-spec-spi

I have now idea what is causing this CI failures 😢

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 19, 2019

As it was few days back, I restarted CI and lets review it to resolve the failure if any

@mbed-ci
Copy link

mbed-ci commented Feb 19, 2019

Test run: FAILED

Summary: 3 of 8 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-GCC_ARM
  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-IAR

@mprse
Copy link
Contributor Author

mprse commented Apr 15, 2019

@0xc0170 This one is ready.

@mbed-ci
Copy link

mbed-ci commented Apr 17, 2019

Test run: FAILED

Summary: 1 of 7 test jobs failed
Build number : 3
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM

@mprse
Copy link
Contributor Author

mprse commented Apr 17, 2019

Test run: FAILED

The error looks not related (TB_SENSE_1:ARM only):

usage: examples.py [-h] [-c CONFIG] [-e EXAMPLE]
                   {import,clone,deploy,tag,compile,export} ...
examples.py: error: unrecognized arguments: -v

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 17, 2019

@ARMmbed/mbed-os-test ^^ - this argument was added recently, does this feature branch needs rebase ?

@mprse how old is spi spec?

@mprse
Copy link
Contributor Author

mprse commented Apr 17, 2019

@mprse how old is spi spec?

About 2-3 weeks. Was green for a few days ;-)

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 17, 2019

Can you test locally? If it is all ok, we can restart CI after 5.12.2 release candidate

@adbridge
Copy link
Contributor

ci started

@mbed-ci
Copy link

mbed-ci commented Apr 25, 2019

Test run: FAILED

Summary: 2 of 11 test jobs failed
Build number : 4
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_cloud-client-test
  • jenkins-ci/mbed-os-ci_greentea-test

@adbridge
Copy link
Contributor

@mprse please take a look at the test failures.

@mprse
Copy link
Contributor Author

mprse commented Apr 26, 2019

The results are unexpected. @adbridge can we try again with CI, to check if the results are constant.

@adbridge
Copy link
Contributor

ci restarted

@mbed-ci
Copy link

mbed-ci commented Apr 26, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 5
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_cloud-client-test

@mprse
Copy link
Contributor Author

mprse commented Apr 29, 2019

We got here mbed-cloud-client-example build error on NUCLEO_F429ZI.

Compile [ 16.2%]: arm_uc_pal_flashiap_implementation.c
[Error] arm_uc_pal_flashiap_implementation.c@577,13: use of undeclared identifier 'MBED_BOOTLOADER_SIZE'
[Error] arm_uc_pal_flashiap_implementation.c@588,43: use of undeclared identifier 'MBED_BOOTLOADER_SIZE'
[Error] arm_uc_pal_flashiap_implementation.c@612,55: use of undeclared identifier 'MBED_BOOTLOADER_SIZE'

I tried to investigate what is causing this failure, so I cloned mbed-cloud-client-example and tried to build it for NUCLEO_F429ZI and got exactly the same failure. This means that the problem is not related to feature-branch. Can anyone more familiar with mbed-cloud-client-example give some hint?

@alekla01
Copy link
Contributor

Restarted cloud-client-test

@mprse
Copy link
Contributor Author

mprse commented Apr 29, 2019

It looks like its ok now!

@mprse
Copy link
Contributor Author

mprse commented Apr 30, 2019

This one is ready to go.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 30, 2019

This one is ready to go.

I restarted CI before I realized it was waiting for only cloud 🙄

@mbed-ci
Copy link

mbed-ci commented Apr 30, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 6
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test

@adbridge
Copy link
Contributor

adbridge commented May 1, 2019

Failures seem unrelated to this PR so will restart ci

@0xc0170 0xc0170 merged commit dc4e6b8 into ARMmbed:feature-hal-spec-spi May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.