linux固件下的外设使用

Viewed 43

问题描述


1、32位的唯一chipid怎么获取
2、我想关闭wifi和蓝牙模块,怎么操作
3、要实现USB功能的asm串口\mtpUp盘\adb调试\UVC相机\hid键盘任意组合切换,(当前只按照历程实现了纯adb\asm\mtp、adb+asm、adb+mtp)
尝试开启了下列两个功能,还需要其他依赖配置吗,编译后lsmod没找到

make linux-menuconfig
# 2. 在打开的界面中依次进入:
Device Drivers  --->
    USB Support  --->
        USB Gadget Support  --->
            [*]   RNDIS
            [*]   Mass storage
            [*]   Function filesystem(FuctionFS)
            [*]   Abstract Control Model (CDC ACM)
            // 以上为默认已开启,现在新增↓
            [*]   HID function
            [*]   USB Webcam function,

新增的两个功能在lsmod下并没有显示(这么操作对吗)

3、串口2配置:

[root@canaan ~ ]#/bin/k230_iomux.py --set io11 UART2_TXD
Setting io11:
  Current:  alt0 (GPIO11)
  New:      alt2 (UART2_TXD)
  Register: 0x000000d1 -> 0x000010d1

Pin:              11
Physical address: 0x9110502c
Value to write:   0x000010d1
Current value:    0x000000d1
Register offset:  0x002c
Confirm write? [y/N]: y
After write read: 0x000010d1
  Status:   Success
[root@canaan ~ ]#/bin/k230_iomux.py --set io12 UART2_RXD
Setting io12:
  Current:  alt0 (GPIO12)
  New:      alt2 (UART2_RXD)
  Register: 0x00000091 -> 0x00001091

Pin:              12
Physical address: 0x91105030
Value to write:   0x00001091
Current value:    0x00000091
Register offset:  0x0030
Confirm write? [y/N]: y
After write read: 0x00001091
  Status:   Success
[root@canaan ~ ]#

但是使用时,U3默认能用,开启的U2报错

[root@canaan ~ ]#ls /dev/ttyS*
/dev/ttyS0  /dev/ttyS1  /dev/ttyS2  /dev/ttyS3
[root@canaan ~ ]#microcom -t 5000 -s 115200 /dev/ttyS3
hello?
[root@canaan ~ ]#
[root@canaan ~ ]#microcom -t 5000 -s 115200 /dev/ttyS2
microcom: can't tcsetattr for /dev/ttyS2: Input/output error
[root@canaan ~ ]#

还要设置

硬件板卡


庐山派

软件版本


CanMV-K230_LCKFB_linux_v1.1_nncase_v2.11.0_ed3b7dcf.img

硬件板卡


庐山派

软件版本


CanMV-K230_LCKFB_linux_v1.1_nncase_v2.11.0_ed3b7dcf.img

硬件板卡


庐山派

软件版本


CanMV-K230_LCKFB_linux_v1.1_nncase_v2.11.0_ed3b7dcf.img

硬件板卡


庐山派

软件版本


CanMV-K230_LCKFB_linux_v1.1_nncase_v2.11.0_ed3b7dcf.img

1 Answers

1.K230的PUF模块提供了芯片唯一标识,32bytes。linux用户态获取方式:

devmem 0x91213300 32
devmem 0x91213304 32
devmem 0x91213308 32
devmem 0x9121330c 32
devmem 0x91213310 32
devmem 0x91213314 32
devmem 0x91213318 32
devmem 0x9121331c 32
2.不加载wifi和蓝牙驱动就可以了
3.使用串口2的话需要修改内核设备树,目前只使能了uart0和uart3 uart2没有使能;
4.其他组合我这边目前也没有验证过