Using more digital pins on M4?

Discussion in 'UDOO NEO' started by Maurice, Nov 6, 2016.

  1. Maurice

    Maurice Active Member

    Joined:
    Oct 13, 2015
    Messages:
    394
    Likes Received:
    87
    Has anybody got around trying to use more digital pins on M4? Being a noob on dts and such I'm not really sure how to do it. I already get stuck at finding the requiring dtsi files...
     
  2. Maurice

    Maurice Active Member

    Joined:
    Oct 13, 2015
    Messages:
    394
    Likes Received:
    87
    Note that the documentation states
    , but there is no such file as imx6sx-udoo-neo-external.dtsi, there is a file imx6sx-udoo-neo-externalpins.dtsi though in /arch/arm/boot/dts...
     
  3. Maurice

    Maurice Active Member

    Joined:
    Oct 13, 2015
    Messages:
    394
    Likes Received:
    87
    I'm following the instructions, but I'm wondering about the part with changes to be made to the pin map in wiring_digital.c:
    I assume that if I want all pins to M4 I need to uncomment and include this. But, do these pins then work as I2C on M4?
     
  4. Maurice

    Maurice Active Member

    Joined:
    Oct 13, 2015
    Messages:
    394
    Likes Received:
    87
    I've changed in wiring_digital.h:
    #define ARD_NMAX_DIO 36

    and added in wiring_digital.c:
    {ARD_DIO14, ARD_DIO14_MUX_GPIO}, // 14 SDA
    {ARD_DIO15, ARD_DIO15_MUX_GPIO}, // 15 SCL
    {ARD_DIO16, ARD_DIO16_MUX_GPIO}, // 16
    {ARD_DIO17, ARD_DIO17_MUX_GPIO}, // 17
    {ARD_DIO18, ARD_DIO18_MUX_GPIO}, // 18
    {ARD_DIO19, ARD_DIO19_MUX_GPIO}, // 19
    {ARD_DIO20, ARD_DIO20_MUX_GPIO}, // 20
    {ARD_DIO21, ARD_DIO21_MUX_GPIO}, // 21
    {ARD_DIO22, ARD_DIO22_MUX_GPIO}, // 22
    {ARD_DIO23, ARD_DIO23_MUX_GPIO}, // 23

    {ARD_DIO24, ARD_DIO24_MUX_GPIO}, // 24
    {ARD_DIO25, ARD_DIO25_MUX_GPIO}, // 25
    {ARD_DIO26, ARD_DIO26_MUX_GPIO}, // 26
    {ARD_DIO27, ARD_DIO27_MUX_GPIO}, // 27
    {ARD_DIO28, ARD_DIO28_MUX_GPIO}, // 28
    {ARD_DIO29, ARD_DIO29_MUX_GPIO}, // 29
    {ARD_DIO30, ARD_DIO30_MUX_GPIO}, // 30
    {ARD_DIO31, ARD_DIO31_MUX_GPIO}, // 31
    {ARD_DIO32, ARD_DIO32_MUX_GPIO}, // 32
    {ARD_DIO33, ARD_DIO33_MUX_GPIO}, // 33
    {ARD_DIO34, ARD_DIO34_MUX_GPIO}, // 34
    {ARD_DIO35, ARD_DIO35_MUX_GPIO}, // 35



    I've tried reading input from pins 35,34,33 and 16. 33 and 16 were ok, 34 and 35 did nothing.
    Also, is 35 the maximum? The row goes to 47.
     
  5. Masquime

    Masquime New Member

    Joined:
    May 4, 2017
    Messages:
    13
    Likes Received:
    3
    Hello Maurice,
    As you, I need to use more digital pins on M4, and I saw those instructions but I still need some help : ( I have a Neo basic board)
    - I didn't found the imx6sx-udoo-neo.dtsi file
    - I don't know how to open and read it
    - I don't know how to recompile the kernel

    So, I'm a noob, thanks for your help.
     
  6. Maurice

    Maurice Active Member

    Joined:
    Oct 13, 2015
    Messages:
    394
    Likes Received:
    87
    What is the operating system you are running on? I'm on Ubuntu, I'm not sure how other (non-Linux) operating systems work.
    For getting the toolchain and other stuff you have to follow the steps in Advanced topics in the UDOO Neo documentation.
     
  7. Masquime

    Masquime New Member

    Joined:
    May 4, 2017
    Messages:
    13
    Likes Received:
    3
    Maurice, I'm on Ubuntu too.
    Finally, I found files here .
    I modified them. Then, I tried to compile .dts using that command line :
    dtc -I dts -O dtb -o path/<devicetree name>.dtb path/<devicetree name>.dts
    But I get an error : unable to parse input tree
    I also try this advanced topics : https://www.udoo.org/docs-neo/Advanced_Topics/Compile_Linux_Kernel.html
    But the gcc-arm-linux-gnueabihf installation failed.
    Is there a way to only compile device trees or I have to compile the entire kernel ? That's I don't understand...

    Edit : It was painful for me, but it works now. It seems that I don't need gcc-arm-linux-gnueabihf because another version of a cross compiler was installed. (I followed the advanced topic)
     
    Last edited: May 12, 2017
  8. Dirk

    Dirk New Member

    Joined:
    Jan 31, 2019
    Messages:
    1
    Likes Received:
    1
    After a few day's and a lot of anxiety I got it working too.

    Finally I realised that the wiring_digital.c and wiring_digital.h are needed in the compilation of the Arduino-code. So.. when programming your code from an external PC, that's the place where these files have to be modified then.
    In my case (under Windows) they were in users\current_user\AppData\Local\Arduino15\packages\UDOO\hardware\solox\1.6.7\variants\udooneo.
     
    waltervl likes this.

Share This Page