Linux主机和VirtualBox之间实现串口通信

Python与numpy版本兼容性排查指南 本文详细解析了Python与numpy版本兼容性问题,提供了快速诊断和解决版本冲突的实用方法。通过查看版本信息、使用官方兼容性对照表以及降级或升级环境等方案,帮助开发者有效避免常见的报错问题,如'ImportError'和'AttributeError'。文章还介绍了使用虚拟环境和requirements.txt等工程实践,确保项目依赖的稳定性。 阅读详情

Linux相关开发工作中,经常会用到串口,特别是嵌入式开发领域的,串口通信一般是必不可少的。同时,它也是双机调试(如KGDB)的主要通信渠道。

这里以VirtualBox虚拟机和Linux主机之间实现虚拟串口通信。

环境:

  • HOST:Deepin 15.2 AMD_64
  • Guest OS: Ubuntu 14.04.3 AMD_64

设置虚拟串口

VirtualBox的虚拟串口是以命名管道方式实现的,虚拟串口一般对应虚拟机里的/dev/ttyS0 ,另一端就对应主机上的一个命名管道。在主机上,只需要对该命名管道进行操作即可实现对虚拟机的串口通信了。

这里需要在主机上安装socat来进行连接命名管道,实现串口通信。

sudo apt-get install socat

如下图,在该虚拟机属性里设置串口

这里写图片描述
注:在启动虚拟机后,便会产生vmserial命名管道文件。

测试虚拟串口

在主机和虚拟机上都安装minicom,minicom是用来操作串口的工具。

sudo apt-get install minicom

配置minicom

若HOST上没有/etc/minicom/minirc.dfl文件,则运行下面指令生成该配置文件。若已存在,则保持内容与下面相同即可。

2026年OPPO嵌入式岗位面试题带详细答案 本文总结了OPPO嵌入式岗位面试的核心考点,涵盖硬件驱动、系统启动、Linux内核开发等7大模块共34道典型题目。重点解析了SPI通信协议、中断处理、U-Boot启动流程、Linux驱动开发等关键技术,突出硬件调试与工程实践能力考核。题目设置贴合实际岗位需求,适合校招与社招驱动开发岗位应聘者系统复习,帮助掌握嵌入式开发的核心知识与面试要点。 阅读详情

相关推荐

128x64 OLED屏的救星:手把手教你用纯C实现轻量级多级菜单

本文针对资源受限的单片机开发场景,提供了一套用纯C语言实现128x64 OLED屏轻量级多级菜单的完整方案。该方案摒弃了传统的树形指针结构,创新性地采用哈希表进行菜单项管理,核心代码不足200行,内存占用极低,逻辑清晰且易于维护。文章详细阐述了架构设计、实战演练及性能优化技巧,是STM32、ESP8266等小内存MCU项目的理想选择。

table的专栏 226

PCIE6.0协议学习小记-Flit_Mode

PCIE6.0学习

code_aJack的博客 4631

IT运维必备 开源Urbackup 备份系统部署教程 实战操作

手动添加ip方式检查是否在线 ,linux需要按上述步骤6配置server端地址 不然一直不会进去状态栏。安装依赖sudo apt install -y libcrypto++-dev。补充客户端手动触发备份命令 (一般在服务端操作即可,特殊情况客户端进行操作)修改ubuntu主机名 建议修改为ip 方便上线以ip命名上线。默认客户端安装完毕大概几分钟之内服务端会自动上线。配置客户端指向server端地址。(2)ubuntu 客户端设置。新起一个远程窗口查看配置状态,配置客户端备份文件目录。

qq_34981755的博客 1278

VCSA的vmware-updatemgr服务无法启动和vSAN界面报“certificate chain is not trusted and thumbprint doesn‘t match”处理

"Unable to update CM service info"和"Server certificate chain is not trusted and thumbprint doesn't match"问题处理

jetliu05的博客 1882

从零到一:KUKA机械臂与ROS的工业级通讯协议深度解析

本文深度解析KUKA机械臂与ROS的工业级通讯协议,重点对比EKI与RSI两种核心接口的技术特点与应用场景。详细介绍了网络架构设计、数据包解析机制及ROS-I集成方法,并提供实时性能优化与故障排除策略,为工程师实现高可靠性工业自动化集成提供完整解决方案。

2a4s6d8f0g的博客 296

C 语言多文件编程 : 大型程序的组织与管理

本文介绍了C语言多文件编程的核心概念与实践方法。主要内容包括:1. 多文件编程的必要性:解决单文件编程在大型项目中的维护和协作问题;2. 文件组织方式:头文件(.h)负责声明接口,源文件(.c)实现具体功能;3. 编译链接过程:分阶段编译和链接多个源文件;4. 头文件设计原则:包含接口声明、使用保护机制、保持自包含性;5. 模块化实践:通过示例展示学生信息管理系统的模块划分;6. 构建工具:介绍Makefile的编写和使用方法。文章还提供了创建静态库和动态库的指导,并强调了模块化设计、信息隐藏等软件工程原则

2503_91057718的博客 1945

【人工智能】国产开源大模型聊天 AquilaChat 快速开始上手实战&效果评测

Aquila语言大模型在技术上继承了GPT-3、LLaMA等的架构设计优点,替换了一批更高效的底层算子实现、重新设计实现了中英双语的tokenizer,升级了BMTrain并行训练方法,在Aquila的训练过程中实现了比Magtron+DeepSpeed zero-2将近8倍的训练效率。Aquila语言大模型是在中英文高质量语料基础上从0开始训练的,通过数据质量的控制、多种训练的优化方法,实现在更小的数据集、更短的训练时间,获得比其它开源模型更优的性能。

AI天才研究院 2万+

【学习系列】SAP RAP 29:如何创建Application Jobs(下)

本文介绍了在SAP系统中通过API创建和使用Application Jobs的方法。主要内容包括:1) 创建RAP应用并通过Action调用API创建Jobs;2) 使用事件驱动方式异步更新Job状态;3) 通过URL跳转到标准日志页面;4) 使用Custom Entity获取Job日志;5) 演示遗留接口IF_APJ_DT_EXEC_OBJECT和IF_APJ_RT_EXEC_OBJECT的使用。文章提供了详细的代码示例,展示了如何通过CL_APJ_RT_API=>SCHEDULE_JOB调度作业,

DeveloperMrMeng的博客 373

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: tmpfs小结
下一篇: 通过KGDB进行双机Linux内核调试
Linux先生
博客等级 码龄20年 97粉丝 43原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值