Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. VOXL Compute & Autopilot
  3. VOXL 2
  4. SPI port for VOXL2 SLPI DSP

SPI port for VOXL2 SLPI DSP

Scheduled Pinned Locked Moved VOXL 2
17 Posts 3 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? A Former User

    @Eric-Katzfey I was going through the optical flow device driver on PX4 firmware side and had some thoughts which would need some validation.

    • I would have to write device driver for optical flow sensor similar to voxl-lepton-server on apps_proc side and then publish results over muorb topic as you said, but muorb topics publication and subscription would be part of PX4 process running on apps_proc side then how can my driver seamlessly interact with PX4?
    Eric KatzfeyE Offline
    Eric KatzfeyE Offline
    Eric Katzfey
    ModalAI Team
    wrote on last edited by
    #7

    @Aks The first question would be which optical flow sensor are you using? Is there already a PX4 driver for it? If so, maybe you can just try to get that working on the applications processor. If you need to write a completely new driver for it then you can follow the example of one of the other PX4 optical flow sensor drivers. Does it also have an integrated distance sensor? The links I provided were just to show you how we use the SPI bus on the applications processor. But you wouldn't want to have it as an external process like that. You would want your device driver to be integrated as a PX4 device driver.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #8

      @Eric-Katzfey Thank you for the response. I am using this optical flow sensor. It works on PWM3901 and already has optical flow driver for the same in PX4. This sensor also has distance sensor over I2C where I can use J19 I2C port for getting distance sensor data into PX4. Now I can get optical flow SPI driver working on application processor but my query is how can I publish optical flow data over muorb from application processor process which is not running inside PX4 application?

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #9

        EDIT :

        I would rephrase my question a bit since I would need to run optical flow device driver integrated inside PX4. How can I run optical flow device driver on PX4 application processor side of code by accessing J10 SPI port?

        Eric KatzfeyE 1 Reply Last reply
        0
        • ? A Former User

          EDIT :

          I would rephrase my question a bit since I would need to run optical flow device driver integrated inside PX4. How can I run optical flow device driver on PX4 application processor side of code by accessing J10 SPI port?

          Eric KatzfeyE Offline
          Eric KatzfeyE Offline
          Eric Katzfey
          ModalAI Team
          wrote on last edited by
          #10

          @Aks I think you would add the vl53l1x driver to the DSP build and add the pmw3901 driver to the apps build. That way the distance sensor can use the i2c bus available on j19 and the optical flow sensor can use the spi on the applications processor.

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #11

            @Eric-Katzfey Thank you for the inputs. I did the changes to build distance sensor on DSP build and assigned I2C port also to it. Now I have enabled optical flow on application processor side but I dont know how to link SPI port J10 to optical flow driver in the code. Please help.

            Eric KatzfeyE 1 Reply Last reply
            0
            • ? A Former User

              @Eric-Katzfey Thank you for the inputs. I did the changes to build distance sensor on DSP build and assigned I2C port also to it. Now I have enabled optical flow on application processor side but I dont know how to link SPI port J10 to optical flow driver in the code. Please help.

              Eric KatzfeyE Offline
              Eric KatzfeyE Offline
              Eric Katzfey
              ModalAI Team
              wrote on last edited by
              #12

              @Aks Looks like /dev/spidev14.0 is the one mapped to J10. We haven't used that port in PX4, only in our own applications. That is why I sent those links above. They show you how we use the SPI port on the applications processor in a non-PX4 application. You would need to look at how the SPI port is used and compare that against the Posix platform implementation of the SPI driver in PX4 to see if you can use it as is or if you will need to make modifications to it.

              A 1 Reply Last reply
              0
              • Eric KatzfeyE Eric Katzfey

                @Aks Looks like /dev/spidev14.0 is the one mapped to J10. We haven't used that port in PX4, only in our own applications. That is why I sent those links above. They show you how we use the SPI port on the applications processor in a non-PX4 application. You would need to look at how the SPI port is used and compare that against the Posix platform implementation of the SPI driver in PX4 to see if you can use it as is or if you will need to make modifications to it.

                A Offline
                A Offline
                Aaky
                Regular
                wrote on last edited by
                #13

                @Eric-Katzfey Hi Eric, I am working on same above integration and stuck at adding SPI section to posix device driver of PX4. Do you have any guidance on integrating PMW3901 over application processor SPI bus on J10?

                Eric KatzfeyE 1 Reply Last reply
                0
                • A Aaky

                  @Eric-Katzfey Hi Eric, I am working on same above integration and stuck at adding SPI section to posix device driver of PX4. Do you have any guidance on integrating PMW3901 over application processor SPI bus on J10?

                  Eric KatzfeyE Offline
                  Eric KatzfeyE Offline
                  Eric Katzfey
                  ModalAI Team
                  wrote on last edited by
                  #14

                  @Aaky Have you reviewed this documentation from PX4: https://docs.px4.io/main/en/sensor/pmw3901.html?

                  A 1 Reply Last reply
                  0
                  • Eric KatzfeyE Eric Katzfey

                    @Aaky Have you reviewed this documentation from PX4: https://docs.px4.io/main/en/sensor/pmw3901.html?

                    A Offline
                    A Offline
                    Aaky
                    Regular
                    wrote on last edited by
                    #15

                    @Eric-Katzfey Yes I have reviwed this document in PX4 and also I got the driver compiled atleast on application processor side. Now I need to hookup the sensor to J10 with distance sensor on J19 I2C and check if its working.

                    A 1 Reply Last reply
                    0
                    • A Aaky

                      @Eric-Katzfey Yes I have reviwed this document in PX4 and also I got the driver compiled atleast on application processor side. Now I need to hookup the sensor to J10 with distance sensor on J19 I2C and check if its working.

                      A Offline
                      A Offline
                      Aaky
                      Regular
                      wrote on last edited by Aaky
                      #16

                      @Eric-Katzfey One last doubt I have is as attached in snapshot below I am setting first argument to initSPIBus function as 14 since J10 has SPI device file as /dev/spidev14.0. Also the second argument to initSPIDevice function is 0. I think this is chip select for SPI but I read somewhere for posix drivers, chip select isnt used by SPI peripherals. Is my understanding correct?

                      This is spi.cpp file which I have added in boards/modalai/voxl2/src folder in voxl-px4 repository.

                      Screenshot from 2024-04-09 21-31-25.png

                      Eric KatzfeyE 1 Reply Last reply
                      0
                      • A Aaky

                        @Eric-Katzfey One last doubt I have is as attached in snapshot below I am setting first argument to initSPIBus function as 14 since J10 has SPI device file as /dev/spidev14.0. Also the second argument to initSPIDevice function is 0. I think this is chip select for SPI but I read somewhere for posix drivers, chip select isnt used by SPI peripherals. Is my understanding correct?

                        This is spi.cpp file which I have added in boards/modalai/voxl2/src folder in voxl-px4 repository.

                        Screenshot from 2024-04-09 21-31-25.png

                        Eric KatzfeyE Offline
                        Eric KatzfeyE Offline
                        Eric Katzfey
                        ModalAI Team
                        wrote on last edited by
                        #17

                        @Aaky Unfortunately, we have not done any integration between PX4 and SPI devices on the apps processor. I would get an oscilloscope and see what is happening on the bus.

                        1 Reply Last reply
                        0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        ModalAI
                        Categories Recent Tags ModalAI.com Docs
                        © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups