Skip to content

cpu: msp430-common: fix context save/restore#3837

Merged
haukepetersen merged 2 commits intoRIOT-OS:masterfrom
kaspar030:fix_msp430_context_switching
Sep 22, 2015
Merged

cpu: msp430-common: fix context save/restore#3837
haukepetersen merged 2 commits intoRIOT-OS:masterfrom
kaspar030:fix_msp430_context_switching

Conversation

@kaspar030
Copy link
Copy Markdown
Contributor

Previously, __restore_context was meddling with the to-be-restored
context SR on the stack, not correctly restoring GIE.
Now, we let the CPU restore the correct status register as saved in
__save_context.

Contains some simplification of the context save/restore logic.

@kaspar030 kaspar030 added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Platform: MSP Platform: This PR/issue effects MSP-based platforms labels Sep 14, 2015
@kaspar030 kaspar030 added this to the Release 2015.09 milestone Sep 14, 2015
@kaspar030 kaspar030 mentioned this pull request Sep 14, 2015
@kaspar030
Copy link
Copy Markdown
Contributor Author

This PR makes xtimer work on msp430. And honestly, I wonder how this platform could ever have worked without, GIE was randomly not activated after context switches.

@kaspar030
Copy link
Copy Markdown
Contributor Author

(I'm just realizing that this makes xtimer only work with the latest xtimer patches in #3525)

@kaspar030 kaspar030 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 15, 2015
@kaspar030
Copy link
Copy Markdown
Contributor Author

@OlegHahm would you? :) Or did @haukepetersen steal your msb-430h flasher?

@OlegHahm
Copy link
Copy Markdown
Member

He did, but I stole a Z1 with can be flashed without. I can ACK by testing.

@haukepetersen
Copy link
Copy Markdown
Contributor

Just tried on the msb-430h -> this PR seems to break something when receiving bytes via UART, the shell of the default example does not work anymore. On master this works fine...

@kaspar030
Copy link
Copy Markdown
Contributor Author

@haukepetersen hmk, will investigate.

@kaspar030 kaspar030 added the State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet label Sep 17, 2015
@kaspar030 kaspar030 force-pushed the fix_msp430_context_switching branch from 60c39a0 to 092ff04 Compare September 22, 2015 02:43
@kaspar030
Copy link
Copy Markdown
Contributor Author

Got it, UART receive rising edge interrupt was enabled, causing an interrupt loop. Again, I wonder how this could have ever worked before...

Meanwhile, I switched the msp430fxyz boards back to using uart_stdio, the ugly hack doesn't cut it.

@kaspar030 kaspar030 assigned haukepetersen and unassigned OlegHahm Sep 22, 2015
@kaspar030 kaspar030 removed the State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet label Sep 22, 2015
Previously, __restore_context was meddling with the to-be-restored
context SR on the stack, not correctly restoring GIE.
Now, we let the CPU restore the correct status register as saved in
__save_context.

Contains some simplification of the context save/restore logic.
@kaspar030 kaspar030 force-pushed the fix_msp430_context_switching branch from 092ff04 to 483b595 Compare September 22, 2015 08:48
@kaspar030
Copy link
Copy Markdown
Contributor Author

Meanwhile, I switched the msp430fxyz boards back to using uart_stdio, the ugly hack doesn't cut it.

Cut out that change into #3924.

@haukepetersen
Copy link
Copy Markdown
Contributor

Now it works as expected. ACK and go!

haukepetersen added a commit that referenced this pull request Sep 22, 2015
cpu: msp430-common: fix context save/restore
@haukepetersen haukepetersen merged commit f93b589 into RIOT-OS:master Sep 22, 2015
@haukepetersen
Copy link
Copy Markdown
Contributor

Awesome job, by the way!

@kaspar030
Copy link
Copy Markdown
Contributor Author

Thx!

@kaspar030 kaspar030 deleted the fix_msp430_context_switching branch September 22, 2015 10:46
@OlegHahm
Copy link
Copy Markdown
Member

Indeed, nice one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: MSP Platform: This PR/issue effects MSP-based platforms 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