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.

SK-AM62P-LP: Enable CAN interface on Android

Part Number: SK-AM62P-LP

Tool/software:

Hi TI Experts,

I am trying to enable the CAN interface on the SK-AM62P-LP board. The board is running Automotive Android OS 14 (SDK 10.0).

I used the command ip link show from adb shell, but it didn't list any CAN interfaces.

I would like to know the following:

  1. How do I enable the CAN interface and use it in Android?
  2. Which transceiver should be used to enable communication with external devices?
  3. Which pins on the board should be used for connecting to the transceiver?

Thank you!

  • Thank you, Guillaume, for your support. It is working now, and can0 is now showing in the ifconfig list.

    Here are the steps we followed:

    Initially, we tried the instructions from the link you provided:

    However, we encountered the following error:

    [    3.226616][  T136] can_dev: exports protected symbol can_eth_ioctl_hwts
    [ 3.243376][ T136] ueventd: Failed to insmod '/vendor/lib/modules/can-dev.ko' with args '': Permission denied

    To resolve the exports protected symbol can_eth_ioctl_hwts error, we commented out can_eth_ioctl_hwts in common/android/abi_gki_protected_exports_aarch64.

    We then encountered a similar error for can_ethtool_op_get_ts_info_hwts:


    [    3.589176][  T138] can_dev: exports protected symbol can_ethtool_op_get_ts_info_hwts
    [    3.597601][  T138] ueventd: Failed to insmod '/vendor/lib/modules/can-dev.ko' with args '': Permission denied

    So we tried commenting all the CAN related functions from the file common/android/abi_gki_protected_exports_aarch64.

    I have attached the patch file with modifications.

    8750.can_enable.patch.txt
    diff --git a/android/abi_gki_protected_exports_aarch64 b/android/abi_gki_protected_exports_aarch64
    index 4afadd916..1c05de4ab 100644
    --- a/android/abi_gki_protected_exports_aarch64
    +++ b/android/abi_gki_protected_exports_aarch64
    @@ -5,11 +5,6 @@ __hci_cmd_sync_sk
     __hci_cmd_sync_status
     __hci_cmd_sync_status_sk
     __nfc_alloc_vendor_cmd_reply_skb
    -alloc_can_err_skb
    -alloc_can_skb
    -alloc_candev_mqs
    -alloc_canfd_skb
    -alloc_canxl_skb
     baswap
     bt_accept_dequeue
     bt_accept_enqueue
    @@ -44,37 +39,6 @@ btbcm_set_bdaddr
     btbcm_setup_apple
     btbcm_setup_patchram
     btbcm_write_pcm_int_params
    -can_bus_off
    -can_change_mtu
    -can_change_state
    -can_dropped_invalid_skb
    -can_eth_ioctl_hwts
    -can_ethtool_op_get_ts_info_hwts
    -can_fd_dlc2len
    -can_fd_len2dlc
    -can_free_echo_skb
    -can_get_echo_skb
    -can_get_state_str
    -can_proto_register
    -can_proto_unregister
    -can_put_echo_skb
    -can_rx_offload_add_fifo
    -can_rx_offload_add_manual
    -can_rx_offload_add_timestamp
    -can_rx_offload_del
    -can_rx_offload_enable
    -can_rx_offload_get_echo_skb
    -can_rx_offload_irq_finish
    -can_rx_offload_irq_offload_fifo
    -can_rx_offload_irq_offload_timestamp
    -can_rx_offload_queue_tail
    -can_rx_offload_queue_timestamp
    -can_rx_offload_threaded_irq_finish
    -can_rx_register
    -can_rx_unregister
    -can_send
    -can_skb_get_frame_len
    -can_sock_destruct
     cdc_ncm_bind_common
     cdc_ncm_change_mtu
     cdc_ncm_fill_tx_frame
    @@ -86,8 +50,6 @@ cdc_ncm_rx_verify_nth32
     cdc_ncm_select_altsetting
     cdc_ncm_tx_fixup
     cdc_ncm_unbind
    -close_candev
    -free_candev
     generic_mii_ioctl
     h4_recv_buf
     hci_alloc_dev_priv
    @@ -209,8 +171,6 @@ nfc_tm_data_received
     nfc_tm_deactivated
     nfc_unregister_device
     nfc_vendor_cmd_reply
    -of_can_transceiver
    -open_candev
     ppp_channel_index
     ppp_dev_name
     ppp_input
    @@ -230,10 +190,8 @@ qca_send_pre_shutdown_cmd
     qca_set_bdaddr
     qca_set_bdaddr_rome
     qca_uart_setup
    -register_candev
     register_pppox_proto
     rtl8152_get_version
    -safe_candev_priv
     slhc_compress
     slhc_free
     slhc_init
    @@ -244,7 +202,6 @@ tipc_dump_done
     tipc_dump_start
     tipc_nl_sk_walk
     tipc_sk_fill_sock_diag
    -unregister_candev
     unregister_pppox_proto
     usb_serial_claim_interface
     usb_serial_deregister_drivers
    @@ -325,4 +282,4 @@ wwan_port_txoff
     wwan_port_txon
     wwan_register_ops
     wwan_remove_port
    -wwan_unregister_ops
    \ No newline at end of file
    +wwan_unregister_ops
    

    Please share your thoughts on this.

  • Hi Tony,

    Thanks a lot for sharing your solution with us.

    It's a bit odd that can symbols cannot be used according to the GKI symbol list. We will give it some more thought.

  • Hi Tony,

    Your changes are ok for now, we have not other solutions for now to fix this protected symbols problem,
    we will do a patch with your change to be include in next release.

    Thanks.
    Guillaume