Building Zigbee applications on nrf5340 with nrf-FEM module

Hi,

I am building a zigbee application using a custom board with 5340 and 21540. I have the 21540 chip connected with all gpios and SPI pins to the 5340. It also has both antennas connected.

First I want to validate the configurations.

Do I need to forward all the gpios from the DTS file to the net core including the SPI pins?

How do I enable logging on the network core to validate that the 21540 works?

Should I have the config on the Net core only?

If I am doing the SPI on the APP core, and forwarding the gpio to the net core, how does that look like?


Right now, I have the FEM MPSL config on the NET core, and the DTS of the APP core forwards the including SPI  pins to the Net core, I have the netcore with SPI0 enabled with the same pins from pinctrl, and also the FEM gpio settings with that spi referenced as a sub node. I am getting  ipc endpoint bind timeout on the loggs as an error and my application hangs, and the network core outputs no logs at all.

If you have configurations on how to  do this or a skelaton app with only the configs and directions to build it you can share it and ignore all my questions. Thank you

Parents Reply
  • Hi, I read all of these docs, I am still having the same issue.

    <err> spinel_ipc_backend: IPC endpoint bind timed out

    I am using both app and net cores, it's a multi-image application.

    The child image used for the net core is the default /ncs/v2.3.0/zephyr/samples/boards/nrf/ieee802154/802154_rpmsg

    This image turns off logging, I edited the config file to enable logging. I have this in the defconfig of the net_core:

    #Enable Logging
    CONFIG_LOG=y
    CONFIG_LOG_PRINTK=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_LOG_DEFAULT_LEVEL=4
    CONFIG_LOG_MAX_LEVEL=4
    CONFIG_LOG_BACKEND_RTT=y
    
    CONFIG_MPSL=y
    # CONFIG_MPSL_FEM_ONLY=y
    CONFIG_MPSL_FEM=y
    CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=y
    CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB=20
    CONFIG_MPSL_FEM_LOG_LEVEL_DBG=y

    I also have this in the pinctrl of the net core:

    &pinctrl {
        spi3_default: spi3_default { //Radio
            group1 {
                psels = <NRF_PSEL(SPIM_SCK, 0, 24)>,
                        <NRF_PSEL(SPIM_MISO, 1, 7)>,
                        <NRF_PSEL(SPIM_MOSI, 1, 9)>;
            };
        };
        spi3_sleep: spi3_sleep {
            group1 {
                psels = <NRF_PSEL(SPIM_SCK, 0, 24)>,
                        <NRF_PSEL(SPIM_MISO, 1, 7)>,
                        <NRF_PSEL(SPIM_MOSI, 1, 9)>;
                low-power-enable;
            };
        };
    
    };

    this pinctrl is used in the net core dts:

    nrf_radio_fem: nrf_spi_fem_radio {
            compatible = "nordic,nrf21540-fem";
            tx-en-gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>;
            rx-en-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
            pdn-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
            ant-sel-gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
            supply-voltage-mv = <3300>;
            spi-if = <&nrf_radio_fem_spi>;
        };
    
    &spi0 {
        status = "okay";
        pinctrl-0 = <&spi3_default>;
        pinctrl-1 = <&spi3_sleep>;
        pinctrl-names = "default", "sleep";
        cs-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
    
        nrf_radio_fem_spi: nrf21540_fem_spi@0 {
            compatible = "nordic,nrf21540-fem-spi";
            status = "okay";
            reg = <0>;
            spi-max-frequency = <8000000>;
        };
    };

    in the app core dts:

    gpio_fwd: nrf-gpio-forwarder {
            compatible = "nordic,nrf-gpio-forwarder";
            status = "okay";
            nrf21540-gpio-if {
                gpios = <&gpio0 30 0>, // TX_EN
                        <&gpio0 31 0>, // ANT_SEL
                        <&gpio0 29 0>, // PDN
                        <&gpio1 11 0>; // RX_EN
                        
            };
            nrf21540-spi-if {
                gpios = <&gpio0 24 0>, //SCK
                <&gpio1 7 0>, //MISO
                <&gpio1 9 0>, //MOSI
                <&gpio1 8 0>; //CSN
            };
     };
    
    

    Again, when I connect my jlink debugger with the target as the net_core, I get spammed bus fault Precise data bus error.

    When I connect to the app core, Its the timeout error then hangs, the rest of my application does not run. even unrelated parts.

    the full board file is supplied below, please help, I already read the docs, still, can't get it to work.

    drive.google.com/.../view

Children
  • Please use "Insert->Code" when posting code, that will make this ticket a lot more tidy and easy to read. You can edit your reply to do so for the previous reply.

    Belalshinnawey said:
    Again, when I connect my jlink debugger with the target as the net_core, I get spammed bus fault Precise data bus error.

    Is it possible for you to log over UART instead? That is often a good thing to try if RTT does not work.

  • The board does not have an additional uart pin exposed, and it is in a remote location.

    I mentioned that the logs are showing a bus error, they are connected, they work, the debugger shows that the net core is resetting from an error.

    I included all the configurations in google drive file, so the code is more readable.

  • Belalshinnawey said:
    I included all the configurations in google drive file, so the code is more readable.

    Ain't the code that was hard to read, but this DevZone ticket. So I took the liberty to edit your comment and add code boxes.
    Please use Insert->Code next time you post code or logs.

    Belalshinnawey said:
    The board does not have an additional uart pin exposed, and it is in a remote location.

    In that case, it can be hard to debug the remote board.
    For debugging, the first thing that we want to know is, "should this work?". To test this, I suggest that you take your test-board that you have at your location and see if you can reproduce the error on the test-board.It will give us a lot of information to see if this works on the test board or not.

Related