UARTs linux

Discussion in 'UDOO NEO' started by Pilif, Jan 11, 2016.

  1. Pilif

    Pilif New Member

    Joined:
    Jan 11, 2016
    Messages:
    15
    Likes Received:
    2
    Hello,
    I looked at the docs [1] with no luck..
    I would like to use the UART_1 with an external Sensor instead of connecting it to arduino. While using python I can write but not read (the script is working on other boards). What is the meaning of "serial debug" ? Ideas what I am missing ?
    Thanks!
    [1] http://udoo.org/docs-neo/Hardware_&_Accessories/Uart_serial.html
     
  2. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Dear Pilif,
    the serial debug is a communication channel for debugging. The serial debug module for NEO allows you to interface with the serial debug.
    UART 1 is assigned to A9 by default, so you can't do what you aim. What you have to do instead is recompiling the kernel, then you can do what you aim to do.
     
  3. Pilif

    Pilif New Member

    Joined:
    Jan 11, 2016
    Messages:
    15
    Likes Received:
    2
    Thank you @Andrea Rovai,
    I guess i have to look and follow at [1] , but what do I have to change to unset/set UART1 ?
    2. how can one use UART_6 ?
    Thanks!
    [1]http://www.udoo.org/docs-neo/Kernel_Hacking/Compile_the_kernel.html
    EDIT:
    following the wiki links and searching through git I guess that I have to edit line 501 in https://github.com/UDOOboard/linux_...b7e45552c/arch/arm/configs/udoo_neo_defconfig
    which is CONFIG_CMDLINE="noinitrd console=ttymxc0,115200" ?
    If yes what about line 502 - CONFIG_CMDLINE_FROM_BOOTLOADER=y can I not just add a new console= ttymxcX (in uboot I guess )for example and edit so the values set in line 501?

     
    Last edited: Jan 13, 2016
  4. bander

    bander New Member

    Joined:
    Dec 24, 2015
    Messages:
    21
    Likes Received:
    6
    Andrea Rovai likes this.
  5. Pilif

    Pilif New Member

    Joined:
    Jan 11, 2016
    Messages:
    15
    Likes Received:
    2
    Last edited: Jan 13, 2016
  6. bander

    bander New Member

    Joined:
    Dec 24, 2015
    Messages:
    21
    Likes Received:
    6
    Good. Sounds like you are almost there.

    * arch/arm/boot/zImage from the build goes in /boot (there's already a zImage that you probably want to backup, in case you need to go back).
    * Then, yes, you also need to copy over the modules directory to /lib/modules, which has to match the running kernel version exactly ('uname -r'). Use tar, for example: 'cd modulesdir/lib/modules && tar -cf 3.14.56-g3fa3d71-modules.tar 3.14.56-g3fa3d71', when INSTALL_MOD_PATH from the last step was defined as 'modulesdir'. The 'g3fa3d71' part will be different for you, since it reflects the git hash of the repo at build time.
     
  7. Pilif

    Pilif New Member

    Joined:
    Jan 11, 2016
    Messages:
    15
    Likes Received:
    2
    thank you @bander.
    I did it ... now messed my Wifi but I think i did that with installing connman (it didn't finish properly) and then the wifi was soft blocked so "sudo rfkill unblock wifi; sudo rfkill unblock all" and now the board hangs after/in boot .. I wanted to format the SD card any way.
     
  8. Pilif

    Pilif New Member

    Joined:
    Jan 11, 2016
    Messages:
    15
    Likes Received:
    2
    @bander, @Andrea Rovai
    I took the latest iso, patched serial tty (+ && !sport->dma_is_inited + && !sport->port.flags == UPF_LOW_LATENCY)), enabled uart6 (+ status = "okay";) compiled like above described and still nothing. which kernel version were you using? More important when I used the tree editor after that I could not boot till I removed 'use_custom_dtb=true' from uEnv.txt . What am I missing?
     
  9. bander

    bander New Member

    Joined:
    Dec 24, 2015
    Messages:
    21
    Likes Received:
    6
    @Pilif You need more than status = 'okay'. Either enable in dtweb on Udoobuntu RC1, or fiddle with patch to dts that I posted in uart6 thread before I figured out the low-latency patch.
     
    Pilif likes this.
  10. Pilif

    Pilif New Member

    Joined:
    Jan 11, 2016
    Messages:
    15
    Likes Received:
    2
    aha .. ok I missed
    Code:
    @@ -28,10 +28,10 @@
    MX6SX_PAD_CSI_DATA01__GPIO1_IO_15
    MX6SX_PAD_CSI_DATA02__GPIO1_IO_16
    MX6SX_PAD_CSI_DATA03__GPIO1_IO_17
    - MX6SX_PAD_CSI_DATA04__GPIO1_IO_18
    - MX6SX_PAD_CSI_DATA05__GPIO1_IO_19
    - MX6SX_PAD_CSI_DATA06__GPIO1_IO_20
    - MX6SX_PAD_CSI_DATA07__GPIO1_IO_21
    +// MX6SX_PAD_CSI_DATA04__GPIO1_IO_18
    +// MX6SX_PAD_CSI_DATA05__GPIO1_IO_19
    +// MX6SX_PAD_CSI_DATA06__GPIO1_IO_20
    +// MX6SX_PAD_CSI_DATA07__GPIO1_IO_21
    
    soo ok I will compile again and try the dtweb .. if it doesn't work again I will patch (also with dies) the dts ..
    Thank you @bander
     
    Last edited by a moderator: Apr 26, 2016
  11. Pilif

    Pilif New Member

    Joined:
    Jan 11, 2016
    Messages:
    15
    Likes Received:
    2
    @bander Thank you !!! it is working now :)
     
    Andrea Rovai likes this.

Share This Page