您尚未登录。

#1 VMWare/Linux/Ubuntu/Fedora/CentOS/U-BOOT » Ubuntu18.04 安装微软 vscode / visual code » 2020-11-14 20:40:55

起个名字好难
回复: 2
sudo apt update
sudo apt install software-properties-common apt-transport-https wget
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
sudo apt update
sudo apt install code -y
code #运行vscode

参考链接: https://linuxize.com/post/how-to-install-visual-studio-code-on-ubuntu-18-04/

已验证

#4 Re: 全志 SOC » buildroot-tiny200 (F1C100/200s) 开发包近期更新内容 * 已支持DVP摄像头 *,支持SPI NAND » 2020-10-10 11:24:01

d:\>dfu-util-static.exe -R -a all -D sysimage-nand.img
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Opening DFU capable USB device...
ID 1f3a:1010
Run-time device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 4096
Copying data from PC to DFU device
Download        [======================== ]  99%    133693440 bytes failed!
state(10) = dfuERROR, status(14) = Something went wrong, but the device does not know what it was
Resetting USB to switch back to runtime mode
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
can't detach
U-Boot SPL 2020.07 (Oct 10 2020 - 08:45:42 +0800)
DRAM: 64 MiB
Trying to boot from MMC1
Card did not respond to voltage select!
spl: mmc init failed with error: -95
Trying to boot from MMC2
Card did not respond to voltage select!
spl: mmc init failed with error: -95
Trying to boot from sunxi SPI
SPI-NAND: GigaDevice GD5F1GQ4UAxxG
SPI-NAND: U-Boot address: 53248


U-Boot 2020.07 (Oct 10 2020 - 08:45:42 +0800) Allwinner Technology

CPU:   Allwinner F Series (SUNIV)
Model: Allwinner F1C100s Generic Device
DRAM:  64 MiB
MMC:   mmc@1c0f000: 0, mmc@1c10000: 1
Setting up a 800x480 lcd console (overscan 0x0)
In:    serial
Out:   vga
Err:   vga
Allwinner mUSB OTG (Peripheral)
Hit any key to stop autoboot:  0 
Booting from FEL...
List of MTD devices:
* spi-nand0
  - device: spi-nand@1
  - parent: spi@1c05000
  - driver: spi_nand
  - type: NAND flash
  - block size: 0x20000 bytes
  - min I/O: 0x800 bytes
  - OOB size: 64 bytes
  - OOB available: 31 bytes
  - 0x000000000000-0x000008000000 : "spi-nand0"
DFU waiting on SPI-NAND...
unrecognized JEDEC id bytes: 00, c8, f1
Failed to initialize SPI flash at 0:0 (error -2)
Card did not respond to voltage select!
Card did not respond to voltage select!
Card did not respond to voltage select!
List of MTD devices:
* spi-nand0
  - device: spi-nand@1
  - parent: spi@1c05000
  - driver: spi_nand
  - type: NAND flash
  - block size: 0x20000 bytes
  - min I/O: 0x800 bytes
  - OOB size: 64 bytes
  - OOB available: 31 bytes
  - 0x000000000000-0x000008000000 : "spi-nand0"
Booting from SPI-NAND...
Reading 16384 byte(s) (8 page(s)) at offset 0x00080000
Reading 7340032 byte(s) (3584 page(s)) at offset 0x00100000
## Flattened Device Tree blob at 80700000
   Booting using the fdt blob at 0x80700000
   Loading Device Tree to 816f9000, end 816ffc6c ... OK
Cannot setup simplefb: node not found

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.4.66 (whycan@ubuntu) (gcc version 8.4.0 (Buildroot 2020.02.4-00002-g2e2c3d224a)) #1 Fri Oct 9 10:45:59 CST 2020
[    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: Widora MangoPi R3
[    0.000000] Memory policy: Data cache writeback
[    0.000000] cma: Reserved 16 MiB at 0x83000000
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk rootwait consoleblank=0 net.ifnames=0 biosdevname=0 root=/dev/mtdblock3 overlayfsdev=/dev/mtdblock4
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 38736K/65536K available (6144K kernel code, 248K rwdata, 1680K rodata, 1024K init, 225K bss, 10416K reserved, 16384K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x254/0x444 with crng_init=0
[    0.000052] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000138] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000904] Console: colour dummy device 80x30
[    0.001006] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[    0.070261] pid_max: default: 32768 minimum: 301
[    0.070791] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.070833] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.072774] CPU: Testing write buffer coherency: ok
[    0.074876] Setting up static identity map for 0x80100000 - 0x80100058
[    0.076195] devtmpfs: initialized
[    0.088182] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.088246] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.092545] pinctrl core: initialized pinctrl subsystem
[    0.095282] NET: Registered protocol family 16
[    0.099034] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.101417] cpuidle: using governor menu
[    0.146192] SCSI subsystem initialized
[    0.146575] usbcore: registered new interface driver usbfs
[    0.146781] usbcore: registered new interface driver hub
[    0.146984] usbcore: registered new device driver usb
[    0.147492] mc: Linux media interface: v0.10
[    0.147646] videodev: Linux video capture interface: v2.00
[    0.147776] pps_core: LinuxPPS API ver. 1 registered
[    0.147797] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.147861] PTP clock support registered
[    0.148959] ion_parse_dt_heap_common: id 4 type 4 name cma align 1000
[    0.149989] Advanced Linux Sound Architecture Driver Initialized.
[    0.152597] clocksource: Switched to clocksource timer
[    0.184288] thermal_sys: Registered thermal governor 'step_wise'
[    0.185058] NET: Registered protocol family 2
[    0.186655] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.186738] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.186793] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.186842] TCP: Hash tables configured (established 1024 bind 1024)
[    0.187169] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.187230] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.187758] NET: Registered protocol family 1
[    0.190475] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.192343] Initialise system trusted keyrings
[    0.193159] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.215078] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.215702] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    0.334265] Key type asymmetric registered
[    0.334307] Asymmetric key parser 'x509' registered
[    0.334491] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    0.334522] io scheduler mq-deadline registered
[    0.334539] io scheduler kyber registered
[    0.349955] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.374670] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.380631] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pa not found, using dummy regulator
[    0.381980] printk: console [ttyS0] disabled
[    0.402311] 1c25400.serial: ttyS0 at MMIO 0x1c25400 (irq = 28, base_baud = 6250000) is a 16550A
[    0.834890] printk: console [ttyS0] enabled
[    0.844783] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[    0.866124] panel-simple panel: panel supply power not found, using dummy regulator
[    0.875817] SCSI Media Changer driver v0.25 
[    0.881561] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[    0.894551] spi-nor spi0.0: unrecognized JEDEC id bytes: 00 c8 f1 c8 f1 c8
[    0.902039] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.908689] ehci-platform: EHCI generic platform driver
[    0.914390] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.920620] ohci-platform: OHCI generic platform driver
[    0.926446] usbcore: registered new interface driver usb-storage
[    0.933634] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    0.947257] i2c /dev entries driver
[    0.951389] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[    0.965290] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[    0.976295] sun4i-csi 1cb0000.csi: Packed (RAW) format enabled.
[    0.984155] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    0.994230] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[    1.032278] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    1.041773] usbcore: registered new interface driver usbhid
[    1.047467] usbhid: USB HID core driver
[    1.051641] sunxi-cedar 1c0e000.video-codec: sunxi cedar version 0.01alpha
[    1.058946] sunxi-cedar 1c0e000.video-codec: cedar-ve the get irq is 20
[    1.070701] debugfs: Directory '1c23c00.codec' with parent 'F1C100s Audio Codec' already present!
[    1.084690] sun4i-codec 1c23c00.codec: Codec <-> 1c23c00.codec mapping ok
[    1.101020] NET: Registered protocol family 17
[    1.105724] Key type dns_resolver registered
[    1.111145] Loading compiled-in X.509 certificates
[    1.129773] sun4i-drm soc:display-engine: bound 1e00000.display-frontend (ops 0xc073b3d8)
[    1.138826] sun4i-drm soc:display-engine: bound 1e60000.display-backend (ops 0xc073ac18)
[    1.148455] sun4i-drm soc:display-engine: bound 1c0c000.lcd-controller (ops 0xc07397b8)
[    1.157047] sun4i-drm soc:display-engine: bound 1c0a000.tv-encoder (ops 0xc073a4d8)
[    1.164830] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    1.171433] [drm] No driver support for vblank timestamp query.
[    1.179132] [drm] Initialized sun4i-drm 1.0.0 20150629 for soc:display-engine on minor 0
[    1.188155] [drm] kms: can't enable cloning when we probably wanted to.
[    1.260030] Console: switching to colour frame buffer device 100x30
[    1.298895] sun4i-drm soc:display-engine: fb0: sun4i-drmdrmfb frame buffer device
[    1.307504] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    1.325350] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    1.332106] ALSA device list:
[    1.335215]   #0: F1C100s Audio Codec
[    1.339474] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    1.348199] cfg80211: failed to load regulatory.db
[    1.353779] Waiting for root device /dev/mtdblock3...
[    2.192602] random: fast init done
[   31.842658] vcc3v0: disabling
[   31.845659] vcc3v3: disabling
[   31.848629] vcc5v0: disabling
[  182.492753] random: crng init done

spi nand 没烧成功,系统也不能启动到shell, 请问楼主这是什么问题呢?

#9 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 这种 15寸LVDS液晶的驱动板有没有朋友用过? » 2020-08-21 15:38:35

哇酷小二 说:

座子型号应该是这个: DF14-20P

这个价格也是够贵的

对, 座子应该是 DF14-20P-1.25H:   https://item.taobao.com/item.htm?id=533173896475

线材可以选这个:

https://item.taobao.com/item.htm?id=534106025895

https://item.taobao.com/item.htm?id=534056571660

如果要两头一样的接口, 可以多买几根, 自己动手改一下,定做的费用比较贵。



这种不通用的线, 价格就比较贵了: https://item.taobao.com/item.htm?id=38784822241

#10 Re: 全志 SOC » 各位大神荔枝派zero v3s怎么接 1024*600那种LVDS屏? » 2020-08-21 14:59:49

奇怪,为什么大家都喜欢在板用30PIN那接口呢?而不是20PIN紧致的接口。

#11 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 这种 15寸LVDS液晶的驱动板有没有朋友用过? » 2020-08-21 14:11:41

QQ图片20200821140811.jpg



液晶和驱动板都买了, 接上电脑驱动正常, 液晶角度还行, 这个15寸液晶用在工业控制面板上面霸气!

#12 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 这种 15寸LVDS液晶的驱动板有没有朋友用过? » 2020-08-17 18:27:13

arychen 说:

用过很多,类似的板子很多。
很多广告机/显示器用的这类板子
支持双lvds的小板子有更便宜的店有卖的。

大神你好, 求淘宝连接.

#18 Re: 全志 SOC » 怎么把f1c200s Linux 默认串口控制台改到 UART1 » 2020-08-09 16:54:13

unturned3 说:

我试着 echo hello > /dev/ttyS1,不过报错说 read/write error,这应该是说明ttyS1没配置好?
这个怎么配置呢

配置 dts, 本站有帖子

#21 Re: 全志 SOC » 16mflash不够用了,该选择SD内存卡还是更大flash » 2020-08-08 16:46:08

嵌入式冲 说:

这个是256M是吧?慢就慢点,几块钱一个,我买来试试,然后需要在原来代码基础上改的东西多吗,是不是在设备树改一下就行

256Mb = 32MB

基本不用改, u-boot / kernel 已经根据flash id都处理好了.

#22 Re: 全志 SOC » rtthread+littlevGL7.1+F1C1/200S + 荔枝派Linux填坑指南 » 2020-08-08 16:19:56

楼主优秀!gitee好评, 等有时间把吃灰的板子找出来玩玩。。。

#24 Re: 计算机图形/GUI/RTOS/FileSystem/OpenGL/DirectX/SDL2 » 请教各位, LVGL 无法显示汉字 » 2020-08-07 22:38:36

如果字符串里面有某些汉字, 比如 "流", 即使按楼上的操作, 还是有可能出现编译错误,

1>\system_main.c(81): error C2001: 常量中有换行符
1>\system_main.c(82): error C2143: 语法错误: 缺少“)”(在“}”的前面)
1>\system_main.c(90): error C2065: “t”: 未声明的标识符
1>\system_main.c(90): warning C4047: “函数”:“lv_task_t *”与“int”的间接级别不同
1>\system_main.c(90): warning C4024: “lv_task_ready”: 形参和实参 1 的类型不同
1>\system_main.c(674): warning C4018: “>”: 有符号/无符号不匹配



解决办法:

在字符串最后加 \0 即可, 如

lv_label_set_text(label1, "流\0");

#28 Re: 全志 SOC » 自闭littlevgl v7版本,在某句话出现段错误 » 2020-07-15 22:47:38

嵌入式冲 说:

搞定了,现在遇到新问题,为什么ts_calibrate运行没有什么反应,正常应该会打印数据吧,ts_test有打印数据,那应该我tslib移植没问题吧

前面是什么问题?

把环境变量都手动指定试一试: https://whycan.cn/t_3400.html#p30192

#30 Re: 全志 SOC » 自闭littlevgl v7版本,在某句话出现段错误 » 2020-07-15 21:33:35

大概率是指针非法问题, 单步调试, 或者把指针值打印出来看看.

#31 Re: 全志 SOC » buildroot 与busybox » 2020-07-15 21:20:56

我思故我在 说:

make busybox-menuconfig

或者直接修改这个文件:    output/build/busybox-1.31.0/.config

众里寻他千百度,终于找到了你, 感谢分享.

顺便记录一下这个帖子: https://whycan.cn/t_2921.html#p46106

#32 Re: VMWare/Linux/Ubuntu/Fedora/CentOS/U-BOOT » 开帖记录一些实用的操作,以免忘记。 第一个生成指定大小填充指定内容(如0xFF)的bash命令行/修改指定位置的内容 » 2020-06-29 10:07:48

C代码监控网络状态 (network interface create/delete/up/down events)

netlink_test.c:

#include <asm/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <net/if.h>
#include <netinet/in.h>
 
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
 
#define MYPROTO NETLINK_ROUTE
#define MYMGRP RTMGRP_IPV4_ROUTE
 
int open_netlink()
{
    int sock = socket(AF_NETLINK,SOCK_RAW,MYPROTO);
    struct sockaddr_nl addr;

    memset((void *)&addr, 0, sizeof(addr));

    if (sock<0)
        return sock;
    addr.nl_family = AF_NETLINK;
    addr.nl_pid = getpid();
    addr.nl_groups = RTMGRP_LINK|RTMGRP_IPV4_IFADDR|RTMGRP_IPV6_IFADDR;
//    addr.nl_groups = RTMGRP_LINK;
    if (bind(sock,(struct sockaddr *)&addr,sizeof(addr))<0)
        return -1;
    return sock;
}
 

int read_event(int sockint, int (*msg_handler)(struct sockaddr_nl *,
                                               struct nlmsghdr *))
{
    int status;
    int ret = 0;
    char buf[4096];
    struct iovec iov = { buf, sizeof buf };
    struct sockaddr_nl snl;
    struct msghdr msg = { (void*)&snl, sizeof snl, &iov, 1, NULL, 0, 0};
    struct nlmsghdr *h;
    
    status = recvmsg(sockint, &msg, 0);

    if(status < 0)
    {
        /* Socket non-blocking so bail out once we have read everything */
        if (errno == EWOULDBLOCK || errno == EAGAIN)
            return ret;

        /* Anything else is an error */
        printf("read_netlink: Error recvmsg: %d\n", status);
        perror("read_netlink: Error: ");
        return status;
    }
        
    if(status == 0)
    {
        printf("read_netlink: EOF\n");
    }

    /* We need to handle more than one message per 'recvmsg' */
    for(h = (struct nlmsghdr *) buf; NLMSG_OK (h, (unsigned int)status); 
    h = NLMSG_NEXT (h, status))
    {
        /* Finish reading */
        if (h->nlmsg_type == NLMSG_DONE)
            return ret;

        /* Message is some kind of error */
        if (h->nlmsg_type == NLMSG_ERROR)
        {
            printf("read_netlink: Message is an error - decode TBD\n");
            return -1; // Error
        }

        /* Call message handler */
        if(msg_handler)
        {
            ret = (*msg_handler)(&snl, h);
            if(ret < 0)
            {
                printf("read_netlink: Message hander error %d\n", ret);
                return ret;
            }
        }
        else
        {
            printf("read_netlink: Error NULL message handler\n");
            return -1;
        }
    }



    return ret;
}

static int netlink_link_state(struct sockaddr_nl *nl, struct nlmsghdr *msg)
{
    int len;
    struct ifinfomsg *ifi;

    nl = nl;

    ifi = NLMSG_DATA(msg);

    printf("netlink_link_state: Link %s\n", 
           (ifi->ifi_flags & IFF_RUNNING)?"Up":"Down");
//    printf("netlink_link_state: family: %d\n", ifi->ifi_family);
//    if(ifi->ifi_family == AF_INET)
//    {
//         printf("Link index: %d Flags: (0x%x) ", 
//                ifi->ifi_index, ifi->ifi_flags);
//         if(ifi->ifi_flags & IFF_UP)
//             printf("IFF_UP ");
//         if(ifi->ifi_flags & IFF_BROADCAST)
//             printf("IFF_BROADCAST ");
//         if(ifi->ifi_flags & IFF_DEBUG)
//             printf("IFF_DEBUG ");
//         if(ifi->ifi_flags & IFF_LOOPBACK)
//             printf("IFF_LOOPBACK ");
//         if(ifi->ifi_flags & IFF_POINTOPOINT)
//             printf("IFF_POINTOPOINT ");
//         if(ifi->ifi_flags & IFF_NOTRAILERS)
//             printf("IFF_NOTRAILERS ");
//         if(ifi->ifi_flags & IFF_RUNNING)
//             printf("IFF_RUNNING ");
//         if(ifi->ifi_flags & IFF_NOARP)
//             printf("IFF_NOARP ");
//         if(ifi->ifi_flags & IFF_PROMISC)
//             printf("IFF_PROMISC ");
//         if(ifi->ifi_flags & IFF_ALLMULTI)
//             printf("IFF_ALLMULTI ");
//         if(ifi->ifi_flags & IFF_MASTER)
//             printf("IFF_MASTER ");
//         if(ifi->ifi_flags & IFF_SLAVE)
//             printf("IFF_SLAVE ");
//         if(ifi->ifi_flags & IFF_MULTICAST)
//             printf("IFF_MULTICAST ");
//         if(ifi->ifi_flags & IFF_PORTSEL)
//             printf("IFF_PORTSEL ");
//         if(ifi->ifi_flags & IFF_AUTOMEDIA)
//             printf("IFF_AUTOMEDIA ");
//         printf("\n");        
//    }
    return 0;
}

static int msg_handler(struct sockaddr_nl *nl, struct nlmsghdr *msg)
{
    switch (msg->nlmsg_type)
    {
        case RTM_NEWADDR:
            printf("msg_handler: RTM_NEWADDR\n");
            break;
        case RTM_DELADDR:
            printf("msg_handler: RTM_DELADDR\n");
            break;
        case RTM_NEWROUTE:
            printf("msg_handler: RTM_NEWROUTE\n");
            break;
        case RTM_DELROUTE:
            printf("msg_handler: RTM_DELROUTE\n");
            break;
        case RTM_NEWLINK:
            printf("msg_handler: RTM_NEWLINK\n");
            netlink_link_state(nl, msg);
            break;
        case RTM_DELLINK:
            printf("msg_handler: RTM_DELLINK\n");
            break;
        default:
            printf("msg_handler: Unknown netlink nlmsg_type %d\n",
                   msg->nlmsg_type);
            break;
    }
    return 0;
}


int main(int argc, char *argv[])
{
    int nls = open_netlink();

    printf("Started watching:\n");
    if (nls<0) {
        printf("Open Error!");
    }

    while (1)
        read_event(nls, msg_handler);
    return 0;
}

https://stackoverflow.com/questions/27008067/how-to-get-notified-about-network-interface-changes-with-netlist-and-rtmgrp-link

https://stackoverflow.com/questions/7225888/how-can-i-monitor-the-nic-statusup-down-in-a-c-program-without-polling-the-ker

https://www.mail-archive.com/davinci-linux-open-source@linux.davincidsp.com/msg05405/netlink_test.c

#33 Re: VMWare/Linux/Ubuntu/Fedora/CentOS/U-BOOT » 开帖记录一些实用的操作,以免忘记。 第一个生成指定大小填充指定内容(如0xFF)的bash命令行/修改指定位置的内容 » 2020-06-29 09:08:24

linux下监控网卡流量的shell脚本: https://blog.51cto.com/erikxue/1588802

#!/bin/sh

usage() {
        echo "Useage : $0"
        echo "eg. sh $0 eth0 2"
        exit 1
}

if [ $# -lt 2 ]
then
        usage
fi

eth=$1
timer=$2

in_old=$(cat /proc/net/dev | grep $eth | sed -e "s/\(.*\)\:\(.*\)/\2/g" | awk '{print $1 }')
out_old=$(cat /proc/net/dev | grep $eth | sed -e "s/\(.*\)\:\(.*\)/\2/g" | awk '{print $9 }')

while true
do
        sleep ${timer}
        in=$(cat /proc/net/dev | grep $eth | sed -e "s/\(.*\)\:\(.*\)/\2/g" | awk '{print $1 }')
        out=$(cat /proc/net/dev | grep $eth | sed -e "s/\(.*\)\:\(.*\)/\2/g" | awk '{print $9 }')
        dif_in=$(((in-in_old)/timer))
        dif_in=$((dif_in/1024))
        dif_out=$(((out-out_old)/timer))
        dif_out=$((dif_out/1024))
        ct=$(date +"%F %H:%M:%S")
        echo "${ct} -- IN: ${dif_in} KByte/s     OUT: ${dif_out} KByte/s"
        in_old=${in}
        out_old=${out}
done

exit 0

测试运行:

# ./network_speed.sh wlan0 2
1970-01-01 00:31:23 -- IN: 0 KByte/s     OUT: 0 KByte/s
1970-01-01 00:31:25 -- IN: 6 KByte/s     OUT: 5 KByte/s
1970-01-01 00:31:27 -- IN: 2 KByte/s     OUT: 0 KByte/s
1970-01-01 00:31:30 -- IN: 3 KByte/s     OUT: 1 KByte/s
1970-01-01 00:31:32 -- IN: 19 KByte/s     OUT: 20 KByte/s
1970-01-01 00:31:34 -- IN: 14 KByte/s     OUT: 10 KByte/s

#34 Re: VMWare/Linux/Ubuntu/Fedora/CentOS/U-BOOT » 开帖记录一些实用的操作,以免忘记。 第一个生成指定大小填充指定内容(如0xFF)的bash命令行/修改指定位置的内容 » 2020-06-29 09:04:13

Linux下Mount TF卡Image文件: https://whycan.cn/t_4401.html


fdisk -l whatever.img

Device         Boot     Start       End  Blocks  Id System
whatever.img1            8192    122879   57344   c W95 FAT32 (LBA)
whatever.img2          122880   5785599 2831360  83 Linux

计算偏移:
1st partition 512 * 8192 = 4194304
2nd partition 512 * 122880 = 62914560

挂载:

mount -v -o offset=4194304 -t vfat whatever.img /mnt/img/one
mount -v -o offset=62914560 -t ext4 whatever.img /mnt/img/two

#35 Re: VMWare/Linux/Ubuntu/Fedora/CentOS/U-BOOT » 开帖记录一些实用的操作,以免忘记。 第一个生成指定大小填充指定内容(如0xFF)的bash命令行/修改指定位置的内容 » 2020-06-27 08:42:48

buildroot 重新生成 output/target 文件系统:

rm output/target -rf
find output/build/ |grep \\.stamp_target_installed$ | xargs rm -rf
make


buildroot 重新编译:

find output/build/ |grep \\.stamp_ | xargs rm -rf
make

#37 Re: 全志 SOC » F1C200S扩展USB » 2020-06-25 16:47:22

用开发板外接一个USB HUB 先试一试.

#44 全志 SOC » insmod r8723bs.ko 之后 ifconfig wlan0 up 出现 SIOCSIFFLAGS 错误,请问这是为什么? » 2020-06-15 16:54:17

起个名字好难
回复: 0
# insmod r8723bs.ko
[  868.369355] r8723bs: module is from the staging directory, the quality is unknown, you have been warned.
[  868.391839] RTL8723BS: module init start
[  868.395807] RTL8723BS: rtl8723bs v4.3.5.5_12290.20140916_BTCOEX20140507-4E40
[  868.403026] RTL8723BS: rtl8723bs BT-Coex version = BTCOEX20140507-4E40
[  868.425505] pnetdev = c1e16000
[  870.760887] RTL8723BS: rtw_ndev_init(wlan0)
[  870.819860] RTL8723BS: module init ret =0
#
#
#
# ifconfig wlan0 up
ifconfig: SIOCSIFFLAGS: Operation not permitted
#
#

#46 Re: VMWare/Linux/Ubuntu/Fedora/CentOS/U-BOOT » 开帖记录一些实用的操作,以免忘记。 第一个生成指定大小填充指定内容(如0xFF)的bash命令行/修改指定位置的内容 » 2020-06-09 15:11:06

metro 说:

WinHex可以先新建一个指定大小的空白文件,再用Edit->Fill Block填充十六进制数字。

感谢大佬指教, 有空我试一试。


再来一个, 查看linux可执行程序依赖哪些so文件:

objdump -x output/target/usr/sbin/dnsmasq |grep NEEDED
  NEEDED               libc.so.0

#48 Re: 全志 SOC » 怎么进入 sunxi-fel 模式,是通过 usb 线吗? » 2020-06-04 23:39:02

W25Q128 如果携带了 boot0(u-boot),

那么需要短路 spi-cs & gnd,

才能强制进入 usb fel

#49 Re: 全志 SOC » V3s裸机usb otg host枚举成功,读数据异常 » 2020-06-04 21:49:04

hoel 说:

哦,我已经检查了NXP堆栈,但是低级驱动程序仅适用于它似乎所用的Kinnetis平台,我不明白它们如何实现以适应F1C100S。 为什么其他网民在这种集体努力中没有帮助? 我不是唯一希望在F1C100S上使用裸机USB HOST堆栈的人

不知道你有没有"挤"过中国的公交车?

这个问题有点像挤公交车, 车还没来的时候盼着车快点到站,

要是上车了, 就想着快点关车门, 甚至恨不得把车门焊死.

哈哈哈哈.gif

#50 Re: 全志 SOC » V3s裸机usb otg host枚举成功,读数据异常 » 2020-06-04 21:42:16

hoel 说:

我见过这个uboot,问题是将u-boot的USB堆栈移植到裸机似乎很难实现,但是是的,这是目标。
我认为第一步是使U-boot与F1C100S的USB配合使用。 有人做到了吗? 我已经在F1C100S上尝试过USB引导V3S的u-boot,但它当然不起作用

本站有好几个网友都实现了, 但是没有open source,

我记得有网友用的是 NXP 的 USB HOST 协议栈?

#51 Re: 全志 SOC » V3s裸机usb otg host枚举成功,读数据异常 » 2020-06-04 21:35:21

hoel 说:

您可以分享您的代码吗? 也许会有助于集体的努力

u-boot 支持 S3/V3s 的 usb 吧, 或许可以从 u-boot 扣代码?

#52 Re: 硬件设计 KiCAD/Protel/DXP/PADS/ORCAD/EAGLE » winget install kicad » 2020-05-22 23:00:54

牛, 真羡慕开源软件这种合作方式, 一言不合就提交pull request打补丁.

#57 VMWare/Linux/Ubuntu/Fedora/CentOS/U-BOOT » 开帖记录一些实用的操作,以免忘记。 第一个生成指定大小填充指定内容(如0xFF)的bash命令行/修改指定位置的内容 » 2020-05-19 11:12:35

起个名字好难
回复: 9

生成指定大小填充指定内容(如0xFF)的bash命令行/修改指定位置的内容

dd if=/dev/zero bs=1 count=$((0x3800)) | sed 's/\x00/\xFF/g' > 1.bin

dd if=/dev/zero bs=1 count=$((0x3800)) | tr '\000' '\377' > 2.bin

0x3800 是文件大小, xFF / 377 是指定填充的字节。

上面两种方法都可以,二选一, 我喜欢前面的。




dd if=out.bin of=dest.bin seek=0 conv=notrunc

out.bin 文件叠加到 dest.bin




echo -e '\x50\x52' | dd of=dest.bin bs=1 seek=$((0x3780)) count=2 conv=notrunc

修改0x3780位置2字节为 0x50, 0x52

#60 Re: 全志 SOC » 分享Nano fc100s linux主线5.2(TF卡)+adb+lcd(800*480)+qt5的编译过程 » 2020-05-10 17:30:30

zwanh 说:

是按照我说的这样编译吗?因为我就是在5.2-tf分支上进行编译的,但是默认不编译出dtb

可以手动编译出来的.


如果你的 dts 文件是 xyz.dts

那么编译指令是

ARCH=arm CROSS_COMPILE=xxxxx make xyz.dtb

#61 Re: 全志 SOC » 各位大佬,f1c100s和ea3036手工焊接有什么方法技巧吗? » 2020-05-10 17:29:04

QFN封装的f1c100s焊接比TQFP的V3s更好焊接,

1. 你需要好的工具, 936恒温烙铁(用刀头)和有铅焊锡, 用一点点锡固定好位置, 然后拖焊.

2. 焊盘上锡用热风枪吹, 轻轻用镊子推动,由于液态锡的张力作用会拉回合适的位置.

3. 可以去bilibili看大佬们的焊接视频.

#62 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 在芯间推出 满200元减100元 SMT优惠券, 支持全贴/寄料, 有需要可以注册/领券 » 2020-05-09 10:07:21

看起来不错哦,

刚刚试了一下下单流程


2020-05-09_100427.png

明明选 DIP直插 选择 无

再  直插清洗 点 不清洗

会提示错误:  请选择有DIP直插后选择直插清洗


这是 bug 吗?

#67 Re: 全志 SOC » 学习的路上,真是山重水复疑无路,望各路大神指点一下,看是哪没弄好导致i2c没驱动起来?f1c200s实验板 » 2020-04-26 10:27:57

开发板可以烧这个固件试一试: https://whycan.cn/t_3206.html

里面有 ns2009 驱动, i2c至少有反应的.

最好还是能接逻辑分析仪, 很直观的.

#68 Re: 全志 SOC » V3S 串口问题 » 2020-04-22 20:00:36

什么波特率? 要不要对手册看下误码率?

#69 Re: 全志 SOC » 超迷你TINY 200点屏测试固件 » 2020-04-19 22:52:08

幽光 说:

下不了

看错误提示, 认真回复, 别回一些不痛不痒的就行.

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn