-
Notifications
You must be signed in to change notification settings - Fork 9
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
spi broken after fomu flash on raspberry pi #8
Comments
This is by design.
Now Instead, we set them as INPUT, so you can reset the FPGA and have it actually boot. |
interesting, thanks for the details!
…On Sat, 28 Mar 2020 at 02:26, Sean Cross ***@***.***> wrote:
This is by design.
fomu-flash doesn't use spidev. This is because fomu-flash supports dual,
quad, and qpi modes, and also because I ran into some kernel bugs when
using it. Bitbanging the pins resulted in faster transfers and more
reliable operations across multiple kernels and boards.
Now fomu-flash used to reset the pins, but that was changed in 1b0feb2
<1b0feb2>.
This is because the Pi drives pins such as SCLK, MOSI, and CE, which means
the ICE40 will fight to drive those -- the Pi will drive SCLK high, and the
FPGA will drive SCLK low, and you'll end up with both devices fighting.
Instead, we set them as INPUT, so you can reset the FPGA and have it
actually boot.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE223BU3IBOIC4DS4CKFJ3RJVG3VANCNFSM4LVETSUQ>
.
--
Matthew Venn
web mattvenn.net twitter @matthewvenn <https://twitter.com/matthewvenn>
|
Thanks for all the hard work on fomu-flash;
All in all, great work but requesting "sudo privileges" for bitbanging some pins and hereafter also I typically use the following to set and write pins on rasp #pragma once
#include <bcm2835.h>
#include <stdio.h>
#include <stdint.h>
#define INPUT BCM2835_GPIO_FSEL_INPT
#define INPUT_PULLUP BCM2835_GPIO_PUD_UP
#define INPUT_PULLDOWN BCM2835_GPIO_PUD_DOWN
#define OUTPUT BCM2835_GPIO_FSEL_OUTP
#define pinMode(PIN, MODE) bcm2835_gpio_fsel(PIN, MODE); if (MODE == (uint8_t)BCM2835_GPIO_PUD_UP || MODE == (uint8_t)BCM2835_GPIO_PUD_DOWN) bcm2835_gpio_set_pud(PIN, MODE)
#define digitalWrite(PIN, MODE) bcm2835_gpio_write(PIN, MODE)
#define digitalRead(PIN) bcm2835_gpio_lev(PIN) |
after flashing with fomu, this doesn't produce a clock on the spi clock pin:
./spidev_test -v -p "\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" -D /dev/spidev0.1 -s 1000000
this works to fix it:
would be nice to avoid this if possible.
The text was updated successfully, but these errors were encountered: