cpu/fe310: add spi peripheral driver#12957
Conversation
88290d2 to
4925af4
Compare
|
0 bytes!! 😉 |
4925af4 to
a7b1b6b
Compare
a7b1b6b to
8405fbe
Compare
|
rebased |
fjmolinas
left a comment
There was a problem hiding this comment.
Some comments, will test on monday.
| #define UART_NUMOF ARRAY_SIZE(uart_config) | ||
| /** @} */ | ||
|
|
||
| /** |
There was a problem hiding this comment.
Seems like they could share the configuration file no?
There was a problem hiding this comment.
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.
So you don't want to address here?
There was a problem hiding this comment.
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.
hmm, not really, this was already implemented this way in the original PR. Maybe @pyropeter can give some insight ?
fjmolinas
left a comment
There was a problem hiding this comment.
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): Details |
|
Well.... layer 8 issue had forgotten o apply the patch duh: |
|
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.has follows:bmp280_spiversion:Test output
Issues/PRs references
Based on #12934, closes #10833