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

Driver SPIM receive - problem with CS #40

Closed
tommasopolonelli opened this issue Aug 9, 2018 · 2 comments
Closed

Driver SPIM receive - problem with CS #40

tommasopolonelli opened this issue Aug 9, 2018 · 2 comments

Comments

@tommasopolonelli
Copy link

I may have found an important bug in spim_receive.
With the following code:
image
I would expect that the CS stays low after the first function call, as described in :
image
Indeed, the signal generated is the following (yellow: CLK, blue: CS):
image

@tommasopolonelli
Copy link
Author

A simple fix can be used to solve the problem:

edit this file: runtime/pulp-rt/drivers/spim/spim-v2.c

in function __rt_spim_receive replace the line:
rt_periph_dual_copy(copy, handle->channel, (unsigned int)cmd, 4*4, (int)data, (len+7)>>3, 2<<1, call_event);
with
rt_periph_dual_copy(copy, handle->channel, (unsigned int)cmd, cs_mode == RT_SPIM_CS_AUTO ? 4*4 : 3*4, (int)data, (len+7)>>3, 2<<1, call_event);

Then recompile with this command:
plpbuild --m pulp-rt build --stdout

@haugoug
Copy link
Member

haugoug commented Aug 28, 2018

This has been pushed and will be in the next tag.

@haugoug haugoug closed this as completed Aug 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants