by JHEe » Mon Jun 25, 2018 3:38 pm
Thanks for checking it out.
For starters, I am using the SPI interface for this device to connect to a CC3200 (Texas Instruments device comprising of a dedicated network processor and an ARM applications processor). The CC3200 is the SPI Master. I've written routines to set up the KSZ8851SNLI and to run it as needed for my application. All works well. I can read and write registers as I need. My application is working great. It's a pretty straightforward Ethernet to Wi-Fi bridge.
My problem comes when I try to put the KSZ device into Local Loopback mode for a power-on-self-test capability I'd like to add. I write to bit 14 of the P1MBCR like the datasheet tells me to do, but then I'm not sure what to do next. I haven't found any instructions as to how to actually run a loopback test. I've tried doing a simple SPI transfer and read the data coming back through the MISO line (results in all 0x00 being read). I am sending 0x00, 0x01,0x02... etc. repeating for 120 bytes as test data. When that didn't work, I tried writing to the transmit QMU and reading from the receive QMU (results in 0x55 being read). I read 120 bytes of 0x55 when I do the write transmit QMU / read receive QMU method, so I think that's close to what I am supposed to do, but I'm not sure why I get 0x55 all the time. I would expect to get the exact same data out that I put in if this is a true loopback.
I've verified that the device is in loopback mode by reading the P1MBCR register after I write to it, and I see the bit 14 is being set to a 1.
I can't find much that talks about the loopback support. Thanks for taking the time to look at it.
-Jason