Skip to content
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

STM: SPI: Initialize Rx in spi_master_write #3540

Merged
merged 1 commit into from
Jan 9, 2017

Conversation

LMESTM
Copy link
Contributor

@LMESTM LMESTM commented Jan 6, 2017

Fixes an SPI issue as reported here: #3501
Also applicable to other NUCLEO boards tested on -ci-test-shield

Note:
To have the test completely PASS on NUCLEO_L476RG, this PR on ci-test-shield repo is also needed ARMmbed/ci-test-shield#21
Otherwise the test would fail at the "SPI - Object Definable" step.

Description

In case Rx is not initialized its content might be random from stack.
This is causing problem in case of 8 bits read only as the left-side 8 bits
of the returned int value may contain this random byte data. This was for
instance detected when using SDFileSystem Lib.

Status

READY

Tests results

+-----------------------+---------------+---------------+------------------------+--------+--------+--------+--------------------+
| target | platform_name | test suite | test case | passed | failed | result | elapsed_time (sec) |
+-----------------------+---------------+---------------+------------------------+--------+--------+--------+--------------------+
| NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | tests-api-spi | SPI - Object Definable | 1 | 0 | OK | 0.05 |
| NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | tests-api-spi | SPI - SD Read | 1 | 0 | OK | 0.25 |
| NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | tests-api-spi | SPI - SD Write | 1 | 0 | OK | 0.51 |
| NUCLEO_L476RG-GCC_ARM | NUCLEO_L476RG | tests-api-spi | SPI - SD card exists | 1 | 0 | OK | 0.44 |
+-----------------------+---------------+---------------+------------------------+--------+--------+--------+--------------------+

+-----------------------+---------------+---------------+------------------------+--------+--------+--------+--------------------+
| target | platform_name | test suite | test case | passed | failed | result | elapsed_time (sec) |
+-----------------------+---------------+---------------+------------------------+--------+--------+--------+--------------------+
| NUCLEO_F410RB-GCC_ARM | NUCLEO_F410RB | tests-api-spi | SPI - Object Definable | 1 | 0 | OK | 0.05 |
| NUCLEO_F410RB-GCC_ARM | NUCLEO_F410RB | tests-api-spi | SPI - SD Read | 1 | 0 | OK | 0.21 |
| NUCLEO_F410RB-GCC_ARM | NUCLEO_F410RB | tests-api-spi | SPI - SD Write | 1 | 0 | OK | 0.42 |
| NUCLEO_F410RB-GCC_ARM | NUCLEO_F410RB | tests-api-spi | SPI - SD card exists | 1 | 0 | OK | 0.71 |
+-----------------------+---------------+---------------+------------------------+--------+--------+--------+--------------------+

In case Rx is not initiliased its content might be random from stack.
This is causing problem in case of 8 bits read only as the left-side 8 bits
of the returned int value may contain this random byte data. This was for
instance detected when using SDFileSystem Lib.
@0xc0170
Copy link
Contributor

0xc0170 commented Jan 6, 2017

/morph test

@mbed-bot
Copy link

mbed-bot commented Jan 6, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1362

All builds and test passed!

@sg- sg- merged commit 4f9e9f6 into ARMmbed:master Jan 9, 2017
@LMESTM LMESTM deleted the fix_spi_rx_init branch February 27, 2017 10:21
aisair pushed a commit to aisair/mbed that referenced this pull request Apr 30, 2024
Ports for Upcoming Targets


Fixes and Changes

3488: Dev stm i2c v2 unitary functions ARMmbed/mbed-os#3488
3492: Fix #3463 CAN read() return value ARMmbed/mbed-os#3492
3503: [LPC15xx] Ensure that PWM=1 is resolved correctly ARMmbed/mbed-os#3503
3504: [LPC15xx] CAN implementation improvements ARMmbed/mbed-os#3504
3539: NUCLEO_F412ZG - Add support of TRNG peripheral ARMmbed/mbed-os#3539
3540: STM: SPI: Initialize Rx in spi_master_write ARMmbed/mbed-os#3540
3438: K64F: Add support for SERIAL ASYNCH API ARMmbed/mbed-os#3438
3519: MCUXpresso: Fix ENET driver to enable interrupts after interrupt handler is set ARMmbed/mbed-os#3519
3544: STM32L4 deepsleep improvement ARMmbed/mbed-os#3544
3546: NUCLEO-F412ZG - Add CAN peripheral ARMmbed/mbed-os#3546
3551: Fix I2C driver for RZ/A1H ARMmbed/mbed-os#3551
3558: K64F UART Asynch API: Fix synchronization issue ARMmbed/mbed-os#3558
3563: LPC4088 - Fix vector checksum ARMmbed/mbed-os#3563
3567: Dev stm32 F0 v1.7.0 ARMmbed/mbed-os#3567
3577: Fixes linking errors when building with debug profile ARMmbed/mbed-os#3577
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.

None yet

5 participants