-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/fe310: add spi peripheral driver #12957
Conversation
88290d2
to
4925af4
Compare
0 bytes!! 😉 |
4925af4
to
a7b1b6b
Compare
a7b1b6b
to
8405fbe
Compare
rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, will test on monday.
@@ -110,6 +110,23 @@ static const uart_conf_t uart_config[] = { | |||
#define UART_NUMOF ARRAY_SIZE(uart_config) | |||
/** @} */ | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like they could share the configuration file no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and I'm planning to merge them in a common folder once all the new features are in: all other board peripheral configurations could also be shared in fact.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you don't want to address here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But ina follow up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, otherwise, I'll have to rework all the other ones (i2c, pwm).
/* setting the CS high before configuring it as an | ||
output should be fine on FE310. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, not really, this was already implemented this way in the original PR. Maybe @pyropeter can give some insight ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a conflict in the used pins with the esp module
:
2020-01-13 10:01:04,699 # ATE0-->Send Flag Timed Out Busy. Giving Up.
2020-01-13 10:01:06,075 # Send Flag error: #255 #255 #255 #255 AT+BLEINIT=0-->Send Flag Timed Out Busy. Giving Up.
2020-01-13 10:01:07,451 # Send Flag error: #255 #255 #255 #255 AT+CWMODE=0-->Send Flag Timed Out Busy. Giving Up.
2020-01-13 10:01:07,455 # Send Flag error: #255 #255 #255 #255
2020-01-13 10:01:07,463 # Help: Press s to start test, r to print it is ready
Test doesn't work:
|
This is normal, this is the SPI that should be used to control the ESP module.
Maybe try with a simpler module, the SX127x needs several gpios to be connected to the boards (and thus requires specific driver params). |
Ah I did not realize that. |
It seems the ESP is getting in the way of any spi initialization, what module did you use to test this? |
Following the testing procedure, it works (without rebase to latest master, e.g not containing the xtimer "enhancements" from #9530):
|
Well.... layer 8 issue had forgotten o apply the patch duh:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
Thank you @fjmolinas ! |
Contribution description
this PR is a rework of the original PR #10833 from @pyropeter.
It adds an implementation of the SPI peripheral driver for RISC-V FE310 cpu and configure 2 peripherals on hifive1 and hifive1b boards.
The PR was just tested with success using a bmp280 sensor plugged on the board. I'll try to find time for checking the bus with a logic analyzer.
Testing procedure
Simply plug an SPI device on the SPI pins available on the Arduino pinout and test it.
Example with bmp280:
bmpx280_params.h
as follows:bmp280_spi
version:Test output
Issues/PRs references
Based on #12934, closes #10833