picocoma9x accessing external hardware via i2c4 and spi

      picocoma9x accessing external hardware via i2c4 and spi

      hello everyone,

      we are currently using the f&s picocoma9x board with the embedded linux kernel.
      we have attached this picoboard to our custom hardware. On this custom hardware there are a BMI055 which should be accessed via the spi and a bme280 which should be accessed via the i2c4.
      furthermore we also want to use the second ethernet port.
      in my view the default devicetree is not configured for the i2c4, right? therefore i created a custom devicetree.

      to create the custom devicetree we use the virtual machine and add the fsimx6x-V2.1 package. we use the install-sources.sh script and were able to build the kernel and the devicetree.

      for the devicetree we use the defines:
      #define CONFIG_PICOCOMA9x_ETH_B
      and for the i2c
      #define CONFIG_PICOCOMA9X_I2C_B
      and disable the cortex m4 and the gpu.

      with uboot and tftp we uploaded the devicetreeblob as described in the documentation.


      unfortuneatly when we reboot the pico, i cannot access the sensors or the 2nd ethernet as desired. it looks like as the devicetree hasn't changed although we typed the nand erase nand write in the u-boot.
      when i want to use i2cdetect i can only use i2c-2 and i2c-3. when i type ifconfig only one ethernet port is shown.


      do i have to update the whole kernel?
      could it be possible that theres a mismatch between kernel and devicetree?

      should i am be able to access the external sensors with the default kernel and devicetree?

      i attached the dmesg_output.

      i am looking forward for some tipps.
      many thanks
      greetz fda


      EDIT:
      i double checked the documents and saw the following sentence:
      "7) Alternate pin configuration function in software.
      Please refer the software manual or ask our technical support.
      I2C0 can only used on one pair of pins at the same time (identical hardware block), I2C1 also.
      There is no compatibility to other picoCOM using this alternative function."

      We want to use the I2C on pin IO14 for SDA and IO15 for SCL is this possible in general?

      EDIT2:

      i've seen i am in the wrong topic.. @mods please move the thread to the embedded Linux topic.
      Files
      • dmesg_output.txt

        (12.95 kB, downloaded 85 times, last: )

      Post was edited 3 times, last by “fda” ().

      fda wrote:

      furthermore we also want to use the second ethernet port.

      The second ethernet port is a hardware option. So you need the appropriate version of the PicoCOMA9X (PCOMA9X-V3-LIN) to be able to use this port. In this case, the board does not have audio anymore.

      in my view the default devicetree is not configured for the i2c4, right? therefore i created a custom devicetree.

      No, the default configuration has I2C4 available as the official I2C port on pins 32 and 33. You should be able to use this port right away.

      to create the custom devicetree we use the virtual machine and add the fsimx6x-V2.1 package. we use the install-sources.sh script and were able to build the kernel and the devicetree.

      Correct.

      for the devicetree we use the defines:
      #define CONFIG_PICOCOMA9x_ETH_B

      Yes, this is correct, too. As the second ethernet port is not available on most boards, we do not enable it by default.

      and for the i2c
      #define CONFIG_PICOCOMA9X_I2C_B

      This should not be required. This is if you want to have a second I2C (based on I2C1) instead of CAN on pins 30 + 31. Please note that using such alternative function breaks the PicoCOM standard. Which means neither any other existing nor any future PicoCOM boards will be guaranteed to have this alternative function on these pins -- or any pins at all.

      and disable the cortex m4 and the gpu.

      Yes, you can do that if you do not need these devices.

      with uboot and tftp we uploaded the devicetreeblob as described in the documentation.

      You also have to re-compile the device tree. Did you do that?

      do i have to update the whole kernel?

      No, in this case just the device tree.

      We want to use the I2C on pin IO14 for SDA and IO15 for SCL is this possible in general?

      There is the regular I2C on pins 32+33, and there is an optional I2C on pins 30+31. Why do you want to use pins 34+35?

      i've seen i am in the wrong topic.. @mods please move the thread to the embedded Linux topic.

      Done, moved to the Linux section.

      Your F&S Support Team
      F&S Elektronik Systeme GmbH
      As this is an international forum, please try to post in English.
      Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.
      Hi,
      thank you for your fast and detailed response.

      ETH1:
      The eth1 port is now available in the /sys/class/net/eth1..
      it is also configured in the /etc/network/interface as eth1, the same way as the eth0.
      EDIT: Eth1 is up after a reboot!

      when we type ifup eht1:
      RTNETLINK answers: File exists
      RTNETLINK answers: No such device

      I2C:
      the
      hardware is already created and we have the first prototypes. So the
      sensor is at I2C on pin IO14 for SDA and IO15 for SCL. Is it possible to
      change the portpins in the devicetree? Or do we need to change the
      portpins at the hardware?

      The other sensors are using the SPI Port (IO8,I9,IO10,IO11).
      EDIT: Sensors via spi are working

      Post was edited 2 times, last by “fda” ().

      fda wrote:


      EDIT: Eth1 is up after a reboot!

      This depends on what you have configured in /etc/network/interfaces. If you do not add something there, the port should be down by default.

      when we type ifup eht1:
      RTNETLINK answers: File exists
      RTNETLINK answers: No such device

      ifup depends on settings for the given argument, eth1 in this case. So any settings done here are from you. Have you copied some file for eth0 and forgot to change eth0 to eth1 in some places?

      I2C:
      the
      hardware is already created and we have the first prototypes.

      But how do you get the idea to use these two pins as I2C in the first place? In the hardware documentation, these pins are labeled as IO signals and as SD card signals. So why do you use them as I2C pins? Are you sure that we are talking of pins 34+35?

      Is it possible to
      change the portpins in the devicetree? Or do we need to change the
      portpins at the hardware?

      A software-I2C is always possible on any two GPIOs. So a hardware modification should not be necessary.

      Your F&S Support Team
      F&S Elektronik Systeme GmbH
      As this is an international forum, please try to post in English.
      Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.