-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Flexio SPI loopback test failed on fast speed(16Mbps) #88877
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
base: main
Are you sure you want to change the base?
Flexio SPI loopback test failed on fast speed(16Mbps) #88877
Conversation
f852952
to
17d6aa5
Compare
drivers/spi/spi_mcux_flexio.c
Outdated
@@ -206,6 +206,24 @@ static void spi_flexio_master_init(FLEXIO_SPI_Type *base, flexio_spi_master_conf | |||
timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; | |||
/* Low 8-bits are used to configure baudrate. */ | |||
timerDiv = (uint16_t)(srcClock_Hz / masterConfig->baudRate_Bps); | |||
|
|||
/* Add protection if bandrate required is overflow. |
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.
/* Add protection if bandrate required is overflow. | |
/* Add protection if the required baud rate overflows. |
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.
thanks, done
drivers/spi/spi_mcux_flexio.c
Outdated
@@ -206,6 +206,24 @@ static void spi_flexio_master_init(FLEXIO_SPI_Type *base, flexio_spi_master_conf | |||
timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; | |||
/* Low 8-bits are used to configure baudrate. */ | |||
timerDiv = (uint16_t)(srcClock_Hz / masterConfig->baudRate_Bps); | |||
|
|||
/* Add protection if bandrate required is overflow. | |||
* FLEXIO input freq can not meet required bandrate. Max bandrate can |
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.
* FLEXIO input freq can not meet required bandrate. Max bandrate can | |
* FLEXIO input freq cannot meet required baud rate. Max baud rate can |
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.
done, thanks
/* Add protection if bandrate required is overflow. | ||
* FLEXIO input freq can not meet required bandrate. Max bandrate can | ||
* not exceed 1/4 of input freq. You can raise input freq or lower | ||
* bandrate required to remove this warning. |
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.
* bandrate required to remove this warning. | |
* baud rate required to remove this warning. |
Apply everywhere.
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.
done
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.
Still not addressed
soc/nxp/imxrt/imxrt10xx/soc.c
Outdated
@@ -215,6 +215,18 @@ __weak void clock_init(void) | |||
CLOCK_SetDiv(kCLOCK_LpspiDiv, 0); /* Set SPI divider to 1 */ | |||
#endif | |||
|
|||
#ifdef CONFIG_MCUX_FLEXIO | |||
/* Configure input clock to be able to reach the datasheet specified band rate. |
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.
/* Configure input clock to be able to reach the datasheet specified band rate. | |
/* Configure input clock to be able to reach the datasheet specified baud rate. |
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.
done, thanks
Several reason cause loopback test failed: a) FlexIO input frequency is not correct, on RT11xx, input freq is 24M, while max bandrate can reach 1/4 of input freq, so it can only support 6Mbps. b) Flexio shift register depend on correct timer output to triggger TX and TX, if timer comparison value is not accurate, RX error happens on high band rate. This is the reason why test fails on RT1060. also fix a error on FlexIO clock ID calculation. Signed-off-by: Raymond Lei <[email protected]>
17d6aa5
to
15439f7
Compare
15439f7
to
79f39f0
Compare
Add overlay file for RT1170 EVK and simply existing flexio spi overlay file for RT1060 EVKC and RT1064 EVK. One flexio-spi interface for both slow and fast tests. Fast bandrate set to 16Mbps now. Signed-off-by: Raymond Lei <[email protected]>
79f39f0
to
457bbe3
Compare
test: drivers: spi_loopback: Flexio spi support for RT1060 EVKC and RT1170 EVK
fix this issue: #77992