Skip to content

cpu/lpc2387: Fixed broken SPI driver#9154

Merged
aabadie merged 1 commit intoRIOT-OS:masterfrom
maribu:lpc2387
May 21, 2018
Merged

cpu/lpc2387: Fixed broken SPI driver#9154
aabadie merged 1 commit intoRIOT-OS:masterfrom
maribu:lpc2387

Conversation

@maribu
Copy link
Copy Markdown
Member

@maribu maribu commented May 18, 2018

In commit 513b20f the SPI API was changed to
power up an configure the SPI bus on spi_acquire(). Sadly, the lpc2387 SPI
apparently needs to be reconfigured after each power up. This commit moves
the initialization code from spi_init() to spi_acquire() and restores the
order of initialization steps as before said commit.

With this commit, the CC1100 transceiver of the MSBA2 board becomes usable
again.

This fixes Issue #6857

@aabadie aabadie added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: drivers Area: Device drivers labels May 19, 2018
/* power on */
PCONP |= (PCSSP0);

spi_init_pins(bus);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems weird to have gpio initialization in the spi_aquire function. Could it be kept in spi_init ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to still work - I tested sending 100 pings and got 100 matching pongs :-)

This PR is updated with the pin initialization moved back to spi_init

In commit 513b20f the SPI API was changed to
power up an configure the SPI bus on spi_acquire(). Sadly, the lpc2387 SPI
apparently needs to be reconfigured after each power up. This commit moves
the initialization code required after each power up from spi_init() to
spi_acquire().
@aabadie aabadie added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label May 21, 2018
@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented May 21, 2018

I tested sending 100 pings and got 100 matching pongs :-)

Very nice !

Copy link
Copy Markdown
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, trusting your ping results @maribu

@aabadie aabadie merged commit 4ca2109 into RIOT-OS:master May 21, 2018
@maribu maribu deleted the lpc2387 branch May 22, 2018 20:12
@cladmi cladmi added this to the Release 2018.07 milestone Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants