自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(232)
  • 收藏
  • 关注

原创 ubuntu下虚拟串口调试

调试

2023-02-06 11:02:45 495 1

原创 在x86和arm编译libmodbus

libmobus

2022-12-17 20:59:13 452

原创 线程间发布和订阅

#include <stdio.h>#include <malloc.h>#include <string.h>typedef unsigned char BOOL_T;typedef unsigned char U8_T;typedef signed char S8_T;typedef unsigned short U16_T;typedef signed short S16_T;type

2022-02-17 10:41:40 669

原创 修改qt pro文件适配x86和arm架构

外部.so库和相应头文件所在目录位置./x86_lib./arm_lib修改qt pro文件适配x86和arm架构TEMPLATE = appCONFIG += console c++11CONFIG -= app_bundleCONFIG -= qt#message("x86")#QT_ARCH是Qt5新增的,在Qt4上没效果#打印当前Qt构建套件的信息message($$QT_ARCH){}#表示arm平台构建套件contains(QT_ARCH, arm){win32

2022-01-22 13:02:32 197

原创 arm linux vsftpd 移植 以及vstftpd.conf配置

vstftpd.conf# Example config file /etc/vsftpd.conf## The default compiled in settings are fairly paranoid. This sample file# loosens things up a bit, to make the ftp daemon more usable.# Please see vsftpd.conf.5 for all compiled in defaults.## READ

2021-12-01 17:20:04 731

原创 tftp 开发板linux上传下载

(1)在Uboot下tftp上传下载操作:用处在uboot’下载内核、设备树文件tftp 0x80800000 zImage // 0x80800000在emmc里面内核写入读取地址tftp 0x83800000 100ask_imx6ull-14x14.dtb // 0x83800000 在emmc里面设备树写入读取地址1、下载 tftp addr file设置服务器ip地址setenv serverip 192.168.1.140saveenv // 保存设置下载 tftp 0x1

2021-11-18 09:12:03 550 1

原创 linux处理日志命令

1、#查找/home/vmuser/test下所有目录列表ls -F /home/vmuser/test | grep '/$'2、#把目录列表写入文件ls -F /home/vmuser/test | grep '/$' > log.txt3、#显示前几个文件列表tail -n 3 log.txt 4、#find linux 指定后缀_文件查找:find命令,文件名后缀find test/ -name "*.c" 5、连续执行多条命令popen("cd.. &&am

2021-11-08 22:46:54 565

原创 除了配置桥接还要ubuntu连外网编辑interfaces

sudo gedit /etc/network/interfaces# interfaces(5) file used by ifup(8) and ifdown(8)auto loiface lo inet loopbackauto ens33iface ens33 inet dhcp#address 192.168.1.137#netmask 255.255.255.0#gateway 192.168.1.1

2021-11-04 13:59:51 126

原创 时区设置 TZ设置

#查找含有/TZ=字符串的行并删除,添加新的TZ=""mount rw -o remount /sed -e ‘/TZ=/d’ /etc/profile > /etc/profile #/删除/etc/profile中含"/TZ="的行,将操作之后的结果保存到etc/profileecho “export TZ=‘Asia/Shanghai’” >> /etc/profilesource /etc/profilehwclock -s[root@EPC-M6G2C de]#

2021-10-26 14:22:18 1569

原创 linux socket 客户端不绑定端口号,系统自动分配端口

arm-linux-gnueabihf-gcc client_line.c Delay.c -o client -pthread./client 192.168.1.139 & // 不绑定端口号,系统自动分配./client 192.168.1.139#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/types.h>#include &lt

2021-09-11 20:55:21 1156

原创 linux socket客户端断线自动重连

arm-linux-gnueabihf-gcc client_line.c Delay.c -o client -pthread服务器ip 192.168.1.139 ./client 192.168.1.139#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/types.h>#include <sys/socket.h>#include

2021-09-11 16:04:33 1273

原创 linux socket客户端输出本地ip端口和远程ip端口信息,本地不绑定端口号

#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <unistd.h>#include <errno.h>#define S

2021-09-11 11:54:02 322

转载 Mac地址修改错误SIOCSIFHWADDR: Cannot assign requested address

Mac地址修改错误SIOCSIFHWADDR: Cannot assign requested address问题设置mac地址 11:22:33:44:55:66, 在OpenWrt正在开发的主trunk上就没有SIOCSIFHWADDR: Cannot assign requested address, 这个问题。但是到attitude adjustment最新的trunk上就出现了,估计是内核版本不同,导致都mac地址的限制不同导致。最新的反而不严格了?这个不科学啊。解决方法:http:/

2021-09-11 10:12:52 2985 2

原创 linux socket客户端简单测试程序

ubuntu编译:arm-linux-gnueabihf-gcc client_line.c -o client -pthread开发板运行:./client 192.168.1.139#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.

2021-09-11 10:04:42 170

原创 linux C语言设置网络ip和子网掩码

#include <netinet/in.h>#include <netinet/tcp.h> /* TCP_NODELAY */#include <unistd.h> /* for convenience */#include <limits.h>#include <time.h>#include <pwd.h>#include <signal.h> /* for SIG_ERR */#include &

2021-09-09 17:20:49 870

原创 实用数据处理

#include <stdio.h>typedef unsigned char BOOL_T; typedef unsigned char U8_T; typedef signed char S8_T; typedef unsigned short U16_T; typedef signed short S16_T; typedef unsigned int U32_T; typedef signe

2021-09-07 21:21:22 95

原创 buildroot 修改和保存xxx_defconfig make savedconfig错误解决

修改BR2_DEFCONFIG为自己对应的路径 gedit 100ask_imx6ull_defconfig找到BR2_DEFCONFIG,我的路径是:/home/book/Documents/imx6ul_buildroot/configs/imx6ulevk_defconfig## Commands#BR2_WGET="wget --passive-ftp -nd -t 3"BR2_SVN="svn --non-interactive"BR2_BZR="bzr"BR2_GIT="git"

2021-09-06 09:34:52 418

原创 imx6ull 网络根文件系统挂载

imx6ull 文件系统挂载1、解压文件系统不要原目录sudo tar jxvf rootfs.tar.bz2 -C /home/book/nfs_rootfs/2、设置从emmc启动setenv bootargs 'console=ttymxc0,115200 root=/dev/mmcblk1p2 rootwait rw'3、网络挂载nfs根文件系统setenv ethaddr 32:34:46:78:9A:DC setenv ipaddr 192.168.1.136setenv

2021-08-28 11:45:33 355

原创 当前及前几天按天统计、当前月及前几月按月统计

create table test( id integer PRIMARY KEY AUTOINCREMENT, time TEXT NOT NULL, mony REAL);insert into test (time, mony) values('2020-07-30 01:10:10', 100);insert into test (time, mony) values('2020-07-30 01:10:10', 120);i

2021-08-02 13:52:02 102

转载 SQLite的多个字段update语句

求一个SQLite的多个字段update语句假设a 表af1,af2,atypeb 表bf1,bf2,btype下面的语句可以执行update a set af1=(select bf1 from b where btype=a.atype);但是我想同时将af2也更新了怎么写?------解决方案--------------------update a set af1=(select bf1 from b where btype=a.atype),af2=(select bf2

2021-07-21 10:34:23 2297

转载 distinct跟group by 去掉重复数据分析 排序 + 分页 ( order by ) ( limit )

distinct和group by 去掉重复数据分析用distinct关键字只能过滤查询字段中所有记录相同的(记录集相同),而如果要指定一个字段却没有效果,另外distinct关键字会排序 。select distinct name from t1 能消除重复记录,但只能取一个字段,现在要同时取id,name这2个字段的值。select distinct id,name from t1 可以取多个字段,但只能消除这2个字段值全部相同的记录所以用distinct达不到想要的效果,用group by 可

2021-07-16 13:57:12 1422

原创 阿里sdk 回调机制例子

#include <stdio.h>typedef enum { ITE_STATE_EVERYTHING, ITE_STATE_DEV_MODEL}EVEN_E;typedef struct { int eventid; void *callback;} impl_event_map_t;static impl_event_map_t g_impl_event_map[] = { {ITE_STATE_EVERYTHING, NULL},

2021-07-11 10:41:52 241

转载 获取Linux本地IP信息

#include<stdlib.h> #include<stdio.h> #include<unistd.h> #include<net/if.h> #include<net/if_arp.h> #include<arpa/inet.h> #include<sys/ioctl.h> #include<errno.h> #include <string.h> //

2021-07-07 23:08:55 110

转载 Linux下利用backtrace追踪函数调用堆栈以及定位段错误

gcc -g -rdynamic main.c -o test#include <stdio.h>#include <stdlib.h>#include <stddef.h>#include <execinfo.h>#include <signal.h>void dump(int signo){ void *buffer[100] = {0}; size_t size; char **strings = NULL; i.

2021-07-03 17:35:01 182

原创 扫描指定文件夹下的所有文件

#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <dirent.h>#include <string.h>#include <sys/stat.h> char buff[512]; void print_dir(char *path, int depth){ struct dirent **name_list; int

2021-06-24 18:15:08 1116

原创 linux杀所有指定进程脚本

#!/bin/bash#杀main1ps aux | grep "main1" |grep -v grep| cut -c 9-15 | xargs kill -9if [ $? -eq 0 ];then echo "main1 is kill"else echo "main1 not exit"fi#杀main2ps aux | grep "main2" |grep -v grep| cut -c 9-15 | xargs kill -9if [ $? -eq 0

2021-06-09 09:12:45 144

转载 查看开发板是否支持使用POSIX 消息队列

msq_open打开失败:失败原因:mq_open: Function not implemented底层还不支持posix的消息队列。解决方法:让内核支持posix消息队列make menuconfigGeneral setup —> [ ] POSIX Message Queues -> [*] POSIX Message Queues ...

2021-05-08 16:46:40 667

原创 linux 进程通信共享内存+互斥锁

编译: gcc main1.c -o main1 -lpthread -lrt #include <sys/mman.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/wait.h> #include <pthread.

2021-05-08 10:50:48 392 3

原创 system V信号量用于线程互斥

#include <stdio.h>#include <sys/types.h>#include <sys/ipc.h>#include <sys/sem.h>#include <errno.h>#include <stdlib.h>#include <semaphore.h>#include <unistd.h>#include <pthread.h>union semun{

2021-05-07 17:59:44 78

原创 消息队列用于故障记录

编译:gcc progress2.c -o progress1 -lpthread -lrt#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <sys/ipc.h>#include <sys/types.h>#include <sys/msg.h>#include <unistd.h

2021-04-30 10:59:30 73

原创 open权限说明

int open(const char *pathname, int flags); 功能:打开文件 pathname:文件的路径 flags:打开的权限 O_RDONLY, 只读 O_WRONLY, 只写 O_RDWR, 读写 O_NOCTTY, 当打开的是终端设备文件,不要把该文件当作主控终端。 O_TRUNC, 清空 O_APPEND, 追加 返回值:成功则返回打..

2021-04-29 18:09:08 891

原创 用两个消息对列实现线程发送接收消息队列通信

#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <sys/ipc.h>#include <sys/types.h>#include <sys/msg.h>#include <unistd.h>#include <pthread.h>#define TYPE_A 1

2021-04-29 10:33:28 184

原创 linu单独编译设备树

在根目录下打开终端指定ARCH、CROSS_COMPILE、PATHexport ARCH=arm export CROSS_COMPILE=arm-linux-gnueabihf-export PATH=$PATH:/opt/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin编译设备树make dtbs V=1

2021-04-27 22:48:46 426

原创 结构体变量位域使用技巧

#include <stdio.h>/* 位域定义 */typedef struct{ unsigned char value1 : 1;/* 1bit */ unsigned char value2 : 1;/* 1bit */ unsigned char value3 : 1;/* 1bit */ unsigned char value4 : 1;/* 1bit */ unsigned char value5 : 1;/* 1bit */ unsigned char val

2021-04-12 10:14:53 227

原创 Linux设备树 pinctrl-names状态

pinctrl-names = "default"; “sleep”状态,“default”状态,“idle”状态三种状态

2021-03-24 22:03:11 3285

原创 stm32Cube学习资料整理

1、stm32CubeMx 入门教程以及开源项目2、【小蜜蜂笔记】基于STM32CubeMX的嵌入式开发基础教程3、[原创] STM32CubeMX入门教程汇总贴

2021-03-03 15:47:38 158 2

转载 modbus协议解析

modbus协议解析全解.doc 13页

2021-03-01 16:32:40 181

转载 STM32 ADC多通道转换DMA模式与非DMA模式两种方法

STM32 ADC多通道转换DMA模式与非DMA模式两种方法(HAL库)

2021-02-24 14:43:37 504

转载 stm32修改主频和时钟源

[F1开发板通用] STM32F103使用库函数如何修改外部晶振频率?如何修改主频

2021-02-20 11:37:01 1748

原创 stm32 uv5打开uv4工程错误

1、uv5打开uv4工程出现以下错误,要安装uv4转uv5支持包和芯片支持包2、解决方法(1)uv4转uv5工程支持包(2)芯片支持包Keil.STM32F1xx_DFP.2.3.0.pack

2021-02-02 22:30:05 1302

充电桩原理,新能源充电桩原理整理

充电桩原理,新能源充电桩原理整理

2023-08-10

occp1.6欧标协议标准规范大全,比较详细

occp1.6欧标协议标准规范大全,比较详细

2023-08-10

硬件工程师笔试复习,面试时候看看

硬件工程师笔试复习,面试时候看看

2023-08-10

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除