-
Notifications
You must be signed in to change notification settings - Fork 3k
STM32: I2C: reset state machine #3685
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
targets/TARGET_STM/i2c_api.c
Outdated
@@ -597,8 +614,14 @@ int i2c_stop(i2c_t *obj) { | |||
* to know when we need to prepare next start */ | |||
handle->Instance->CR2 &= ~I2C_CR2_SADD; | |||
|
|||
/* | |||
* V2 IP is meant for automatic STOP, not user STOP | |||
* SW reset the IP state machine before next ransaction |
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.
nit: ransaction
-> transaction typo
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
this I2C IP is meant for automatic STOP, based on programmed number of bytes to be sent or receivede, not a user triggered STOP. So the state machiine needs to be reset in case we use this I2C mbed unitary API (start / byte_write / byte_read / stop).
37d1467
to
57f4df6
Compare
@0xc0170 thanks - type corrected ! |
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
Ports for Upcoming Targets Fixes and Changes 3432: Target STM USBHOST support ARMmbed/mbed-os#3432 3181: NUCLEO_F207ZG extending PeripheralPins.c: all available alternate functions can be used now ARMmbed/mbed-os#3181 3626: NUCLEO_F412ZG : Add USB Device +Host ARMmbed/mbed-os#3626 3628: Fix warnings ARMmbed/mbed-os#3628 3629: STM32: L0 LL layer ARMmbed/mbed-os#3629 3632: IDE Export support for platform VK_RZ_A1H ARMmbed/mbed-os#3632 3642: Missing IRQ pin fix for platform VK_RZ_A1H ARMmbed/mbed-os#3642 3664: Fix ncs36510 sleep definitions ARMmbed/mbed-os#3664 3655: [STM32F4] Modify folder structure ARMmbed/mbed-os#3655 3657: [STM32L4] Modify folder structure ARMmbed/mbed-os#3657 3658: [STM32F3] Modify folder structure ARMmbed/mbed-os#3658 3685: STM32: I2C: reset state machine ARMmbed/mbed-os#3685 3692: uVisor: Standardize available legacy heap and stack ARMmbed/mbed-os#3692 3621: Fix for #2884, LPC824: export to LPCXpresso, target running with wron ARMmbed/mbed-os#3621 3649: [STM32F7] Modify folder structure ARMmbed/mbed-os#3649 3695: Enforce device_name is valid in targets.json ARMmbed/mbed-os#3695 3723: NCS36510: spi_format function bug fix ARMmbed/mbed-os#3723
This I2C IP is meant for automatic STOP, based on programmed number
of bytes to be sent or receivede, not a user triggered STOP.
So the state machiine needs to be reset in case we use this I2C mbed
unitary API (start / byte_write / byte_read / stop).
This PR allows to solve some remaining issues with i2c ci test shield on L4 / F3 / F7 boards.
##TESTS RESULTS
+----------------------+---------------+---------------+------------------------------------+--------+--------+--------+--------------------+
| target | platform_name | test suite | test case | passed | failed | result | elapsed_time (sec) |
+----------------------+---------------+---------------+------------------------------------+--------+--------+--------+--------------------+
| DISCO_F746NG-GCC_ARM | DISCO_F746NG | tests-api-i2c | I2C - EEProm WR 10 Bytes | 1 | 0 | OK | 0.32 |
| DISCO_F746NG-GCC_ARM | DISCO_F746NG | tests-api-i2c | I2C - EEProm WR 100 Bytes | 1 | 0 | OK | 0.72 |
| DISCO_F746NG-GCC_ARM | DISCO_F746NG | tests-api-i2c | I2C - EEProm WR 2 Bytes | 1 | 0 | OK | 0.29 |
| DISCO_F746NG-GCC_ARM | DISCO_F746NG | tests-api-i2c | I2C - EEProm WR Single Byte | 1 | 0 | OK | 0.17 |
| DISCO_F746NG-GCC_ARM | DISCO_F746NG | tests-api-i2c | I2C - Instantiation of I2C Object | 1 | 0 | OK | 0.07 |
| DISCO_F746NG-GCC_ARM | DISCO_F746NG | tests-api-i2c | I2C - LM75B Temperature Read | 1 | 0 | OK | 0.12 |
+----------------------+---------------+---------------+------------------------------------+--------+--------+--------+--------------------+
+-----------------------+---------------+---------------+------------------------------------+--------+--------+--------+--------------------+
| target | platform_name | test suite | test case | passed | failed | result | elapsed_time (sec) |
+-----------------------+---------------+---------------+------------------------------------+--------+--------+--------+--------------------+
| NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | tests-api-i2c | I2C - EEProm WR 10 Bytes | 1 | 0 | OK | 0.33 |
| NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | tests-api-i2c | I2C - EEProm WR 100 Bytes | 1 | 0 | OK | 0.72 |
| NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | tests-api-i2c | I2C - EEProm WR 2 Bytes | 1 | 0 | OK | 0.29 |
| NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | tests-api-i2c | I2C - EEProm WR Single Byte | 1 | 0 | OK | 0.16 |
| NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | tests-api-i2c | I2C - Instantiation of I2C Object | 1 | 0 | OK | 0.06 |
| NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | tests-api-i2c | I2C - LM75B Temperature Read | 1 | 0 | OK | 0.12 |
+-----------------------+---------------+---------------+------------------------------------+--------+--------+--------+--------------------+
+-----------------------+---------------+---------------+------------------------------------+--------+--------+--------+--------------------+
| target | platform_name | test suite | test case | passed | failed | result | elapsed_time (sec) |
+-----------------------+---------------+---------------+------------------------------------+--------+--------+--------+--------------------+
| NUCLEO_F334R8-GCC_ARM | NUCLEO_F334R8 | tests-api-i2c | I2C - EEProm WR 10 Bytes | 1 | 0 | OK | 0.33 |
| NUCLEO_F334R8-GCC_ARM | NUCLEO_F334R8 | tests-api-i2c | I2C - EEProm WR 100 Bytes | 1 | 0 | OK | 0.73 |
| NUCLEO_F334R8-GCC_ARM | NUCLEO_F334R8 | tests-api-i2c | I2C - EEProm WR 2 Bytes | 1 | 0 | OK | 0.28 |
| NUCLEO_F334R8-GCC_ARM | NUCLEO_F334R8 | tests-api-i2c | I2C - EEProm WR Single Byte | 1 | 0 | OK | 0.16 |
| NUCLEO_F334R8-GCC_ARM | NUCLEO_F334R8 | tests-api-i2c | I2C - Instantiation of I2C Object | 1 | 0 | OK | 0.06 |
| NUCLEO_F334R8-GCC_ARM | NUCLEO_F334R8 | tests-api-i2c | I2C - LM75B Temperature Read | 1 | 0 | OK | 0.11 |
+-----------------------+---------------+---------------+------------------------------------+--------+--------+--------+--------------------+