This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Dose CC2530 SPI interface support Z-Stack Linux Gateway

Other Parts Discussed in Thread: Z-STACK, CC2530, CC2531

Hi

We use the SPI interface in our project to connect CC2530. We see the document "Z-Stack Linux Gateway Application Programming Interface document Version: 1.1" page 9 show the interface is UART. We would like to know dose the SPI interface can also be supported in Gateway solution? Is there any limitation by using SPI interface? Many thanks!

Best Regards,

Fencer

  • This is possible, although not heavily tested or seamless to setup. Firstly you will need to enable spidev in you kernel and test it is working with spidev_test.c.

    You should then change the following to SPI in servers/NPI_Gateway.cfg

    #devPath="/dev/ttyUSB2";
    devPath="/dev/ttyACM0" ; UART/CDC
    #devPath="/dev/ttyO4" ; SPI
    #devPath="/dev/i2c-2" ; I2C

    You also need to insure that the MRDY and SRDY GPIO's are connected and then configured correctly in the cfg file (the level shifter GPIO's can be ignored if you do not need level shifters between Linux Host and CC2530):

    [GPIO_SRDY.GPIO]
    value="/sys/class/gpio/gpio132/value"
    direction="/sys/class/gpio/gpio132/direction"
    active_high_low=1 ; (Active Low=0, Active High=1)
    
    [GPIO_SRDY.LEVEL_SHIFTER]
    value="/sys/class/gpio/gpio137/value"
    direction="/sys/class/gpio/gpio137/direction"
    active_high_low=1 ; (Active Low=0, Active High=1)
    
    [GPIO_MRDY.GPIO]
    value="/sys/class/gpio/gpio135/value"
    direction="/sys/class/gpio/gpio135/direction"
    active_high_low=1 ; (Active Low=0, Active High=1)
    
    [GPIO_MRDY.LEVEL_SHIFTER]
    value="/sys/class/gpio/gpio136/value"
    direction="/sys/class/gpio/gpio136/direction"
    active_high_low=1 ; (Active Low=0, Active High=1)

    You will then need to use the CC2530 build of ZNP instead of CC2531. The is available from www.ti.com/tool/z-stack, in the ZStack-Home-1.2.1 SDK. Look in C:\Texas Instruments\Z-Stack Home 1.2.1\Projects\zstack\ZNP\CC253x project. Take care to pull the cfg0 and cfg1 GPIO's in the correct direction (or hard code then in OnBoard.c. The cfg0, cfg1, MRDY and SRDY connections to CC2530 ZNP are described in Z-Stack Home 1.2.1\Documents\API\CC2530\CC2530ZNP Interface Specification.pdf. NOTE: ignore the suggestion that SPI CS and MRDY can be combined on the same pin, this is not possible in Linux as you do not have fine control over the SPI CS pin.

    Hope this helps.

    Regards, TC.