cezar.santanna
Posts: 5
Joined: Thu Jun 23, 2016 7:25 pm

LTE Hat using MAX3421 USB/SPI Bridge

Wed Apr 18, 2018 7:21 pm

Hello,

I am trying to put a LTE modem into a Pi HAT and I'm using the SPI bus to keep the solution without external wires.

I have compile the max3421-hcb module in the kernel 4.14 but I don't know how to load the module parameters, so even with modprobe max3421-hcb and the module loaded into memory I don't see any signal of the MAX3421 into syslog or dmesg output.

For the test I am using the USB/SPI shield from sparkfun.

Can some help?

Best Regars

cezar.santanna
Posts: 5
Joined: Thu Jun 23, 2016 7:25 pm

Re: LTE Hat using MAX3421 USB/SPI Bridge

Mon Apr 23, 2018 11:09 am

I have followed this example: [mcp2515-can0-overlay.dts][1] and goted this file:

Code: Select all

    /dts-v1/;
    /plugin/;

    / {
    compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709";
    /* disable spi-dev for spi0.0 */
    [email protected] {
        target = <&spi0>;
        __overlay__ {
            status = "okay";
        };
    };

    [email protected] {
    target = <&spidev0>;
    __overlay__ {
        status = "disabled";
    };
    };

    /* the interrupt pin of the usb-controller */
    [email protected] {
        target = <&gpio>;
        __overlay__ {
            usb0_pins: usb0_pins {
                brcm,pins = <25>;
                brcm,function = <0>; /* input */
            };
        };
    };

    /* the clock/oscillator of the usb-controller */
    [email protected] {
        target-path = "/clocks";
        __overlay__ {
            /* external oscillator of max3421 on SPI0.0 */
            usb0_osc: usb0_osc {
                compatible = "fixed-clock";
                #clock-cells = <0>;
                clock-frequency  = <25000000>;
            };
        };
    };

    /* the spi config of the usb-controller itself binding everything together */
    [email protected] {
        target = <&spi0>;
        __overlay__ {
            /* needed to avoid dtc warning */
            #address-cells = <1>;
            #size-cells = <0>;
            [email protected] {
                compatible = "maxim,max3421";
                reg = <0>;
                maxim,vbus-en-pin = <3 1>;
                spi-max-frequency = <25000000>;
                interrupt-parent = <&gpio>;
                interrupts = <25 8>;
                clocks = <&usb0_osc>;
            };
        };
    };
    __overrides__ {
        oscillator = <&usb0_osc>,"clock-frequency:0";
        spimaxfrequency = <&usb0>,"spi-max-frequency:0";
        interrupt = <&usb0_pins>,"brcm,pins:0",<&usb0>,"interrupts:0";
    };
};
I'm using this setup to try make MAX3421E work:
- Raspberry Pi 3
- Raspbian GNU/Linux 9
- Kernel Linux raspberrypi 4.15.17-v7+
- With MAX3421-HCB compile as module
- spi0-max3421e.dtbo inside /boot/overlay
- Line dtoverlay=spi0-max3421e in /boot/config.txt

- Printout of command raspi-gpio get 25,8,10,9,11
GPIO 8: level=1 fsel=4 alt=0 func=SPI0_CE0_N
GPIO 9: level=0 fsel=4 alt=0 func=SPI0_MISO
GPIO 10: level=0 fsel=4 alt=0 func=SPI0_MOSI
GPIO 11: level=0 fsel=4 alt=0 func=SPI0_SCLK
GPIO 25: level=1 fsel=0 func=INPUT

- Sparkfun SPI USB Arduino Shield
D7 (RESET) - connected to 5Vdc
D8 (GPX) - not connected
D9 (INT) - connected to BCM25 (Pin 22)
D10 (SS) - connected to BCM8 (Pin 24)
D11 (MOSI) - connected to BCM10 (Pin 19)
D12 (MISO) - connected to BCM9 (Pin 21)
D13 (SCK) - connected to BCM11 (Pin 23)
VIN - connected to Raspberry Pi Pin 2

On boot the module max3421-hcb do not is load automatically, I believe that it should be, because of dtoverlay=spi0-max3421e

Even with sudo modeprobe max3421-hcb, printout of lsmod:
`[email protected]:~# lsmod`
`Module Size Used by`
`max3421_hcd 20480 0`
`spidev 16384 0`
I get 0 messages inside syslog or dmesg

When I was using the version 4.14 of the kernel I alter the file max3421-hcb.c to be like the one in 4.15 kernel! Now I'm using a full 4.15.y kernel, but no result either.

Best Regards


[1]: https://github.com/raspberrypi/linux/bl ... verlay.dts "mcp2515-can0-overlay.dts"

cezar.santanna
Posts: 5
Joined: Thu Jun 23, 2016 7:25 pm

Re: LTE Hat using MAX3421 USB/SPI Bridge

Sat Jun 30, 2018 9:29 pm

After all this time I have some advances in using this driver, but I also have some setbacks.
My goal is to integrate a uBlox SARA-U201 and a Raspberry Pi 3, after your help I get the MAX3421 working, but after some time I receive this messages through dmesg command:

Code: Select all

[  981.301918] INFO: task pppd:1518 blocked for more than 120 seconds.
[  981.301922]       Not tainted 4.15.18-v7+ #1
[  981.301924] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  981.301927] pppd            D    0  1518      1 0x00000001
[  981.301941] [<807935f0>] (__schedule) from [<80793c40>] (schedule+0x50/0xa8)
[  981.301949] [<80793c40>] (schedule) from [<807940a0>] (schedule_preempt_disabled+0x18/0x1c)
[  981.301959] [<807940a0>] (schedule_preempt_disabled) from [<807959ec>] (__mutex_lock.constprop.3+0x184/0x598)
[  981.301969] [<807959ec>] (__mutex_lock.constprop.3) from [<80795f1c>] (__mutex_lock_slowpath+0x1c/0x20)
[  981.301978] [<80795f1c>] (__mutex_lock_slowpath) from [<80795f7c>] (mutex_lock+0x5c/0x60)
[  981.301987] [<80795f7c>] (mutex_lock) from [<8050ccfc>] (tty_lock+0x50/0x74)
[  981.301994] [<8050ccfc>] (tty_lock) from [<80504214>] (tty_release+0x50/0x460)
[  981.302006] [<80504214>] (tty_release) from [<80287a04>] (__fput+0x9c/0x1dc)
[  981.302017] [<80287a04>] (__fput) from [<80287bbc>] (____fput+0x18/0x1c)
[  981.302026] [<80287bbc>] (____fput) from [<8013aa54>] (task_work_run+0xcc/0xf8)
[  981.302037] [<8013aa54>] (task_work_run) from [<8010b4bc>] (do_work_pending+0xc4/0xc8)
[  981.302047] [<8010b4bc>] (do_work_pending) from [<80107df4>] (slow_work_pending+0xc/0x20)
Does any one can help?

Return to “Advanced users”

Who is online

Users browsing this forum: No registered users and 12 guests