基于RPi和LXD的ESP32开发环境

2022-11-22 作者:

对于在板子手动重启时经常把ESP32带进下载模式的问题,LAN8720所需的上/下拉电阻恐怕是最大嫌犯。于是斥巨资近CNY 10元采购了万用板、线仔包和各种直/弯母座,终于搞了MKII —— 重启可靠性问题果然迎刃而解。

过程中,基于lxd的Debian in Debian做了套新环境,顺手也试了试C语言的esp-idf编译,用起来整体感觉很顺手。

RS232 connected with an lxc in raspberry pi 4b (not in pic)

Yes, it actually performs nicely to work on ESP32 development in debian bullseye LXD in Pi OS, no mater you’re working on hardcore C lang based esp-idf or the nice & easy micropython development.

“Hmm… so you need a standard Debian in a derived Debian? “

Well, since I found out that LXD is something very helpful to isolate different needs on different Linux distributions in different containers, while it kinda works pretty much like vm (instead of docker) since it’s easy to config the resources consumption or even usb devices pass-through, and the most important – having its own block storage which can be exported into a single archive.
Then, the only thing I can’t agree with, could be the deep connection with the snapd. Instead of switching to another distribution, such as Arch, I choose to build the LXD of my own (on both Pi OS aarch64 and Ubuntu 22.04 X86_64). Thanks to the good documentation, the stuff (native lxd without the snap crxp) works like a charm.

with Xfce and xrdp, the bullseye lxc can work as an esp dev server quite well

Don’t worry if you’re a tough guy who’s working on esp-idf and RTOS stuff, another post already got you covered. The only difference here is what should be done are accomplished in the lxc.

“But how about the physical serial connection to the esp32 hardware?”

Well, good to know your needs again, now we can pass the  unix-char device directly from Pi OS to the lxc without any tiny issue.

pass serial connection from host to guest Debian

Cool to allow the lxc to consume all processor cores on esp32 code cross-compiling, while those packages installed for development are not in the host OS and can be easily removed by  lxc stop <ct_name> and  lxc delete <ct_name> with nothing left.

View the cpu consumption of lxc (guest) from host Pi OS

Anyway, my simple indoor weather station (MKII) now works well. It’s way much better than the MKI on bread board, special thanks to one more blog post that helps pretty much to me – just like others who where stuck by either the clock source or esp32 download mode issue.

Yep, mess but a working MKII

 

原创文章,转载请注明: 转载自渔人小径

本文链接地址: 基于RPi和LXD的ESP32开发环境

打赏 PayPal

文章的脚注信息由WordPress的wp-posturl插件自动生成

打赏 赞(0)
微信
支付宝
微信二维码图片

微信扫描二维码打赏

支付宝二维码图片

支付宝扫描二维码打赏

最近文章

分享

发表评论

电子邮件地址不会被公开。 必填项已用*标注