搜索
查看: 5455|回复: 1

[原创] 【LittlevGL LInux PC模拟器运行】

[复制链接]

该用户从未签到

37

主题

2167

帖子

32

蝴蝶豆

论坛元老

最后登录
2023-2-9
发表于 2018-5-30 15:03:43 | 显示全部楼层 |阅读模式
本帖最后由 andeyqi 于 2018-6-1 11:09 编辑

闲逛论坛的时候,看到坛友分享的LittlevGL开源gui,初步了解该GUI可以再ST平台上运行,无奈现在手头没有带屛的开发板,即使没有硬件资源,但是无法阻挠继续下去的热情,有样东西叫模拟器,根据github的项目描述,作者已经实现了在模拟器上的运行,先在模拟器上搞下,有开发板时在板子上跑下。以下是github的关于模拟器的描述


PC project for LittleV Graphics Library
The Littlev Graphic Library is written mainly for microcontrollers and embedded systems however you can run the library on your PC as well without any embedded hardware. The code written on PC can be simply copied when your are using an embedded system.
Using a PC simulator instead of an embedded hardware has got several advantages:
  • Costs $0 because you you don't have to buy design PCB
  • Fast because you don't have to design an manufacture PCB
  • Collaborative because any number of developers can work without hardware requirements
  • Developer friendly because much easier and faster to debug on PC


认真观看github的描述,PC模拟器运行环境的搭建是很容易的,笔者按照搭建手顺半小时轻松搞定,成功运行起来,废话不多说了开启正文。

========================搭建从此处开启,以上当闲嗑处理===========================

本地Linux虚拟机环境UBUNTU16.04_64-bit
UsageGet the PC project
Clone the PC project and the related sub modules:
git clone http://github.com/littlevgl/proj_pc.gitcd proj_pcgit submodule update --init
or download it as zip here.
Install SDL
You can download SDL from http://www.libsdl.org/
On Linux you can install it via terminal:
  • Find the current version of SDL2: apt-cache search libsdl2 (e.g. libsdl2-2.0-0)
  • Install SDL2: sudo apt-get install libsdl2-2.0-0 (replace with the found version)
  • Install SDL2 development package: sudo apt-get install libsdl2-dev
  • If build essentials are not installed yet: sudo apt-get install build-essential
Install Eclipse CDT
Download and install Eclipse CDT from http://www.eclipse.org/cdt/
Import the PC simulator project
  • Open Eclipse CDT
  • Click File->Import and choose General->Existing project into Workspace
  • Browse the root directory of the project and click Finish
  • Build your project and run it
以上是官方的手册,
第一步是获取模拟器环境源码,
第二步安装依赖的SDL库,
第三步安装本地运行环境Eclipse,
第四步Eclikpse导入工程。

第一步是用git下载源码,安装过程中本着一个原则就可以,提示没有什么就安装什么就行。

ubuntu 使用熟悉的 sudo apt-get install XXX 就可以,安装的过程中出了以上设计的安装包外,我有额外安装了git 和 jre。

git毫无疑问,用git工具下载源码,肯定就要安装了,直接下载源码到本地也可以不安装。
jre,运行Eclipse 时需要依赖jre 或者 jdk 提示很明显,直接使用sudo apt-get install jre就可以成功安装,安装过程中可以更换下下安装源,系统自带的安装源下载速度太慢。安装的时候我使用的是以下源,root权限替换到/etc/apt/source.list中即可。


  1. deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
  2. deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
  3. deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
  4. deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
  5. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
  6. deb http://mirrors.aliyun.com/ubuntu/ xenial universe
  7. deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
  8. deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
  9. deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
  10. deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
  11. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
  12. deb http://archive.canonical.com/ubuntu xenial partner
  13. deb-src http://archive.canonical.com/ubuntu xenial partner
  14. deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
  15. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
  16. deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
  17. deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

  18. #3.1.2:东北大学:
  19. deb-src http://mirror.neu.edu.cn/ubuntu/ xenial main restricted #Added by software-properties

  20. deb http://mirror.neu.edu.cn/ubuntu/ xenial main restricted

  21. deb-src http://mirror.neu.edu.cn/ubuntu/ xenial restricted multiverse universe #Added by software-properties

  22. deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted

  23. deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties

  24. deb http://mirror.neu.edu.cn/ubuntu/ xenial universe

  25. deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates universe

  26. deb http://mirror.neu.edu.cn/ubuntu/ xenial multiverse

  27. deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates multiverse

  28. deb http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

  29. deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties

  30. deb http://archive.canonical.com/ubuntu xenial partner deb-src http://archive.canonical.com/ubuntu xenial partner

  31. deb http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted

  32. deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties

  33. deb http://mirror.neu.edu.cn/ubuntu/ xenial-security universe

  34. deb http://mirror.neu.edu.cn/ubuntu/ xenial-security multiverse

  35. #3.1.3:清华大学:
  36. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted

  37. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted

  38. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe

  39. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe

  40. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse

  41. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse

  42. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

  43. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted

  44. deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse

复制代码

debug运行时,提示找不到可执行程序,设置后就可以正常运行。

debug.PNG

模拟器的配置可以参照如下视频。

http://www.youtube.com/watch?v=ZzLdct2ymvg&feature=youtu.be

最后看下运行效果,有图有真相,没搞过gif,会的小伙伴可以留言教我下,简单上几个图片吧。

input.PNG
list.PNG

chart.PNG

回复

使用道具 举报

该用户从未签到

26

主题

565

帖子

85

蝴蝶豆

金牌会员

最后登录
2021-3-19
发表于 2018-6-13 15:14:22 | 显示全部楼层
谢谢分享,有时间试一试
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

站长推荐上一条 /3 下一条

Archiver|手机版|小黑屋|论坛-意法半导体STM32/STM8技术社区

GMT+8, 2024-4-30 01:11 , Processed in 1.178254 second(s), 37 queries .

Powered by Discuz! X3.4

Copyright © 2001-2024, Tencent Cloud.

快速回复 返回顶部 返回列表