Hard SPI with C code in Omega2
Is it possible to use the provided hard SPI (pins 6 to 9) in Omega2 with the C libraries? Or do I need to use other GPIOs?
So far, Ive not been able. I always get "Segmentation error". My shield connects the SPI lines to those 6 to 9 GPIOs. Otherwise I would have also tested it with other GPIOs.
Anyone can shed a bit of light on the issue?
Thanks and Regards,
@Alfonso-Blanco There are two general problems with the hardware SPI:
The SPI is already in use for accessing the flash chip inside the Omgea2. So you always have to share the hardware SPI with the operating system's need to access the flash (file system). This means you don't get the full bandwith, and if something goes wrong on the SPI, there's a high probability it will affect the file system's operation or even its integrity.
The hardware SPI in the MT7688 chip cannot do full duplex - only half duplex.
So in many cases, GPIO based software SPI is the better and safer option.
Of course, if you have very specific needs requesting hardware SPI, and sharing with flash / half duplex are no problems for you, then using it is possible.
@luz Do you have any example of software SPI? I try to use GPIOs but I get an error (I don't have the exact error as I'm at work, but it's someting like can't find spi-gpio-custom, maybe it is a external module).
I have an omega2+ and I'm porting Mbed RA8875 drivers from a STM32F401 using SPI.
@luz Thats the thing. Even if I use different GPIOs, I never can create a different bus/deviceID interface. I always get an error upon spi registration: spi_gpio_custom fails. I have that package properly installed, though.