beagleboard / librobotcontrol

Robotics Focused library for embedded Linux computers. Mirror of https://git.beagleboard.org/beagleboard/librobotcontrol
https://beagleboard.org/librobotcontrol
MIT License
196 stars 158 forks source link

SPI chip select/slave select not working #215

Open kris-toth opened 2 years ago

kris-toth commented 2 years ago

The bug The slave select doesn't pull down during transfer.

Description

  1. Using pocketbeagle, with robotcontrollib 1.0.5, and an SPI device (RFM26W but doesn't matter)
  2. Running the 'rc_spi_loopback.c' example
  3. using 'rc_spi_init_auto_slave(BUS, SLAVE, BUS_MODE, SPI_SPEED)'
  4. Verified with oscilloscope, that the CS line doesnt move during the program. CS goes high at program start and goes low on exit.

Temporary fix Temporary fix with 'rc_spi_init_manual_slave(BUS, SLAVE, BUS_MODE, SPI_SPEED, chip, pin)' and manual manipulation of CS with rc_spi_manual_select(BUS, SLAVE, 0) / rc_spi_manual_select(BUS, SLAVE, 1) before/after every spi event. This way cant use hardware CS.