This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3352: am3352 used 4 uarts ,but only two uarts outputs

Part Number: AM3352

Tool/software: Linux

Hi,

On am3352 borad, I used 4 uarts( 0 1 3 4)  for data transmission, when write  the fd of the uarts, the uart3 and uart4 prints, but the uart0 and uart1 have no prints.

The code as follow:

struct termios newtio;

guint8 ch, i;

static const char g_uart_path[12][12]=
{
"/dev/ttyS0","/dev/ttyS1",
"/dev/ttyS3","/dev/ttyS4",
};

for(ch=0; ch<4; ch++)
{

g_uart_fd[ch] = open(g_uart_path[ch], O_RDWR | O_NOCTTY | O_NONBLOCK);
if(g_uart_fd[ch] < 0)
{
return false;
}

bzero(&newtio, sizeof(struct termios));
newtio.c_cflag = B115200 | CS8 | CREAD | CLOCAL | PARENB & (~PARODD);
newtio.c_iflag = IGNPAR;
tcflush(g_uart_fd[ch], TCIFLUSH);
tcsetattr(g_uart_fd[ch], TCSANOW, &newtio);
}

 char *buffer="55555555";

while(1)
{
for(i=0; i<1; i++)
{
write(g_uart_fd[i], buffer, strlen(buffer));
sleep(5);
printf("%d %s \r\n",i, buffer);
}
}

  • Hi Paul,

    Have you made sure you have enabled in dts entry ?
  • Maybe am335x kernel can't open uarts more than one uart.
    If I open two uarts one time, when I ctrl+c to kill the program, the console prints as follow:



    [ 290.915575] Unable to handle kernel NULL pointer dereference at virtual address 00000000
    [ 290.923863] pgd = c0004000
    [ 290.926589] [00000000] *pgd=00000000
    [ 290.930197] Internal error: Oops: 17 [#1] PREEMPT ARM
    [ 290.935273] Modules linked in:
    [ 290.938355] CPU: 0 PID: 180 Comm: gminer-uart Not tainted 4.14.67-gd315a9bb00 #9
    [ 290.945783] Hardware name: Generic AM33XX (Flattened Device Tree)
    [ 290.951905] task: cf1da400 task.stack: ce07e000
    [ 290.956485] PC is at serial8250_release_dma+0x20/0x1dc
    [ 290.961653] LR is at omap_8250_shutdown+0x9c/0x108
    [ 290.966467] pc : [<c04ba634>] lr : [<c04bf178>] psr: a0000013
    [ 290.972761] sp : ce07fcb8 ip : ce07fce8 fp : ce07fce4
    [ 290.978009] r10: 00000000 r9 : 00000008 r8 : 00000000
    [ 290.983258] r7 : ce078240 r6 : ce059000 r5 : 00000000 r4 : c0d2aec0
    [ 290.989814] r3 : c0d2aec0 r2 : 00000000 r1 : 00000001 r0 : c0d858b4
    [ 290.996373] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
    [ 291.003542] Control: 10c5387d Table: 8f7ec019 DAC: 00000051
    [ 291.009314] Process gminer-uart (pid: 180, stack limit = 0xce07e208)
    [ 291.015697] Stack: (0xce07fcb8 to 0xce080000)
    [ 291.020076] fca0: ce07fce4 ce07fcc8
    [ 291.028299] fcc0: c0d858b4 cf2019d0 ce059000 ce078240 00000000 00000008 ce07fcfc ce07fce8
    [ 291.036520] fce0: c04bf178 c04ba620 c0d858b4 ce07e000 ce07fd0c ce07fd00 c04b7524 c04bf0e8
    [ 291.044741] fd00: ce07fd24 ce07fd10 c04b0b3c c04b7514 cf02a000 ce07e000 ce07fd3c ce07fd28
    [ 291.052963] fd20: c04b0bc8 c04b0b0c cf02a000 cf02a080 ce07fd5c ce07fd40 c049b294 c04b0b54
    [ 291.061185] fd40: ce059000 cf02a000 00000000 ce078240 ce07fd7c ce07fd60 c049be04 c049b20c
    [ 291.069406] fd60: ce059000 00000000 cf6a1010 ce078240 ce07fd8c ce07fd80 c04b382c c049bdcc
    [ 291.077629] fd80: ce07fdcc ce07fd90 c04921b4 c04b3810 ce07fdbc ce07fda0 c0244b74 c0173968
    [ 291.085850] fda0: ce078480 ce078240 ce837110 cf6a1010 cf375920 00000000 00000008 cf375920
    [ 291.094072] fdc0: ce07fe0c ce07fdd0 c02221ec c04920c8 00000000 00000000 ce04b8c0 ce078248
    [ 291.102292] fde0: ce07fdfc cf76b900 cf1da86c cf1da400 ffffe000 c0d50eb0 ce078240 cf21ef40
    [ 291.110515] fe00: ce07fe1c ce07fe10 c02223d0 c022216c ce07fe44 ce07fe20 c0144248 c02223cc
    [ 291.118736] fe20: cf1da400 ce04b8c0 ce04b8c0 ce07fe50 00000000 ce04b8f4 ce07fe6c ce07fe48
    [ 291.126958] fe40: c012ae68 c014418c c0d1658c c0d16540 ce07fe74 0007fe60 c0844684 ce07fedc
    [ 291.135179] fe60: ce07fe84 ce07fe70 c012b854 c012acf0 ffffe000 c0aa0738 ce07fec4 ce07fe88
    [ 291.143401] fe80: c0135f90 c012b818 c0d03080 2a66a02e 418004fc ce07fec8 ce07feb4 ce07ffb0
    [ 291.151622] fea0: b6ac6108 ce07fec8 b6ac610c fffffdfc ce07e000 00000000 ce07ff8c ce07fec8
    [ 291.159843] fec0: c010b164 c0135de0 00000004 00000000 2a66a02e c0491c70 00000004 00000009
    [ 291.168064] fee0: 00000000 00000000 00000000 00000000 0000c350 00000001 0000c350 00000000
    [ 291.176285] ff00: ce07ff7c ce07ff10 c0180878 c084d698 c0133da8 ce07ff80 ce07ff18 c0d774b8
    [ 291.184506] ff20: ce05ff18 00000000 d4756a8d 00000044 d474a73d 00000044 c017fbb0 c0d16580
    [ 291.192727] ff40: 00000000 00000000 cf1da400 ce07ff60 00000008 bef9e978 00000000 00000005
    [ 291.200948] ff60: 000000a2 ffffe000 c0107f04 ce07ffb0 000000a2 c0107f04 ce07e000 00000000
    [ 291.209170] ff80: ce07ffac ce07ff90 c010b48c c010aea0 00000000 00000000 00000005 000000a2
    [ 291.217391] ffa0: 00000000 ce07ffb0 c0107d8c c010b3e8 bef9e978 bef9e978 00000000 00000008
    [ 291.225612] ffc0: 00000000 00000000 00000005 000000a2 7fffffff 00000000 b6b6a000 bef9e9bc
    [ 291.233834] ffe0: 00010000 bef9e7e8 b6ac5ecc b6ac6108 40000010 bef9e978 00000000 00000000
    [ 291.242045] Backtrace:
    [ 291.244519] [<c04ba614>] (serial8250_release_dma) from [<c04bf178>] (omap_8250_shutdown+0x9c/0x108)
    [ 291.253615] r9:00000008 r8:00000000 r7:ce078240 r6:ce059000 r5:cf2019d0 r4:c0d858b4
    [ 291.261400] [<c04bf0dc>] (omap_8250_shutdown) from [<c04b7524>] (serial8250_shutdown+0x1c/0x28)
    [ 291.270138] r5:ce07e000 r4:c0d858b4
    [ 291.273738] [<c04b7508>] (serial8250_shutdown) from [<c04b0b3c>] (uart_port_shutdown+0x3c/0x48)
    [ 291.282483] [<c04b0b00>] (uart_port_shutdown) from [<c04b0bc8>] (uart_tty_port_shutdown+0x80/0xf0)
    [ 291.291482] r5:ce07e000 r4:cf02a000
    [ 291.295089] [<c04b0b48>] (uart_tty_port_shutdown) from [<c049b294>] (tty_port_shutdown+0x94/0xa0)
    [ 291.304003] r5:cf02a080 r4:cf02a000
    [ 291.307602] [<c049b200>] (tty_port_shutdown) from [<c049be04>] (tty_port_close+0x44/0x78)
    [ 291.315820] r7:ce078240 r6:00000000 r5:cf02a000 r4:ce059000
    [ 291.321511] [<c049bdc0>] (tty_port_close) from [<c04b382c>] (uart_close+0x28/0x98)
    [ 291.329118] r7:ce078240 r6:cf6a1010 r5:00000000 r4:ce059000
    [ 291.334809] [<c04b3804>] (uart_close) from [<c04921b4>] (tty_release+0xf8/0x49c)
    [ 291.342248] [<c04920bc>] (tty_release) from [<c02221ec>] (__fput+0x8c/0x218)
    [ 291.349335] r10:cf375920 r9:00000008 r8:00000000 r7:cf375920 r6:cf6a1010 r5:ce837110
    [ 291.357199] r4:ce078240
    [ 291.359749] [<c0222160>] (__fput) from [<c02223d0>] (____fput+0x10/0x14)
    [ 291.366486] r10:cf21ef40 r9:ce078240 r8:c0d50eb0 r7:ffffe000 r6:cf1da400 r5:cf1da86c
    [ 291.374350] r4:cf76b900
    [ 291.376908] [<c02223c0>] (____fput) from [<c0144248>] (task_work_run+0xc8/0xe8)
    [ 291.384266] [<c0144180>] (task_work_run) from [<c012ae68>] (do_exit+0x184/0xaec)
    [ 291.391701] r9:ce04b8f4 r8:00000000 r7:ce07fe50 r6:ce04b8c0 r5:ce04b8c0 r4:cf1da400
    [ 291.399486] [<c012ace4>] (do_exit) from [<c012b854>] (do_group_exit+0x48/0xe8)
    [ 291.406740] r7:ce07fedc
    [ 291.409298] [<c012b80c>] (do_group_exit) from [<c0135f90>] (get_signal+0x1bc/0x6f0)
    [ 291.416989] r5:c0aa0738 r4:ffffe000
    [ 291.420599] [<c0135dd4>] (get_signal) from [<c010b164>] (do_signal+0x2d0/0x428)
    [ 291.427947] r10:00000000 r9:ce07e000 r8:fffffdfc r7:b6ac610c r6:ce07fec8 r5:b6ac6108
    [ 291.435810] r4:ce07ffb0
    [ 291.438364] [<c010ae94>] (do_signal) from [<c010b48c>] (do_work_pending+0xb0/0xc8)
    [ 291.445974] r10:00000000 r9:ce07e000 r8:c0107f04 r7:000000a2 r6:ce07ffb0 r5:c0107f04
    [ 291.453839] r4:ffffe000
    [ 291.456392] [<c010b3dc>] (do_work_pending) from [<c0107d8c>] (slow_work_pending+0xc/0x20)
    [ 291.464610] r7:000000a2 r6:00000005 r5:00000000 r4:00000000
    [ 291.470303] Code: e5904138 e3540000 0a000044 e5945070 (e5953000)
    [ 291.483326] ---[ end trace 9bec23ec171d21cd ]---
    [ 291.487990] Fixing recursive fault but reboot is needed!
  • Hi,

    What is the version of linux kernel ? What is the software package ? Can you share the dts and boot logs from kernel ?
  • Thanks for your reply.

    I used am335x-evm-05.01.00.11 version SDK.  Attached the dts file and kernel config0246.dts_defconfig.zip.

    [root@ERCW ~]# uname -a

    Linux ERCW 4.14.67-gd315a9bb00 #9 PREEMPT Thu Jan 3 07:31:17 PST 2019 armv7l GNU/Linux

    The boot logs:

    U-Boot SPL 2018.01 (Jan 11 2019 - 05:17:31)

    Trying to boot from NAND

    ** Bad device mmc 0 **

    Using default environment

    U-Boot 2018.01 (Jan 11 2019 - 05:17:31 -0800)

    CPU  : AM335X-GP rev 2.1

    Model: TI AM335x EVM

    DRAM:  256 MiB

    NAND:  128 MiB

    MMC:   OMAP SD/MMC: 0

    ** Bad device mmc 0 **

    Using default environment

    <ethaddr> not set. Validating first E-fuse MAC

    Net:   board_eth_init mii cpsw, usb_ether

    Hit 'd' to stop autoboot:  0

    Booting from nand ...

    NAND read: device 0 offset 0x80000, size 0x40000

    262144 bytes read: OK

    NAND read: device 0 offset 0x200000, size 0x800000

    8388608 bytes read: OK

    ## Flattened Device Tree blob at 88000000

      Booting using the fdt blob at 0x88000000

      Loading Device Tree to 8df02000, end 8df0e4da ... OK

    Starting kernel ...

    [    0.000000] Booting Linux on physical CPU 0x0

    [    0.000000] Linux version 4.14.67-gd315a9bb00 (wuyuhuan@ubuntu) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #9 PREEMPT Thu Jan 3 07:31:17 PST 2019

    [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d

    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache

    [    0.000000] OF: fdt: Machine model: TI AM335x EVM

    [    0.000000] Memory policy: Data cache writeback

    [    0.000000] efi: Getting EFI parameters from FDT:

    [    0.000000] efi: UEFI not found.

    [    0.000000] cma: Reserved 48 MiB at 0x8a800000

    [    0.000000] CPU: All CPU(s) started in SVC mode.

    [    0.000000] AM335X ES2.1 (neon)

    [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64960

    [    0.000000] Kernel command line: console=ttyO2,115200n8 root=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048 rootfstype=ubifs rootwait=1

    [    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)

    [    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)

    [    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)

    [    0.000000] Memory: 197272K/262144K available (8192K kernel code, 319K rwdata, 2484K rodata, 1024K init, 275K bss, 15720K reserved, 49152K cma-reserved, 0K highmem)

    [    0.000000] Virtual kernel memory layout:

    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)

    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)

    [    0.000000]     vmalloc : 0xd0800000 - 0xff800000   ( 752 MB)

    [    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)

    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)

    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)

    [    0.000000]       .text : 0xc0008000 - 0xc0900000   (9184 kB)

    [    0.000000]       .init : 0xc0c00000 - 0xc0d00000   (1024 kB)

    [    0.000000]       .data : 0xc0d00000 - 0xc0d4fe48   ( 320 kB)

    [    0.000000]        .bss : 0xc0d4fe48 - 0xc0d94c0c   ( 276 kB)

    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

    [    0.000000] Preemptible hierarchical RCU implementation.

    [    0.000000]  Tasks RCU enabled.

    [    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16

    [    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts

    [    0.000000] OMAP clockevent source: timer2 at 24000000 Hz

    [    0.000018] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns

    [    0.000046] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns

    [    0.000061] OMAP clocksource: timer1 at 24000000 Hz

    [    0.000292] timer_probe: no matching timers found

    [    0.000556] Console: colour dummy device 80x30

    [    0.000590] WARNING: Your 'console=ttyO2' has been replaced by 'ttyS2'

    [    0.000600] This ensures that you still see kernel messages. Please

    [    0.000608] update your kernel commandline.

    [    0.000645] Calibrating delay loop... 597.60 BogoMIPS (lpj=2988032)

    [    0.118785] pid_max: default: 32768 minimum: 301

    [    0.119030] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)

    [    0.119050] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)

    [    0.120039] CPU: Testing write buffer coherency: ok

    [    0.120964] Setting up static identity map for 0x80100000 - 0x80100060

    [    0.121167] Hierarchical SRCU implementation.

    [    0.121621] EFI services will not be available.

    [    0.123438] devtmpfs: initialized

    [    0.134380] random: get_random_u32 called from bucket_table_alloc+0x8c/0x1ac with crng_init=0

    [    0.134992] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3

    [    0.135368] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns

    [    0.135406] futex hash table entries: 256 (order: -1, 3072 bytes)

    [    0.140154] pinctrl core: initialized pinctrl subsystem

    [    0.141068] DMI not present or invalid.

    [    0.141574] NET: Registered protocol family 16

    [    0.144497] DMA: preallocated 256 KiB pool for atomic coherent allocations

    [    0.163663] omap_hwmod: debugss: _wait_target_disable failed

    [    0.218497] cpuidle: using governor ladder

    [    0.218547] cpuidle: using governor menu

    [    0.223728] omap_gpio 44e07000.gpio: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/gpio0_pins_default, deferring probe

    [    0.224187] omap_gpio 4804c000.gpio: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/gpio1_pins_default, deferring probe

    [    0.224600] omap_gpio 481ac000.gpio: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/gpio2_pins_default, deferring probe

    [    0.225001] omap_gpio 481ae000.gpio: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/gpio3_pins_default, deferring probe

    [    0.233637] omap-gpmc 50000000.gpmc: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/nandflash_pins_s0, deferring probe

    [    0.236956] No ATAGs?

    [    0.236975] hw-breakpoint: debug architecture 0x4 unsupported.

    [    0.254638] edma 49000000.edma: TI EDMA DMA engine driver

    [    0.259512] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe

    [    0.259721] media: Linux media interface: v0.10

    [    0.259778] Linux video capture interface: v2.00

    [    0.259925] pps_core: LinuxPPS API ver. 1 registered

    [    0.259936] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>

    [    0.259967] PTP clock support registered

    [    0.260012] EDAC MC: Ver: 3.0.0

    [    0.260598] dmi: Firmware registration failed.

    [    0.261150] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400

    [    0.261632] Advanced Linux Sound Architecture Driver Initialized.

    [    0.263101] clocksource: Switched to clocksource timer1

    [    0.274190] NET: Registered protocol family 2

    [    0.275155] TCP established hash table entries: 2048 (order: 1, 8192 bytes)

    [    0.275203] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

    [    0.275240] TCP: Hash tables configured (established 2048 bind 2048)

    [    0.275371] UDP hash table entries: 256 (order: 0, 4096 bytes)

    [    0.275400] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

    [    0.275602] NET: Registered protocol family 1

    [    0.276161] RPC: Registered named UNIX socket transport module.

    [    0.276182] RPC: Registered udp transport module.

    [    0.276191] RPC: Registered tcp transport module.

    [    0.276200] RPC: Registered tcp NFSv4.1 backchannel transport module.

    [    0.277353] hw perfevents: no interrupt-affinity property for /pmu, guessing.

    [    0.277508] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available

    [    0.279429] workingset: timestamp_bits=14 max_order=16 bucket_order=2

    [    0.285388] squashfs: version 4.0 (2009/01/31) Phillip Lougher

    [    0.286337] NFS: Registering the id_resolver key type

    [    0.286402] Key type id_resolver registered

    [    0.286414] Key type id_legacy registered

    [    0.286470] ntfs: driver 2.1.32 [Flags: R/O].

    [    0.289131] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)

    [    0.289160] io scheduler noop registered

    [    0.289171] io scheduler deadline registered

    [    0.289451] io scheduler cfq registered (default)

    [    0.289466] io scheduler mq-deadline registered

    [    0.289477] io scheduler kyber registered

    [    0.291438] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568

    [    0.295734] pwm-backlight backlight: backlight supply power not found, using dummy regulator

    [    0.362267] Serial: 8250/16550 driver, 10 ports, IRQ sharing disabled

    [    0.366488] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 30, base_baud = 3000000) is a 8250

    [    0.367727] 48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 31, base_baud = 3000000) is a 8250

    [    0.368827] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 32, base_baud = 3000000) is a 8250

    [    1.074388] console [ttyS2] enabled

    [    1.079145] 481a6000.serial: ttyS3 at MMIO 0x481a6000 (irq = 33, base_baud = 3000000) is a 8250

    [    1.089156] 481a8000.serial: ttyS4 at MMIO 0x481a8000 (irq = 34, base_baud = 3000000) is a 8250

    [    1.100354] omap_rng 48310000.rng: Random Number Generator ver. 20

    [    1.109008] OF: graph: no port node found in /ocp/lcdc@4830e000

    [    1.115398] OF: graph: no port node found in /ocp/lcdc@4830e000

    [    1.121890] OF: graph: no port node found in /ocp/lcdc@4830e000

    [    1.127921] tilcdc 4830e000.lcdc: no encoders/connectors found

    [    1.148624] brd: module loaded

    [    1.160340] loop: module loaded

    [    1.170203] libphy: Fixed MDIO Bus: probed

    [    1.243205] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000

    [    1.250915] davinci_mdio 4a101000.mdio: detected phy mask fffffffa

    [    1.259374] libphy: 4a101000.mdio: probed

    [    1.263555] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver unknown

    [    1.271604] davinci_mdio 4a101000.mdio: phy[2]: device 4a101000.mdio:02, driver unknown

    [    1.280920] cpsw 4a100000.ethernet: Detected MACID = a8:1b:6a:2e:82:76

    [    1.287883] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4

    [    1.294363] cpsw 4a100000.ethernet: ALE Table size 1024

    [    1.299671] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)

    [    1.307991] cpsw 4a100000.ethernet: cpsw: Detected MACID = a8:1b:6a:2e:82:78

    [    1.316797] i2c /dev entries driver

    [    1.320917] IR NEC protocol handler initialized

    [    1.325565] IR RC5(x/sz) protocol handler initialized

    [    1.330641] IR RC6 protocol handler initialized

    [    1.335211] IR JVC protocol handler initialized

    [    1.339762] IR Sony protocol handler initialized

    [    1.344417] IR SANYO protocol handler initialized

    [    1.349143] IR Sharp protocol handler initialized

    [    1.353888] IR MCE Keyboard/mouse protocol handler initialized

    [    1.359745] IR XMP protocol handler initialized

    [    1.366572] cpuidle: enable-method property 'ti,am3352' found operations

    [    1.373892] sdhci: Secure Digital Host Controller Interface driver

    [    1.380108] sdhci: Copyright(c) Pierre Ossman

    [    1.384975] sdhci-pltfm: SDHCI platform and OF driver helper

    [    1.391491] ledtrig-cpu: registered to indicate activity on CPUs

    [    1.403975] NET: Registered protocol family 10

    [    1.410296] Segment Routing with IPv6

    [    1.414262] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver

    [    1.421106] NET: Registered protocol family 17

    [    1.425792] 8021q: 802.1Q VLAN Support v1.8

    [    1.430289] Key type dns_resolver registered

    [    1.434927] omap_voltage_late_init: Voltage driver support not added

    [    1.448969] OMAP GPIO hardware version 0.1

    [    1.456065] omap-gpmc 50000000.gpmc: GPMC revision 6.0

    [    1.461249] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000

    [    1.469623] nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1

    [    1.476173] nand: Winbond W29N01HV

    [    1.479598] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64

    [    1.487349] nand: using OMAP_ECC_BCH8_CODE_HW ECC scheme

    [    1.492827] 12 ofpart partitions found on MTD device omap2-nand.0

    [    1.498991] Creating 12 MTD partitions on "omap2-nand.0":

    [    1.504451] 0x000000000000-0x000000020000 : "NAND.SPL"

    [    1.510951] 0x000000020000-0x000000040000 : "NAND.SPL.backup1"

    [    1.517985] 0x000000040000-0x000000060000 : "NAND.SPL.backup2"

    [    1.524981] 0x000000060000-0x000000080000 : "NAND.SPL.backup3"

    [    1.531879] 0x000000080000-0x0000000c0000 : "NAND.u-boot-spl-os"

    [    1.539052] 0x0000000c0000-0x0000001c0000 : "NAND.u-boot"

    [    1.545794] 0x0000001c0000-0x0000001e0000 : "NAND.u-boot-env"

    [    1.552600] 0x0000001e0000-0x000000200000 : "NAND.u-boot-env.backup1"

    [    1.560231] 0x000000200000-0x000000a00000 : "NAND.kernel"

    [    1.568752] 0x000000a00000-0x000006e00000 : "NAND.file-system"

    [    1.600845] 0x000006e00000-0x000007600000 : "NAND.app-config"

    [    1.609685] 0x000007600000-0x000008000000 : "NAND.app-bakup"

    [    1.620642] i2c i2c-0: of_i2c: modalias failure on /ocp/i2c@44e0b000/tps@2d

    [    1.627830] i2c i2c-0: Failed to create I2C device for /ocp/i2c@44e0b000/tps@2d

    [    1.635595] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz

    [    1.642111] ubi0: attaching mtd9

    [    1.673552] random: fast init done

    [    2.110772] ubi0: scanning is finished

    [    2.131745] ubi0: attached mtd9 (name "NAND.file-system", size 100 MiB)

    [    2.138512] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes

    [    2.145444] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512

    [    2.152178] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096

    [    2.159191] ubi0: good PEBs: 800, bad PEBs: 0, corrupted PEBs: 0

    [    2.165244] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128

    [    2.172504] ubi0: max/mean erase counter: 3/0, WL threshold: 4096, image sequence number: 144143796

    [    2.181610] ubi0: available PEBs: 0, total reserved PEBs: 800, PEBs reserved for bad PEB handling: 20

    [    2.190905] ubi0: background thread "ubi_bgt0d" started, PID 45

    [    2.197280] hctosys: unable to open rtc device (rtc0)

    [    2.197892] vbat: disabling

    [    2.197900] lis3_reg: disabling

    [    2.197905] ALSA device list:

    [    2.197909]   No soundcards found.

    [    2.223228] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 46

    [    2.305096] UBIFS (ubi0:0): recovery needed

    [    3.786300] UBIFS (ubi0:0): recovery completed

    [    3.790937] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"

    [    3.799759] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes

    [    3.811422] UBIFS (ubi0:0): FS size: 86597632 bytes (82 MiB, 682 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)

    [    3.823581] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)

    [    3.831086] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID B84E0574-CC5B-4039-BBA6-0999D5F6BEE8, small LPT model

    [    3.849512] VFS: Mounted root (ubifs filesystem) on device 0:14.

    [    3.864473] devtmpfs: mounted

    [    3.869432] Freeing unused kernel memory: 1024K

    [    3.923143] NOHZ: local_softirq_pending 202

    [    3.943136] NOHZ: local_softirq_pending 40

    [    3.973146] NOHZ: local_softirq_pending 40

    [    4.023140] NOHZ: local_softirq_pending 40

    [    4.073175] NOHZ: local_softirq_pending 40

    [    4.113176] NOHZ: local_softirq_pending 40

    [    4.143165] NOHZ: local_softirq_pending 40

    Starting sshd: [    4.423163] NOHZ: local_softirq_pending 40

    [    4.443155] NOHZ: local_softirq_pending 40

    [    4.475890] random: sshd: uninitialized urandom read (32 bytes read)

    [    4.533143] NOHZ: local_softirq_pending 40

    OK

    Starting telnetd: OK

    Start mdev......

    [    5.236615] net eth0: initializing cpsw version 1.12 (0)

    [    5.276864] Generic PHY 4a101000.mdio:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)

    [    5.299896] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

    [    5.310982] 8021q: adding VLAN 0 to HW filter on device eth0

  • when I open the uarts one by one , the four uarts prints normally. When running in the foreground, the "ctrl+c" can interrupt it normally.
    When opening two uarts at a time and running in the foreground, the "ctrl+c" will cause the abnormal and prints:

    [ 290.915575] Unable to handle kernel NULL pointer dereference at virtual address 00000000
    [ 290.923863] pgd = c0004000
    [ 290.926589] [00000000] *pgd=00000000
    [ 290.930197] Internal error: Oops: 17 [#1] PREEMPT ARM
    [ 290.935273] Modules linked in:
    [ 290.938355] CPU: 0 PID: 180 Comm: gminer-uart Not tainted 4.14.67-gd315a9bb00 #9
    [ 290.945783] Hardware name: Generic AM33XX (Flattened Device Tree)
    [ 290.951905] task: cf1da400 task.stack: ce07e000
    [ 290.956485] PC is at serial8250_release_dma+0x20/0x1dc
    [ 290.961653] LR is at omap_8250_shutdown+0x9c/0x108
    [ 290.966467] pc : [<c04ba634>] lr : [<c04bf178>] psr: a0000013
    [ 290.972761] sp : ce07fcb8 ip : ce07fce8 fp : ce07fce4
    [ 290.978009] r10: 00000000 r9 : 00000008 r8 : 00000000
    [ 290.983258] r7 : ce078240 r6 : ce059000 r5 : 00000000 r4 : c0d2aec0
    [ 290.989814] r3 : c0d2aec0 r2 : 00000000 r1 : 00000001 r0 : c0d858b4
    [ 290.996373] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
    [ 291.003542] Control: 10c5387d Table: 8f7ec019 DAC: 00000051
    [ 291.009314] Process gminer-uart (pid: 180, stack limit = 0xce07e208)
    [ 291.015697] Stack: (0xce07fcb8 to 0xce080000)
    [ 291.020076] fca0: ce07fce4 ce07fcc8
    [ 291.028299] fcc0: c0d858b4 cf2019d0 ce059000 ce078240 00000000 00000008 ce07fcfc ce07fce8
    [ 291.036520] fce0: c04bf178 c04ba620 c0d858b4 ce07e000 ce07fd0c ce07fd00 c04b7524 c04bf0e8
    [ 291.044741] fd00: ce07fd24 ce07fd10 c04b0b3c c04b7514 cf02a000 ce07e000 ce07fd3c ce07fd28
    [ 291.052963] fd20: c04b0bc8 c04b0b0c cf02a000 cf02a080 ce07fd5c ce07fd40 c049b294 c04b0b54
    [ 291.061185] fd40: ce059000 cf02a000 00000000 ce078240 ce07fd7c ce07fd60 c049be04 c049b20c
    [ 291.069406] fd60: ce059000 00000000 cf6a1010 ce078240 ce07fd8c ce07fd80 c04b382c c049bdcc
    [ 291.077629] fd80: ce07fdcc ce07fd90 c04921b4 c04b3810 ce07fdbc ce07fda0 c0244b74 c0173968
    [ 291.085850] fda0: ce078480 ce078240 ce837110 cf6a1010 cf375920 00000000 00000008 cf375920
    [ 291.094072] fdc0: ce07fe0c ce07fdd0 c02221ec c04920c8 00000000 00000000 ce04b8c0 ce078248
    [ 291.102292] fde0: ce07fdfc cf76b900 cf1da86c cf1da400 ffffe000 c0d50eb0 ce078240 cf21ef40
    [ 291.110515] fe00: ce07fe1c ce07fe10 c02223d0 c022216c ce07fe44 ce07fe20 c0144248 c02223cc
    [ 291.118736] fe20: cf1da400 ce04b8c0 ce04b8c0 ce07fe50 00000000 ce04b8f4 ce07fe6c ce07fe48
    [ 291.126958] fe40: c012ae68 c014418c c0d1658c c0d16540 ce07fe74 0007fe60 c0844684 ce07fedc
    [ 291.135179] fe60: ce07fe84 ce07fe70 c012b854 c012acf0 ffffe000 c0aa0738 ce07fec4 ce07fe88
    [ 291.143401] fe80: c0135f90 c012b818 c0d03080 2a66a02e 418004fc ce07fec8 ce07feb4 ce07ffb0
    [ 291.151622] fea0: b6ac6108 ce07fec8 b6ac610c fffffdfc ce07e000 00000000 ce07ff8c ce07fec8
    [ 291.159843] fec0: c010b164 c0135de0 00000004 00000000 2a66a02e c0491c70 00000004 00000009
    [ 291.168064] fee0: 00000000 00000000 00000000 00000000 0000c350 00000001 0000c350 00000000
    [ 291.176285] ff00: ce07ff7c ce07ff10 c0180878 c084d698 c0133da8 ce07ff80 ce07ff18 c0d774b8
    [ 291.184506] ff20: ce05ff18 00000000 d4756a8d 00000044 d474a73d 00000044 c017fbb0 c0d16580
    [ 291.192727] ff40: 00000000 00000000 cf1da400 ce07ff60 00000008 bef9e978 00000000 00000005
    [ 291.200948] ff60: 000000a2 ffffe000 c0107f04 ce07ffb0 000000a2 c0107f04 ce07e000 00000000
    [ 291.209170] ff80: ce07ffac ce07ff90 c010b48c c010aea0 00000000 00000000 00000005 000000a2
    [ 291.217391] ffa0: 00000000 ce07ffb0 c0107d8c c010b3e8 bef9e978 bef9e978 00000000 00000008
    [ 291.225612] ffc0: 00000000 00000000 00000005 000000a2 7fffffff 00000000 b6b6a000 bef9e9bc
    [ 291.233834] ffe0: 00010000 bef9e7e8 b6ac5ecc b6ac6108 40000010 bef9e978 00000000 00000000
    [ 291.242045] Backtrace:
    [ 291.244519] [<c04ba614>] (serial8250_release_dma) from [<c04bf178>] (omap_8250_shutdown+0x9c/0x108)
    [ 291.253615] r9:00000008 r8:00000000 r7:ce078240 r6:ce059000 r5:cf2019d0 r4:c0d858b4
    [ 291.261400] [<c04bf0dc>] (omap_8250_shutdown) from [<c04b7524>] (serial8250_shutdown+0x1c/0x28)
    [ 291.270138] r5:ce07e000 r4:c0d858b4
    [ 291.273738] [<c04b7508>] (serial8250_shutdown) from [<c04b0b3c>] (uart_port_shutdown+0x3c/0x48)
    [ 291.282483] [<c04b0b00>] (uart_port_shutdown) from [<c04b0bc8>] (uart_tty_port_shutdown+0x80/0xf0)
    [ 291.291482] r5:ce07e000 r4:cf02a000
    [ 291.295089] [<c04b0b48>] (uart_tty_port_shutdown) from [<c049b294>] (tty_port_shutdown+0x94/0xa0)
    [ 291.304003] r5:cf02a080 r4:cf02a000
    [ 291.307602] [<c049b200>] (tty_port_shutdown) from [<c049be04>] (tty_port_close+0x44/0x78)
    [ 291.315820] r7:ce078240 r6:00000000 r5:cf02a000 r4:ce059000
    [ 291.321511] [<c049bdc0>] (tty_port_close) from [<c04b382c>] (uart_close+0x28/0x98)
    [ 291.329118] r7:ce078240 r6:cf6a1010 r5:00000000 r4:ce059000
    [ 291.334809] [<c04b3804>] (uart_close) from [<c04921b4>] (tty_release+0xf8/0x49c)
    [ 291.342248] [<c04920bc>] (tty_release) from [<c02221ec>] (__fput+0x8c/0x218)
    [ 291.349335] r10:cf375920 r9:00000008 r8:00000000 r7:cf375920 r6:cf6a1010 r5:ce837110
    [ 291.357199] r4:ce078240
    [ 291.359749] [<c0222160>] (__fput) from [<c02223d0>] (____fput+0x10/0x14)
    [ 291.366486] r10:cf21ef40 r9:ce078240 r8:c0d50eb0 r7:ffffe000 r6:cf1da400 r5:cf1da86c
    [ 291.374350] r4:cf76b900
    [ 291.376908] [<c02223c0>] (____fput) from [<c0144248>] (task_work_run+0xc8/0xe8)
    [ 291.384266] [<c0144180>] (task_work_run) from [<c012ae68>] (do_exit+0x184/0xaec)
    [ 291.391701] r9:ce04b8f4 r8:00000000 r7:ce07fe50 r6:ce04b8c0 r5:ce04b8c0 r4:cf1da400
    [ 291.399486] [<c012ace4>] (do_exit) from [<c012b854>] (do_group_exit+0x48/0xe8)
    [ 291.406740] r7:ce07fedc
    [ 291.409298] [<c012b80c>] (do_group_exit) from [<c0135f90>] (get_signal+0x1bc/0x6f0)
    [ 291.416989] r5:c0aa0738 r4:ffffe000
    [ 291.420599] [<c0135dd4>] (get_signal) from [<c010b164>] (do_signal+0x2d0/0x428)
    [ 291.427947] r10:00000000 r9:ce07e000 r8:fffffdfc r7:b6ac610c r6:ce07fec8 r5:b6ac6108
    [ 291.435810] r4:ce07ffb0
    [ 291.438364] [<c010ae94>] (do_signal) from [<c010b48c>] (do_work_pending+0xb0/0xc8)
    [ 291.445974] r10:00000000 r9:ce07e000 r8:c0107f04 r7:000000a2 r6:ce07ffb0 r5:c0107f04
    [ 291.453839] r4:ffffe000
    [ 291.456392] [<c010b3dc>] (do_work_pending) from [<c0107d8c>] (slow_work_pending+0xc/0x20)
    [ 291.464610] r7:000000a2 r6:00000005 r5:00000000 r4:00000000
    [ 291.470303] Code: e5904138 e3540000 0a000044 e5945070 (e5953000)
    [ 291.483326] ---[ end trace 9bec23ec171d21cd ]---
    [ 291.487990] Fixing recursive fault but reboot is needed!
  • When I used 4 uarts( 0 1 3 4) for data transmission, the uart3 and uart4 prints, but the uart0 and uart1 have no prints.
    And I find the uart0 and uart1 with dma enable.
    Maybe the problem happens when the uart dma enable.

    The file am33xx.dtsi:

    uart0: serial@44e09000 {
    compatible = "ti,am3352-uart", "ti,omap3-uart";
    ti,hwmods = "uart1";
    clock-frequency = <48000000>;
    reg = <0x44e09000 0x2000>;
    interrupts = <72>;
    status = "disabled";
    dmas = <&edma 26 0>, <&edma 27 0>;
    dma-names = "tx", "rx";
    };

    uart1: serial@48022000 {
    compatible = "ti,am3352-uart", "ti,omap3-uart";
    ti,hwmods = "uart2";
    clock-frequency = <48000000>;
    reg = <0x48022000 0x2000>;
    interrupts = <73>;
    status = "disabled";
    dmas = <&edma 28 0>, <&edma 29 0>;
    dma-names = "tx", "rx";
    };

    uart2: serial@48024000 {
    compatible = "ti,am3352-uart", "ti,omap3-uart";
    ti,hwmods = "uart3";
    clock-frequency = <48000000>;
    reg = <0x48024000 0x2000>;
    interrupts = <74>;
    status = "disabled";
    dmas = <&edma 30 0>, <&edma 31 0>;
    dma-names = "tx", "rx";
    };

    uart3: serial@481a6000 {
    compatible = "ti,am3352-uart", "ti,omap3-uart";
    ti,hwmods = "uart4";
    clock-frequency = <48000000>;
    reg = <0x481a6000 0x2000>;
    interrupts = <44>;
    status = "disabled";
    };

    uart4: serial@481a8000 {
    compatible = "ti,am3352-uart", "ti,omap3-uart";
    ti,hwmods = "uart5";
    clock-frequency = <48000000>;
    reg = <0x481a8000 0x2000>;
    interrupts = <45>;
    status = "disabled";
    };

    uart5: serial@481aa000 {
    compatible = "ti,am3352-uart", "ti,omap3-uart";
    ti,hwmods = "uart6";
    clock-frequency = <48000000>;
    reg = <0x481aa000 0x2000>;
    interrupts = <46>;
    status = "disabled";
    };
  • Hi Paul,

    Good guess, looks like it is related to DMA.

    Please check SDK version 5.02 and see if it is fixed : www.ti.com/.../PROCESSOR-SDK-AM335X

    Please check if any of the following fixes is of any help : github.com/.../8250_omap.c
    github.com/.../8250_dma.c
  • 1 SDK version 5.02 don't fix the bug.
    2 I need some time to merge 8250_omap.c and 8250_dma.c in github.
  • Hi Paul,

    You can add logs in serial8250_release_dma to find out which pointer is being NULL. That would give further clue to which patch to be taken from mainline.

    Also you can disable DMA for UART 0 and UART 1 and check if all UARTs are working. Also let us wait what TI has to say about this issue.

  • Hi Paul,

    Paul.Wu said:
    When running in the foreground, the "ctrl+c" can interrupt it normally.
    When opening two uarts at a time and running in the foreground, the "ctrl+c" will cause the abnormal and prints:

    [ 290.915575] Unable to handle kernel NULL pointer dereference at virtual address 00000000

    This is a known issue introduced in Processor SDK Linux v5.1.0.11. it will be fixed in the next release. Right now the workaround is either disable DMA for the 8250-omap driver or use the older release v5.0.0.15.

  • Hi Liu,
    Could you give me a download address of the older release v5.0.0.15 ?