Post Go back to editing

MAX3421E SPI TO USB Linux driver Not working as expected

Category: Software
Product Number: MAX3421E

Hi Team,

We are planning to use MAX3421 chip as a bridge chip between the processor and a Wi-Fi/BT module for one of our requirement. For that we are performing the PoC.

Please find below the details of the kernel version and operating system:

OS: Yocto Linux

Kernel: 5.15

In our case, we want to use the MAX3421 chip in host mode. 

We have validated the Wi-Fi/BT module on Linux host machine and it is working fine. However, when the same module is connected to processor through MAX3421 IC, the chip is not working as expected.

can you share latest Linux driver of MAX3421 chip which support 5.15 kernel ? 

Thanks,

Parents
  • Hi,

    MAX3421 chip driver is already upstream and th elatest version is in the 5.15 mainline kernel.

    You can find here the devicetree bindings and sources here.

    If that's the driver you're using maybe you can explain the problem you're having and give us some details like do you see the USB host in linux with lsusb?
    Which speed you're running the SPI between host processor and MAX3421?

    Bogdan

  • hi bogdan,

    we are able to detect bt module on usb line.

    we are using same device tree and linux driver as mention by you.

    problem is the communication between the bt module and max3421 chip.

    check attched logs of spi driver.

    when SPI driver is probe:
    [ 10.648796][ T425] max3421_probe 1935 called
    [ 10.653415][ T425] max3421-hcd spi0.0: property 'maxim,vbus-en-pin' value is <8 1>
    [ 10.653466][ T425] max3421-hcd spi0.0: The value of irq is = 317 from max3421_probe
    [ 10.661642][ T425] max3421-hcd spi0.0: MAX3421 USB Host-Controller Driver
    [ 10.661645][ T425] max3421-hcd spi0.0: new USB bus registered, assigned bus number 1
    [ 10.661790][ T425] usb usb1: Manufacturer: Linux 5.15.104-qki-consolidate-android13-8-gf0d819d80775-dirty max3421
    [ 10.663287][ T817] max3421-hcd spi0.0: rev 0x13, SPI clk 26000000Hz, bpw 8, irq 317
    [ 10.663455][ T817] *** DEBUG_SPI *** max3421_reset_hcd :1330
    [ 10.668908][ T817] *** DEBUG_SPI *** max3421_detect_conn :1138
    [ 10.670704][ T817] *** DEBUG_SPI *** max3421_spi_thread :1492
    [ 10.671126][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 11.186565][ T58] usb 1-1: new full-speed USB device number 2 using max3421-hcd
    [ 11.221350][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.221513][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.221716][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.580537][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.580690][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.581000][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.586587][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.586744][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.586992][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.591786][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.591993][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.592286][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.593284][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.593471][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.593764][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.594672][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.594841][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.595135][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 11.596462][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 11.596693][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 11.596925][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 15.690864][ T817] max3421_handle_irqs: hrsl_stats 19 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0
    [ 20.692049][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 25.695551][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 30.700048][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 35.703598][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 40.708045][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 45.711543][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 50.716039][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 55.719499][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 60.724038][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 65.727534][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 70.732035][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 75.735560][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    [ 80.740027][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0


    when bt module start communicating with MAX3421 chip:


    [ 80.869970][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 80.870099][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 80.870284][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 80.873204][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 80.873332][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 80.873507][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 83.352673][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 83.352804][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 83.352991][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 83.356236][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 83.356367][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 83.356544][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 83.673820][ T817] *** DEBUG_SPI *** max3421_recv_data_available :852
    [ 83.673950][ T817] *** DEBUG_SPI *** max3421_recv_data_available :862
    [ 83.674125][ T817] *** DEBUG_SPI *** max3421_recv_data_available :874
    [ 85.743758][ T817] max3421_handle_irqs: hrsl_stats 2405 0 0 0 1951 0 0 0 0 0 0 0 0 0 0 0
    [ 90.747355][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4931 0 0 0 0 0 0 0 0 0 0 0
    [ 95.751415][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4925 0 0 0 0 0 0 0 0 0 0 0
    [ 100.756028][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4928 0 0 0 0 0 0 0 0 0 0 0
    [ 105.759628][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4921 0 0 0 0 0 0 0 0 0 0 0
    [ 110.764312][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4927 0 0 0 0 0 0 0 0 0 0 0
    [ 115.767802][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 4934 0 0 0 0 0 0 0 0 0 0 0
    [ 120.772170][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 2153 0 0 0 0 0 0 0 0 0 0 0
    [ 125.776073][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 1769 0 0 0 0 0 0 0 0 0 0 0
    [ 130.781209][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 1808 0 0 0 0 0 0 0 0 0 0 0
    [ 135.785536][ T817] max3421_handle_irqs: hrsl_stats 0 0 0 0 1679 0 0 0 0 0 0 0 0 0 0 0

  • Thank you for the logs.

    It looks like the SPI communication between your host processor and MAX3421E is good. It can probe, read the chip revision and hrsl registers.

    The lines printing the hrsl_stats I think are of interest for now. According to MAX3421E Programming Guide and driver source code the 16 values printed out correspond to the number of events for each of the 16 Host Result Codes.

    I see some hrSUCCESS are registered but after that a lot of hrNAK.

    That means the peripheral returned NAK and peripheral device wasn't ready for data or has no data available.

    Can you please also tell us the model of WiFi/BT module you want to use? Is it compatible with only USB FS 12Mbit/s or does it require USB HS 480 Mbit/s?

    Take care that MAX3421E is USB FS only.

  • Hi,

    We are using SX-PCEAX-SMT module from silex.

    You can find the product spec for the same at below link:
    www.mouser.in/.../SX-PCEAX-ProductBrief_20211207.pdf

    Yes, it is compatible with USB FS 12Mbit/s.

    What could be the possible reasons for no communication between MAX3421 and wifi-bt Module?

  • Hi bodgan,

    any update here?? we are waiting for your reply.

  • Hi,

    Unfortunately I have no debug options available and I also don't have the eval board to run some tests on my side.

    Can you please try to connect any other USB 1.1 peripheral device and check if ti is working?

Reply Children
No Data