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.

DRA76P: Disable CAN bus from vision_sdk rvc

Part Number: DRA76P

Hi,

We are using SDK v6AO.1.1, android 8.1, linux kernel 4.4.117, and vision_sdk to manage cameras.

When we are displaying cameras images from IPU2 and using CAN from Android (linux 4.4) after some time, we get:

[ 702.034663] omap_hwmod: dcan2: _wait_target_disable failed
[ 702.041944] omap_hwmod: dcan2: _wait_target_disable failed
[ 702.123173] c_can_platform 48480000.can can0: setting BTR=1c04 BRPE=0000
[ 702.283218] irq 370: nobody cared (try booting with the "irqpoll" option)
[ 702.283236] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W O 4.4.117 #188
[ 702.283244] Hardware name: Generic DRA74X (Flattened Device Tree)
[ 702.283252] Backtrace:
[ 702.283275] [<c020c80c>] (dump_backtrace) from [<c020ca08>] (show_stack+0x18/0x1c)
[ 702.283283] r6:600b0193 r5:c1246154 r4:00000000 r3:dc8ba675
[ 702.283312] [<c020c9f0>] (show_stack) from [<c0be45c8>] (dump_stack+0x94/0xa8)
[ 702.283330] [<c0be4534>] (dump_stack) from [<c029ecf8>] (__report_bad_irq+0x30/0xc8)
[ 702.283336] r6:00000000 r5:00000000 r4:eead56c0 r3:dc8ba675
[ 702.283361] [<c029ecc8>] (__report_bad_irq) from [<c029f0e8>] (note_interrupt+0x274/0x2c4)
[ 702.283367] r6:00000000 r5:00000000 r4:eead56c0 r3:0001863c
[ 702.283391] [<c029ee74>] (note_interrupt) from [<c029c0cc>] (handle_irq_event_percpu+0x258/0x2c0)
[ 702.283397] r10:c0c03258 r9:c1200030 r8:00000000 r7:00000172 r6:00000000 r5:eead5720
[ 702.283419] r4:00000000 r3:00000000
[ 702.283435] [<c029be74>] (handle_irq_event_percpu) from [<c029c174>] (handle_irq_event+0x40/0x64)
[ 702.283442] r10:00000282 r9:c1203a4c r8:ee824000 r7:00000001 r6:c12466a4 r5:eead5720
[ 702.283462] r4:eead56c0
[ 702.283476] [<c029c134>] (handle_irq_event) from [<c029fa2c>] (handle_fasteoi_irq+0xc0/0x1c4)
[ 702.283482] r6:c12466a4 r5:eead5720 r4:eead56c0 r3:00000000
[ 702.283505] [<c029f96c>] (handle_fasteoi_irq) from [<c029b81c>] (__handle_domain_irq+0x74/0xcc)
[ 702.283511] r7:00000001 r6:c1201ee8 r5:00000000 r4:c108d518
[ 702.283534] [<c029b7a8>] (__handle_domain_irq) from [<c02014d8>] (gic_handle_irq+0x40/0x7c)
[ 702.283540] r8:fa213000 r7:fa212000 r6:c1201dc8 r5:fa21200c r4:c12048cc r3:c1201dc8
[ 702.283565] [<c0201498>] (gic_handle_irq) from [<c020d500>] (__irq_svc+0x40/0x74)
[ 702.283573] Exception stack(0xc1201dc8 to 0xc1201e10)
[ 702.283583] 1dc0: c0c03258 00000000 c12ab340 00000000 c1200000 c120c0d0
[ 702.283593] 1de0: 00000000 00000001 ee824000 c1203a4c 00000282 c1201e7c c1201e80 c1201e18
[ 702.283601] 1e00: c02372dc c0236cac 600b0113 ffffffff
[ 702.283607] r8:ee824000 r7:c1201dfc r6:ffffffff r5:600b0113 r4:c0236cac r3:c02372dc
[ 702.283636] [<c0236c00>] (__do_softirq) from [<c02372dc>] (irq_exit+0xb8/0x120)
[ 702.283643] r10:c1200000 r9:c1203a4c r8:ee824000 r7:00000001 r6:00000000 r5:00000000
[ 702.283664] r4:c108d518
[ 702.283677] [<c0237224>] (irq_exit) from [<c029b820>] (__handle_domain_irq+0x78/0xcc)
[ 702.283683] r4:c108d518 r3:fa212000
[ 702.283698] [<c029b7a8>] (__handle_domain_irq) from [<c02014d8>] (gic_handle_irq+0x40/0x7c)
[ 702.283704] r8:fa213000 r7:fa212000 r6:c1201ee8 r5:fa21200c r4:c12048cc r3:c1201ee8
[ 702.283728] [<c0201498>] (gic_handle_irq) from [<c020d500>] (__irq_svc+0x40/0x74)
[ 702.283735] Exception stack(0xc1201ee8 to 0xc1201f30)
[ 702.283744] 1ee0: 00000001 00000000 fe600000 00000000 c12039ec c0c03258
[ 702.283754] 1f00: 00000000 c129ee18 00000000 c1203a4c c1200000 c1201f44 c1201f24 c1201f38
[ 702.283762] 1f20: c02234e4 c0208bfc 600b0013 ffffffff
[ 702.283767] r8:00000000 r7:c1201f1c r6:ffffffff r5:600b0013 r4:c0208bfc r3:c02234e4
[ 702.283796] [<c0208bd4>] (arch_cpu_idle) from [<c0288c0c>] (default_idle_call+0x28/0x34)
[ 702.283808] [<c0288be4>] (default_idle_call) from [<c0288f68>] (cpu_startup_entry+0x350/0x408)
[ 702.283819] [<c0288c18>] (cpu_startup_entry) from [<c0be6c9c>] (rest_init+0x90/0x94)
[ 702.283826] r7:00000000
[ 702.283842] [<c0be6c0c>] (rest_init) from [<c1000e68>] (start_kernel+0x444/0x498)
[ 702.283848] r4:c12aa050 r3:dc8ba675
[ 702.283864] [<c1000a24>] (start_kernel) from [<80008090>] (0x80008090)
[ 702.283870] handlers:
[ 702.283880] [<c0740598>] c_can_isr
[ 702.283889] Disabling IRQ #370

If we don't use CAN, just cameras from IPU or we don't display cameras and we use CAN, we don't get the error, but together  the error appears.

From vision_sdk config, we have DCAN_INCLUDE=no, we thought that there are some CAN working or configured, how can we removed totally the CAN from there?

Regards,

Miguel

  • Hi Miguel,

    In vision_sdk, DCAN1 is used in some example and it is initialized from IPU.

    However, setting DCAN_INCLUDE=no should exclude the DCAN1 related code.

    Did you try "clean build" after setting DCAN_INCLUDE=no? You can delete the "binary" folder and build again to be sure.

    Regards,
    Stanley

  • Hi Stanley,

    Thank you for your answer.

    Yes, I'm sure that the compilation is clean. In fact, we discovered it in production, where the firmware is built from scratch in a CI pipeline.

    It's weird because, sometimes, the system totally gets stuck, without kernel panic, just it gets frozen when the camera is displaying (from IPU2 with DCAN_INCLUDE=no) and there is CAN traffic in the main core.

    Maybe the mcan is enabled by default in IPU?

    Regards,

    Miguel

  • It is not enabled by default.

    The only place where DCAN is enabled is under

    System_init() in \PROCESSOR_SDK_VISION_03_08_00_00\vision_sdk\links_fw\src\rtos\links_ipu\system\system_ipu1_1.c.
    You may want to double check your Linux DTS file to make sure the entry for DCAN is set correctly and clock for DCAN is enabled.
    Regards,
    Stanley
  • We are using dcan2 and m_can0.

    It's true, that the error in much more common in the m_can0 iface than in dcan.

    m_can0: mcan@42C01A00 {
        compatible = "bosch,m_can";
        reg = <0x42C01A00 0x4000>, <0x42C00000 0x18FC>;
        reg-names = "m_can", "message_ram";
        interrupt-parent = <&gic>;
        interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
                            <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
        interrupt-names = "int0", "int1";
        ti,hwmods = "mcan";
        clocks = <&mcan_clk>;
        clock-names = "cclk";
        bosch,mram-cfg = <0x0 0 0 32 0 0 1 1>;
        status = "enabled";
    };

    dcan2: can@481d0000 {
        compatible = "ti,dra7-d_can";
        ti,hwmods = "dcan2";
        reg = <0x48480000 0x2000>;
        syscon-raminit = <&scm_conf 0x558 1>;
        interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
        clocks = <&sys_clkin1>;
        status = "enabled";
    };

    Maybe is a misconfiguration but I still don't understand why the error only appears when the camera is displaying.

    Regards,

    Miguel

  • One possibility could be dcan driver in linux trying to idle L4PER clock after use but some peripheral usage on IPU side is keeping it active which causes an inconsistent clock state.

    You may try to disable power management on linux side to see what happen.