Re: [beagleboard] SPI low level driver

2015-11-20 Thread Kees k
Hello Gianfranco, Happy to help you out. I think instead of using the 'force' bit, there must be a better alternative, but this solution works. Did you start working on SPI in the PRU because the linux mcspi driver is very slow? Kees On Friday, November 20, 2015 at 12:29:17 AM UTC+1,

Re: [beagleboard] SPI low level driver

2015-11-20 Thread Gianfranco Rosso
Hi Kees, SPI management is part of a bigger project: we are working on a Machinekit based drilling machine, where one PRU is used for the generation of step/dir signals for the axes, while the other already manages (in real-time way, tightened to the main servo-thread @ 1 ms) an I2C bus (for

Re: [beagleboard] SPI low level driver

2015-11-19 Thread William Hermans
http://exploringbeaglebone.com/chapter13/ On Thu, Nov 19, 2015 at 8:50 AM, Kees k wrote: > I did some work on this in January. I am not sure it worked well, at least > it did something. > The code (so far) may help: >

Re: [beagleboard] SPI low level driver

2015-11-19 Thread Gianfranco Rosso
Hello Kees, something is always better than... nothing ;-) That's was exactly what I was looking for: a "working" driver for compare initialization sequence and register settings. My init was very similar... but I noticed you deal also with interrupt registers and that you used the "FORCE"

Re: [beagleboard] SPI low level driver

2015-11-19 Thread Kees k
I did some work on this in January. I am not sure it worked well, at least it did something. The code (so far) may help: https://github.com/kkwekkeboom/am335x_pru_package/blob/csk_spidriver2/pru_sw/example_apps/PRU_spidriver/PRU_spidriver.p On Wednesday, November 18, 2015 at 2:15:31 PM UTC+1,

Re: [beagleboard] SPI low level driver

2015-11-18 Thread Gianfranco Rosso
Hello Jason, thanks for advices. I've done the first and I've found a bug: just after soft resetting the module I have to rewrite register MCSPI_SYSCONFIG (to 0x0308) 'cause the module also resets this register... The others settings seems ok. SPI trasmission still doesn't occours, so there

[beagleboard] SPI low level driver

2015-11-17 Thread Gianfranco Rosso
I'm writing a SPI driver for the PRU on BBB. Mux settings for pins is done by config-pin: P9.29, P9.30 and P9.31 are configured as "spi" for SPI1_D0, SPI1_D1 and SPI1_SCLK, while P8.27, P8.29 and P9.28 are configured as gpio output as 3 chip select (to be manually managed). Chip select pin

Re: [beagleboard] SPI low level driver

2015-11-17 Thread Jason Kridner
Are you reading back all the registers to make sure all your writes work OK? Have you tried enabling the mux on one of the CS signals? I don't have any real reason to believe it is necessary, but I'd want you to try in as normal a mode as possible to get things working before tweaking. Have you