Jump to content

smile

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by smile

  1. Hi, my environment is:

    Orange Pi One

    ARMBIAN 5.34.171031 nightly Ubuntu 16.04.3 LTS 4.11.12-sun8i

    WiringPi fork by WereCatf:

    git clone https://github.com/WereCatf/WiringOP.git -b h3

    ./build

     

    small c++ programm:

     

    #include <stdio.h>
    #include <string.h>
    #include <errno.h>
    #include <stdlib.h>
    #include <wiringPi.h>
    #include <pthread.h>


    static volatile int globalCounter;

    void myInterrupt(void) {
        ++globalCounter;
        printf("InterruptCounter: %5d\n", globalCounter);
        //digitalRead(7);
    }

    int main(void)
    {
        if (wiringPiSetup() == -1) {
            printf("wiringPiSetup Error\n");
        }
        pinMode(7, INPUT);
        pullUpDnControl(7, PUD_UP);
        if (wiringPiISR(7, INT_EDGE_FALLING, &myInterrupt) < 0)
        {
            fprintf(stderr, "Unable to setup ISR: %s\n", strerror(errno));
            return 1;
        }
        for (;;)
        {
        //main programm code here...
        }
        return 0;
    }
     

     

    Compile:

    gcc ./isr.c -o wg-daemon.out -lwiringPi -lwiringPiDev -lpthread -lm

     

    and run it...

     

    but when I put pin 7 in down state (gpio mode 7 down) ISR function begin fires (triggers) continuously (((((((

    Here is output :

     

    InterruptCounter: 132371
    InterruptCounter: 132372
    InterruptCounter: 132373
    InterruptCounter: 132374
    InterruptCounter: 132375
    InterruptCounter: 132376
    InterruptCounter: 132377
    InterruptCounter: 132378
    InterruptCounter: 132379
    InterruptCounter: 132380
    InterruptCounter: 132381
    ^C
    root@orangepione:~/example#
     

     

    but, when I add to ISR function 

    "digitalRead(7);"

    program works fine (((

     

     

     

    Please tell me, what I do wrong

     

     

  2. Yes, sorry for the typo ...

    I means :

    cat /proc/device-tree/soc/serial@01c28400/status
    cat /proc/device-tree/soc/serial@01c28800/status
    cat /proc/device-tree/soc/serial@01c28c00/status
    

    it should not get empty, check carefully, because it doesn't do \r\n, so it is appearing just before shell prompt, it is "okay" or "disabled", no other values.

     

    I`m sorry( I check more carefully, it is "disabled"(((

    disabledroot@nanopineo:/etc/snmp# cat /proc/device-tree/soc/serial@01c28400/status
    disabledroot@nanopineo:/etc/snmp# cat /proc/device-tree/soc/serial@01c28800/status
    disabledroot@nanopineo:/etc/snmp# cat /proc/device-tree/soc/serial@01c28c00/status
  3. Your DTS looks Ok.

    Did you recompile it into DTB and reboot ?

    Still no new tty ?

    Strange ...

     

    What those commands showing ?

    cat /proc/device-tree/soc/serial@01c28400
    cat /proc/device-tree/soc/serial@01c28800
    cat /proc/device-tree/soc/serial@01c28c00
    

    it should print "okay" for each one ...

     

    Hi, sorry that too late, but I reinstall clean image, check anything, but have no success(

    output is:

    cat: /proc/device-tree/soc/serial@01c28400/: Is a directory

     

    if I print "cat /proc/device-tree/soc/serial@01c28400/status", I get empty (no "okay") is printed(

     

    but in

    root@nanopineo:~# cat /dev/ttyS
    ttyS0  ttyS1  ttyS2  ttyS3  ttyS4  ttyS5  ttyS6  ttyS7
    I can see many uarts((((
  4. Firstly, I change @script.bin from /boot/bin/nanopineo.bin to /boot/bin/orangepione.bin

    I rewrite sun8i-h3-orangepi-one.dtb to sun8i-h3-nanopi-neo.dtb

    (my board is orange pi one)

    Here it is.... and script.bin. In dts file I change "disabled" -> "okay"

    files.rar

     

  5. unfortunately uarts exept 0 fails(

     

    root@nanopineo:~# dmesg | grep tty
    [    0.000000] Kernel command line: root=UUID=2d2112dd-a756-4cd3-ace6-e0c52d9647dc rootwait rootfstype=ext4 console=tty1 console=ttyS0,115200 cgroup_enable=memory swapaccount=1 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 enforcing=0 loglevel=1 ubootpart=f773f33f-01   sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16
    [    0.001204] console [tty1] enabled
    [    4.262838] console [ttyS0] disabled
    [    4.283070] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 40, base_baud = 1500000) is a U6_16550A
    [    4.283139] console [ttyS0] enabled
     
    I done with dtb file and with script.bin via fex.... but even in dmesg silence about uart3, uart1, etc....
    but I`ll try again and far) thank you friends for your help!
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines