Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

SPI clock signal about beaglebone(am335x)

$
0
0

Hi engineers,

I'm having difficulties getting the SPI clock signal to present on P9-22 in beaglebone , my image is A5, my kernel is  'Linux-3.1.0-psp04.06.00.03. SDK'.

Firstly,I  modify  the kernel file board-am335xevm.c like below:

staticstructspi_board_info bone_spi0_info[] = {
{
.modalias = "spidev",
.max_speed_hz = 48000000, //48 Mbps
.bus_num = 1,
.chip_select = 0,
.mode = SPI_MODE_0,
},
};

and

static void spi0_init(intevm_id, int profile)
{
setup_pin_mux(spi0_pin_mux);
spi_register_board_info(bone_spi0_info,
ARRAY_SIZE(bone_spi0_info));
return;
}

 Add the following to the beaglebone_dev_cfg[] struct:

{spi0_init, DEV_ON_BASEBOARD, PROFILE_NONE},

Next , I can find spidev like below :


root@am335x-evm:/# find -name 'spidev*' 
./dev/spidev1.0
./dev/.udev/names/spidev1.0
./sys/devices/platform/omap/omap2_mcspi.1/spi1.0/spidev/spidev1.0
./sys/class/spidev/spidev1.0

Then , connect pins 18 and 21 together on the P9 header.

root@am335x-evm:/mnt# ./spidev_test -D /dev/spidev2.0

spi mode: 0

bits per word: 8

max speed: 500000 Hz (500 KHz)

FF FFFFFFFFFF

40 00 00 00 00 95

FF FFFFFFFFFF

FF FFFFFFFFFF

FF FFFFFFFFFF

DE AD BE EF BA AD

F0 0D

Finally,other place I have no change in kernel and use  the default settings.

I connect beaglebone and DSP28335 together ,use the spidev_fdx.c   test,

root@am335x-evm:/mnt# ./spidev_fdx -m 3 /dev/spidev1.0

/dev/spidev1.0: spi mode 0, 8 bits per word, 48000000 Hz max

read(3, 3): 00 00 00

The default setting of related local spi is:

/* Module pin mux for SPI fash */
/*static struct pinmux_config spi0_pin_mux[] = {
{"spi0_sclk.spi0_sclk", OMAP_MUX_MODE0 | AM33XX_PULL_ENBL
       | AM33XX_INPUT_EN},
{"spi0_d0.spi0_d0", OMAP_MUX_MODE0 | AM33XX_PULL_ENBL | AM33XX_PULL_UP
       | AM33XX_INPUT_EN},
{"spi0_d1.spi0_d1", OMAP_MUX_MODE0 | AM33XX_PULL_ENBL
       | AM33XX_INPUT_EN},
{"spi0_cs0.spi0_cs0", OMAP_MUX_MODE0 | AM33XX_PULL_ENBL | AM33XX_PULL_UP
       | AM33XX_INPUT_EN},
{NULL, 0},
};

but ,I can't find spiclk signal in the pin,why?

I use an oscilloscope, spiclk signal is still low, I can't find the reason,help me ?

There are still some details need to pay attention to?


thank you !



Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>