New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How to convert a lua script to script.bin without windows and luatools? #89
Comments
看了一下luadb v2的定义: https://wiki.luatos.com/develop/contribute/luadb.html 尝试理解
最后,按SPEC, "文件区的末尾, 会是一个名为 “.airm2m_all_crc#.bin”, 内容是当前文件数据之前的所有数据的md5的hex值.",文件名应该是正序,"0x2E,0x61,0x69,0x72,0x6D,0x32,0x6D,0x5F,0x61,0x6C,0x6C,0x5F,0x63,0x72,0x63,0x23,0x2E,0x62,0x69,0x6E",但luadb_inline_sys中并没有这个值序列。 能够提供完整准确的luadb v2 spec定义? |
基本流程就是
|
https://github.com/openLuat/LuatOS/blob/master/bsp/win32/tools/update_inline_sys.lua 这个文件里还有些残余, 注释的部分, 稍作修改应该就能跨平台使用 |
从Linux的角度看,xmake和luatOS的构建都没有任何问题。 目前仅有几个工具是欠缺的:
以下仅是个人建议: 1,bootloader/app烧写完成后,script部分是架构基本无关的,可以有一个单独通用luatos script flash tool。不升级bl/app的情况下,开发时更多是烧脚本,没必要弄的太复杂,GUI工具很难自动化,远不如一条命令来的方便,windows也是一样。 2,架构相关部分的烧写,继续现在的luatools之外(是否考虑Linux version),是否考虑提供最基本的Linux cmdline tool或倚靠架构本身的工具完成bl和app的烧写,如果是ARM,那工具实在太多了,没必要屏蔽或刻意避免使用这些现成的工具。比如air105在linux下的问题,除了没有一个脚本转bin的工具外,就是硬件swd引脚没引出,否则总可以用cmsis dap烧进去。 |
顺便,我调了一下soc_download的代码,甚至修改了部分,用win10 sdk和msvc toolchain在linux下重新编译了一遍(可以过,没问题),但PortRW始终超时,严重怀疑是不是rts linux和windows实现不一样的问题。这里也提到了"Linux下的问题和解决"。但即使改了内核ch341驱动,也不行。air105-uploader这个issue也很有意思。 Update: air105-uploader的问题已经修复了. |
但提供的soc_download在windows下是ok的吧? |
|
OK的,在Linux下总是PortRW timeout,改了代码加延时也不行,有时间我再调调看看吧。 |
OK,我之前一直用wm_sdk试的。那对XT804来说,要把luatos开发用起来,现在只缺一个script.bin或romfs的工具了。 对air105来说,air105-uploader问题已经修复了,可以使用mh1903或者air105 firmware library来写东西了。暂时还不能program luatos。 |
air101_flash代码传上来吧。我在写w80x/air101/103的教程,搞定luatos在linux下的开发后会把这块内容补上。 https://github.com/cjacker/opensource-toolchain-w80x-air101-air103 |
ok了吗? 没问题就close了 |
先不用关。 luadb_maker可能是有问题的。比如: 另,我没跑这个脚本,这个脚本严重依赖windows,不能在linux下用luatos运行。首先Linux下的luatos环境不完整,没有io.popen (最近的commit好像已经broken linux支持了),其次这个脚本调用了 今天有时间,用C写了个luatos-utils,不指望上游能好好支持linux了。。。请在windows下也试一下,主要是mkscriptbin.c能不能在win下编译和正常使用,其它的理论上应该没问题。 https://github.com/cjacker/luatos-utils 包括:
|
另外,均打开了-DLUA_32BITS,luac用gcc -m64编译生成64位ELF,跟gcc -m32编译生成32位ELF,分别编译的main.luac只有一点区别: 32位ELF luac编译lua生成的头 : 注意倒数第3位04和08,其它内容均没有区别。 Update 已通过修改lua的代码解决。 |
The tutorial is updated already to add LuatOS contents. Please help to review it when your time is available. https://github.com/cjacker/opensource-toolchain-w80x-air101-air103 |
PortRW用了win api的异步通讯机制,转到linux下的话,可以用select,另外RTS最多拉高拉低不一样,大不了就手动重启板子,一样可以下载的 |
实在不行就直接在CSDK中自己开发一个支持LUA虚拟机的任务,抛开官方的LUA支持。这个工作量反而更小 |
luatools is close source and only for windows, it even can not run with wine on Linux.
Update:
I have write a tool luatos-utils to convert lua script and generate script.bin (in luadb format) and script.img used by AIR101/103.
It works well on Linux, you are able to develop and flash LuatOS and related scripts for AIR101 / 103 on linux now.
NOTE, AIR105 is not supported, since Official devboard didn't export SWD interface (PC3 pin) and air105-uploader can not program to specific address as I tested.
The text was updated successfully, but these errors were encountered: