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.

Linux/AM3354: AM3354 connect to a zigbee uart module

Part Number: AM3354

Tool/software: Linux

Hi, My name is  JAE OH.

I want to connect to a zigbee module via uart.

The zigbee module has 2-wire uart pins (tx and rx), miso pin, and reset.

So, I connect the module to am3354 using SPI0_D0, SPIO_SCLK, SPI0_CS1 and MCASP0_FSR pin.

SPI0_D0 and SPI0_SCLK are used for uart, SPI0_CS1 is used for miso, MCASP0_FSR is used for reset

How do I design pin mux setting in device tree?

I want your advices

Thanks.

  • Hi,

    Lets say for example, that you are using AM3354 ZCZ package and want to mux:
    A17 (SPI0_SCLK) as uart2_rxd => mux mode 1
    B17 (SPI0_D0) as uart2_txd => mux mode 1
    C15 (SPI0_CS1) as gpio0_6 => mux mode 7
    C13 (MCASP0_FSR) as gpio3_19 => mux mode 7

    See Data Manual, Table 4-1. Ball Characteristics.

    Then the pinmux mode should look like:

    uart2_pins: uart2_pins {
    pinctrl-single,pins = <
    0x150 (PIN_INPUT_PULLUP | MUX_MODE1) /*SPI0_SCLK.uart2_rxd*/
    0x154 (PIN_INPUT_PULLUP | MUX_MODE1) /*SPI0_SCLK.uart2_txd*/
    0x160 (PIN_INPUT_PULLUP | MUX_MODE7) /*SPI0_CS1.gpio0_6*/
    0x1A4 (PIN_INPUT_PULLUP | MUX_MODE7) /*MCASP0_FSR.gpio3_19*/
    >;
    };

    And then in uart2 node, or whichever dts node you use for your zigbee device, you should add:
    uart2 {
    pictrl-names = "default";
    pinctrl-0 = <&uart2_pins>;
    status = "okay";
    <other uart settings, if needed>;
    };

    Hope this helps.

    Best Regards,
    Yordan
  • Hi,

    I checked it using the example, but it does not work.

    In the example, uart2_txd set to PIN_INPUT. Is it right?  It is changed to PIN_OUTPUT?

    0x154 (PIN_INPUT_PULLUP | MUX_MODE1) /*SPI0_SCLK.uart2_txd*/  --->

    In the zigbee module data sheet, reset pin is activated by low, and I/O type is input.

    Also, miso pin type is GND.

    Is it right as the below pin mux?

    0x150 (PIN_INPUT_PULLUP | MUX_MODE1) /*SPI0_SCLK.uart2_rxd*/
    0x154 (PIN_OUTPUT_PULLUP | MUX_MODE1) /*SPI0_SCLK.uart2_txd*/
    0x160 (PIN_OUTPUT_PULLUP | MUX_MODE7) /*SPI0_CS1.gpio0_6*/
    0x1A4 (PIN_OUTPUT_PULLUP | MUX_MODE7) /*MCASP0_FSR.gpio3_19*/ 

    How do I active gpio setting for reset pin?

    Thanks

  • Hi,

    The PIN_INPUT setting in the dts configures the device pad as I/O, so both input & output are enabled (i/o cell is bidirectional).

    In the zigbee module data sheet, reset pin is activated by low, and I/O type is input.

    If your device driver uses gpio as reset, then you need to source it differently. Something like:
    gpios = <&gpio3 19 GPIO_ACTIVE_LOW>;

    OR, if the above doesn't work (depends on the device driver), try:
    interrupt-parent = <&gpio3>;
    interrupts = <19 IRQ_TYPE_LEVEL_LOW>;

    The lines should be added in the &uart2 dts node.

    Is it right as the below pin mux?

    The pinmuxing you propose is correct.

    Hope this helps.

    Best Regards,
    Yordan