-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add SPI basic test and test header file. #7976
Add SPI basic test and test header file. #7976
Conversation
@ARMmbed/mbed-os-hal ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please run astyle
on files from this PR.
Ok, please ignore my comments regarding the outdated API. I checked existing header instead of the markdown doc.
TESTS/mbed_hal/spi/main.cpp
Outdated
|
||
TEST_ASSERT(capabilities.minimum_frequency <= FREQ_200KHZ); | ||
TEST_ASSERT(capabilities.maximum_frequency >= FREQ_2MHZ); | ||
TEST_ASSERT_TRUE(capabilities.symbol_length & CAPABILITY_WORD_LENGTH_8); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be useful to comment this is actually defined behavior / requirement from the docs.
TESTS/mbed_hal/spi/main.cpp
Outdated
spi_t spi_obj = | ||
{ 0 }; | ||
spi_capabilities_t capabilities = | ||
{ 0 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines break for no reason.
} | ||
|
||
/* Indicate that test case has been successfully executed. */ | ||
TEST_ASSERT_TRUE(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a little odd. I think this line is unnecessary for the test case to be valid, but isn't there anything to check during code execution?
TESTS/mbed_hal/spi/main.cpp
Outdated
|
||
spi_format(&spi_obj, 8, SPI_MODE_IDLE_LOW_SAMPLE_FIRST_EDGE, SPI_BIT_ORDERING_MSB_FIRST); | ||
|
||
real_freq = spi_frequency(&spi_obj, FREQ_200KHZ); |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
TESTS/mbed_hal/spi/main.cpp
Outdated
p_fill_sym = (void*) &fill_symbol_32; | ||
} | ||
|
||
const uint32_t sym_cnt = spi_transfer(&spi_obj, p_tx_buf, BUF_SIZE, p_rx_buf, BUF_SIZE, p_fill_sym); |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
TESTS/mbed_hal/spi/main.cpp
Outdated
handler_called = false; | ||
expected_event.transfered = 0; // Success will have to be indicated here | ||
|
||
const bool async_status = spi_transfer_async(&spi_obj, p_tx_buf, BUF_SIZE, p_rx_buf, BUF_SIZE, p_fill_sym, (void*)&some_ctx, dma_modes[mode_id]); |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
@mprse @fkjagodzinski |
Any updates? If not, then we'll have to close due to inactivity. |
@cmonr Please do not close. This one is needed. |
5f67d81
to
788ba7b
Compare
Refreshed the test. |
788ba7b
to
ab8fcce
Compare
@mprse I wonder if this branch needs to be rebased, since it's not passing unittests. |
689890e
to
85413ff
Compare
Probably its not passing since there is no new SPI HAL API on the branch. |
85413ff
to
a290cfe
Compare
ab8fcce
to
2d33887
Compare
5ba562e
to
3d43933
Compare
@theamirocohen Thank you for the solution! @0xc0170 Can we start CI again? |
CI restarted |
CI restarted (Java error, if repeats, will investigate with CI team) |
Test run: FAILEDSummary: 4 of 8 test jobs failed Failed test jobs:
|
Now the results are very strange. In the last commit I modified As a result of these changes ( If this is intended behaviour then I believe I should set |
Hi, |
mbed-os-example-sd-driver: on spi feature branch SD componen is disabled for K64F - disable this example. mbed-os-example-bootloader: example is using SPI pins which are now undefined on NUCLEO_F429ZI - disable this example.
3d43933
to
9a3e96d
Compare
Fixed as suggested by @theamirocohen. @0xc0170 Can we try again? |
CI started |
Test run: SUCCESSSummary: 12 of 12 test jobs passed |
This one should be ready to go. Later changes (after review) were related to CI problems. |
@donatieng This one should be ready to go. After this one is merged review and CI here is needed: |
@ithinuel @MarceloSalazar @screamerbg would you like to review? |
Thanks a lot @mprse - @ARMmbed/mbed-os-maintainers I'm happy to get this one merged - if @MarceloSalazar and @screamerbg see missing tests we can add them in a following PR |
@@ -0,0 +1,561 @@ | |||
/* | |||
* Copyright (c) 2018 ARM Limited | |||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be fixed in separate PR, adding SPDX identifiers for new files
As this is targeting feature branch, please add your comments when you are able to, they will be addressed. We mark this as ready for merge now to be integrated in the next 24 hours. |
Description
Provide SPI test and test header file based on the new HAL API description provided here:
https://github.com/ithinuel/mbed-os/blob/rfc-spi-overhaul/hal/rfcs/0000-spi-overhaul.md
This PR can not be merged until PR which defines the new HAL API and adds at least one example implementation is merged. Probably then the test will have to be adapted to the final API version.
This test is a first part of entire SPI testing scheme which provides non-communication, full-automated test which will run on CI.
Please assign @ithinuel as a reviewer.
Pull request type