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

STM32L0: Add DEVICE_SPI_COUNT to DISCO_L072CZ_LRWAN1 + MTB_MURATA_ABZ #10752

Merged
merged 1 commit into from
Jun 9, 2019

Conversation

teijokinnunen
Copy link

Enables simultaneous use of both SPIs without interference.

Description

STM32L0x2 has two SPIs available, on Murata LoRaWAN SoC the other one is used for the LoRaWAN radio and the other can be used by the application. I noticed that when LoRaWAN is active, the other SPI did not work reliably (apparently as they are both using the GlobalSPI instance). Setting DEVICE_SPI_COUNT helped. After this change the application SPI works together with LoRaWAN.

Pull request type

[ X ] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

Release Notes

Enables simultaneous use of both SPIs without interference.
@ciarmcom ciarmcom requested a review from a team June 4, 2019 07:00
@ciarmcom
Copy link
Member

ciarmcom commented Jun 4, 2019

@teijokinnunen, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

@LMESTM
Copy link
Contributor

LMESTM commented Jun 4, 2019

@ARMmbed/mbed-os-maintainers can you clarify usage of DEVICE_SPI_COUNT and whether it should be declared for all targets that have more than 1 SPI peripheral ?

@jeromecoutant
Copy link
Collaborator

Hi
This means that SPI feature branch has been merged ???
(only STM32F429 were implemented...)

@0xc0170 0xc0170 requested a review from a team June 4, 2019 08:16
@0xc0170
Copy link
Contributor

0xc0170 commented Jun 4, 2019

No, spi feature branch has not yet completed.

@ARMmbed/mbed-os-maintainers can you clarify usage of DEVICE_SPI_COUNT and whether it should be declared for all targets that have more than 1 SPI peripheral ?

@ARMmbed/mbed-os-hal rather to comment. To my understanding, it should be defined to be able to use more than one SPI peripheral (SPIx).

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 4, 2019

STM32L0x2 has two SPIs available, on Murata LoRaWAN SoC the other one is used for the LoRaWAN radio and the other can be used by the application. I noticed that when LoRaWAN is active, the other SPI did not work reliably (apparently as they are both using the GlobalSPI instance). Setting DEVICE_SPI_COUNT helped. After this change the application SPI works together with LoRaWAN.

This should also answer the question above - using just one instance (backward compatible).

@LMESTM
Copy link
Contributor

LMESTM commented Jun 4, 2019

This should also answer the question above - using just one instance (backward compatible).

I don't remember that the previous implementation was limiting the SPI usage to a single instance ... maybe I missed it.

In any case, shouldn't there be an issue or PR to deploy DEVICE_SPI_COUNT to all targets that have more than 1 SPI peripheral instance ?

@LMESTM
Copy link
Contributor

LMESTM commented Jun 4, 2019

in any case this PR looks good - thanks @teijokinnunen

@kjbracey
Copy link
Contributor

kjbracey commented Jun 4, 2019

If it's not defined you get the legacy (5.0 to 5.11) behaviour that all SPI accesses are protected by a single mutex, rather than having 1 mutex per SPI master peripheral.

The SPI devices will "work" without, it should just be a performance loss. Except that performance loss may be critical, eg an SD card access interfering with a radio.

In any case, shouldn't there be an issue or PR to deploy DEVICE_SPI_COUNT to all targets that have more than 1 SPI peripheral instance ?

This is being done on the "feature SPI" branch, among with lots other things. It would only be worth making an extra issue if we think that's going to take some time to land, and want to accelerate this. I don't actually know what the situation is now.

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 7, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Jun 8, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

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

8 participants