-
Notifications
You must be signed in to change notification settings - Fork 3k
Bring FPGA-Test-Shield tests into Mbed-os master. #10820
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
Conversation
@mprse, thank you for your changes. |
9883ce7
to
cd0ad51
Compare
@maciejbocianski @jamesbeyond could you review please ? |
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 tests are HAL tests, shall we add the header files for the test along with doxygen comments. (same as rest of the hal tests)
@mprse @maciejbocianski @fkjagodzinski @c1728p9
@jamesbeyond it would be good to have header files with doxygen comments for the APIs which have a HAL specification. This should map the defined behavior to tests which validates it. |
#error [NOT_SUPPORTED] I2C not supported for this target | ||
#elif !COMPONENT_FPGA_CI_TEST_SHIELD | ||
#error [NOT_SUPPORTED] FPGA CI Test Shield is needed to run this test | ||
#elif !defined(FULL_TEST_SHIELD) |
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.
FULL_TEST_SHIELD
should probably be removed since this only applies to the Basys3.
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.
Fixed
We missed that while working on FPGA tests. I agree that headers should be added. I will add when I come back to the office. |
Divide one test case to four test cases to increase readability. Adapted to the last version of the FPGA CI Test Shield API.
Pushed last changes provided by @maciejbocianski to FPGA I2C test (261e67b). Removed |
At the moment we do not have HAL specification for the tested APIs here. We can add headers when HAL specification is ready and we need headers to map the test cases to the defined behavior. I think we should move forward with this PR. It is hard now to keep consistency between FPGA repo and this one. Even if some dummy headers are required we can add this in the additional PR. |
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.
Before I approve, just one comment about dead code below.
Where is the documentation for fpga testing (reference for docs PR?), plus what these are testing - I am seeing just test files here and defined test cases but where is the test plan (or something similar) or is all suficient what we have in Cases() in the files?
// printf("Sum: %llu\r\n", sum); | ||
// printf("Num power samples: %d\r\n", samples); | ||
// printf("Num power cycles: %llu\r\n", cycles); | ||
// printf("ANIN0 voltage: %.6fV\r\n", tester.get_anin_voltage(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.
Can we remove these lines not used?
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.
I think that this code has been added for debugging. Maybe I can wrap this code around #if DEBUG
directive?
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.
Fixed
Is this OK to go to 5.13.2 (in 2 weeks time) , landing to master once it's ready? |
It looks like we do not have HAL specification ready for the tested APIs. I would consider these tests as general tests to show the capabilities of the FPGA Test Shields for the SiP workshop. Header file and mapping between test cases and defined behavior will be added to this PR: |
cc @jamesbeyond |
Hi @0xc0170, this PR is for workshop next week, please mark this as high importance. |
… tolerance Keep "AnalogIn - full test" disabled due to hardware issue in the first rev of FPGA Test Shield.
5ffa260
to
c6acc85
Compare
c6acc85
to
c016f2a
Compare
@0xc0170 Ready for CI. |
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.
After a offline conversation, I'd agree that because we don't have defined behavior for current these HAL APIs, the test header files can come to the repo as separate PR
This one does not need preceding PR. It is ready for CI. |
I am reviewing at the moment |
Case("115200, 8N1, FC on", one_peripheral<UARTPort, DefaultFormFactor, test_common<115200, 8, ParityNone, 1> >), | ||
Case("115200, 8N1, FC off", one_peripheral<UARTNoFCPort, DefaultFormFactor, test_common_no_fc<115200, 8, ParityNone, 1> >), // DISCO_L475VG_IOT01A | ||
// data bits | ||
/* FIXME not supported: K64F |
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.
do we need to keep this dead code here? Can it be tracked separately (removed from here, stashed somewhere else with the tracking issue for this)
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.
@fkjagodzinski Can you check this?
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.
Ok, so I checked this part -- data bits on K64F.
- Our HAL allows setting
data_bits
and does not restrict this value in any way:
Lines 137 to 144 in b55344c
/** Configure the format. Set the number of bits, parity and the number of stop bits * * @param obj The serial object * @param data_bits The number of data bits * @param parity The parity * @param stop_bits The number of stop bits */ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_bits); - The HAL implementation for K64F does not really use
data_bits
param:
mbed-os/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/serial_api.c
Line 102 in b55344c
void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_bits) - ... and this is because the
fsl_uart.c
does not have anydata_bits
-related config item:
mbed-os/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/drivers/fsl_uart.h
Lines 167 to 181 in b55344c
/*! @brief UART configuration structure. */ typedef struct _uart_config { uint32_t baudRate_Bps; /*!< UART baud rate */ uart_parity_mode_t parityMode; /*!< Parity mode, disabled (default), even, odd */ #if defined(FSL_FEATURE_UART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_UART_HAS_STOP_BIT_CONFIG_SUPPORT uart_stop_bit_count_t stopBitCount; /*!< Number of stop bits, 1 stop bit (default) or 2 stop bits */ #endif #if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO uint8_t txFifoWatermark; /*!< TX FIFO watermark */ uint8_t rxFifoWatermark; /*!< RX FIFO watermark */ #endif bool enableTx; /*!< Enable TX */ bool enableRx; /*!< Enable RX */ } uart_config_t; - However, the
K64 Sub-Family Reference Manual
says there are two settings:
Programmable 8-bit or 9-bit data format
Initially I thought we should uncomment this block of code and expect NXP to provide a fix. Now, knowing NXP would have to update their HAL, I don't think it would be reasonable to do so. Also, I'm not so sure if Mbed OS should require support of 9-bit UART data at all.
@jamesbeyond, what do you think about this? Should I remove the data_bits
part of this test?
BTW, there are two more similar FIXME
comments regarding ST targets. Remove these as well? (don't know why they fail yet).
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.
I vote for yes. dead code should be removed (tracking issue to have this, with commit including the changes needed). It will be easy to bring this back once it is fixed
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.
Fixed (d2d3d5f)
Case("AnalogIn - init test", all_ports<AnaloginPort, DefaultFormFactor, analogin_init>), | ||
// This test case is disabled for now due to hardware issue in the first rev of FPGA Test Shield | ||
#if 0 | ||
Case("AnalogIn - full test", all_ports<AnaloginPort, DefaultFormFactor, analogin_full_test>), |
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.
remove as well this one not used
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 one will be enabled as soon as we get the rev.2 of the FPGA-Test-Shield and I will be able to rework and execute this test case.
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 should come with rv2 (we should not have if 0 in the code)
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.
Ok, I will remove this test case for now and add it later.
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.
fixed (879d891)
#include "test_utils.h" | ||
|
||
|
||
#define pwm_debug_printf(...) |
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.
Empty?
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 is macro for debugging. By default, it does nothing.
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.
OK, I was expecting if debug , it does something
The test case which checks full range cannot be executed at the moment due to a hardware bug in FPGA-Test-Shield. This test case will be restored when the final version of FPGA-Test-Shield is ready.
CI started meanwhile |
Not all uart features are supported by specific platforms.
Restarted CI after latest changes |
Test run: FAILEDSummary: 1 of 4 test jobs failed Failed test jobs:
|
Test run: SUCCESSSummary: 4 of 4 test jobs passed |
Description
Bring FPGA-Test-Shield tests to Mbed-os.
When this is merged these tests can be removed from
ci-tes-shield-fpga
repository.By default, all these tests will be skipped on CI. To enable these tests
FPGA_CI_TEST_SHIELD
component must be added in targets.json configuration file.Related PRs: PR #10816
Pull request type
Reviewers
@maciejbocianski
@fkjagodzinski
@c1728p9
@jamesbeyond