页次: 1
I am not sure what you guys want to make with DEFE which is not already implemented in the bare metal drivers floating around, as for the question of @f1c100s_ maybe that is the method you are looking for, i am not sure what you want to acheive and what is the problem
https://github.com/nminaylov/F1C100s_projects/blob/f4c5d0df11c8786a351ff7473bd2bd72a00e891e/_drivers_/src/f1c100s_de.c#L328
there are various functions belonging to DEFE implemented some bare metal drivers.
https://github.com/nminaylov/F1C100s_projects/blob/f4c5d0df11c8786a351ff7473bd2bd72a00e891e/_drivers_/src/f1c100s_de.c
https://github.com/hongxuyao/F1C100s_with_Keil_RTX4_emWin5/blob/c55397f01ecd8673ffc53d51abe43319f4ce2466/spl-separated/periph/fb-f1c100s.c
https://github.com/VeiLiang/BoloRTT/blob/3332e09121af23d19ab76b78a255841d330ccdf0/bsp/f1c/drivers/drv_fb.c
I have other sources which i cannot share here but i can look inside if you need some specific functions, let me know.
The quest for bare metal H264 is not finished yet so anyone with information is welcome to share, also in about 2 week i will get the h264 bare metal driver for v3s (not free though), it is expected to work on F1C100S, to be tested.
@Ozelot
wow, that is a reality check, hard to realize what you are going through. With my best wishes for a fast resolution of this terrible situation and a fast recovery of the country.
I'll update here too if i have some news about the H264, i already started to port it months ago but there was just too many third party linux dependencies. I still have the Keil project though.
what about the H264 decoder?
我现在的问题是如何在主线上实现硬件YUV转RGB。我现在用主线5.2,自己写的播放器调用的CEDAR(不是ffmpeg的方式),800x480分辨率H264解码可以到24~30fps。如果可以实现硬件YUV转RGB的话1280x720@60fps也不是问题。
好吧,有可用的硬件转换,这是在 CEDAR 驱动程序中实现的,所以,这不是问题。
它被称为 DEFE (Display Engine Front End) hard conversion MB32-YUV format to ARGB8888 format
你介意分享你的linux的源代码吗? 它可能会帮助需要在主线上获得流畅 mp4 的其他人。
@hoel
Thanks for the effort. I'm just waiting for the tech-competent people to get F1C100s stuff working on mainline Linux... Maybe I'll take a jab at this sometime later.
The MDK projects are not clean yet but i added the sources. Make sure to enable C99 and add --gnu flag in MDK project options.
The "official" Tina has hardware support, thought the sources are kept by agents to make money. Melis also have hardware support, but both these platforms are quite a pain to work with.
Mainline 5.4 has Cedar, but according to multiple reports the performance is so poor that it is not usable (10fps).
What some of us like is efficient development workflow (fast compile, instant flash, debug) clear MDK project with few sources files, very small binaries, full control over every bit of code. Quite the contrary of tina and Melis.
最近在仔细研究SUNIV家族(F1C100S)在裸机/RTOS上实现H264硬件解码的可行性。我会尽量在这里保留一些参考资料,并开始分享资源。
我对全志车手的理解如下。
VE
负责低层操作。主要由一个由VE引擎中断驱动的状态机组成,它使用两个定时器和一个任务列表。
我认为这个内核可以运行裸机(至少对于 PoC 而言),它没有什么特别之处。要与 RTOS 一起使用,只需实现互斥体包装器。我用直接函数替换了 ioctl。几个小时后,我能够将这部分集成到裸机 MDK 项目中,只需稍加努力,它应该可以正常工作。
这个核心是3个文件,cedar_ve_sl.c cedar_ve.h和list.h(linux双向链表实现)。
我使用了这些源代码: https://github.com/mirkerson/c600/tree/master/linux-3.10/drivers/media/cedar-ve
ve.zip
CedarX
负责所有数据处理,由各种块、FB、VB、vdecoder + plugins、OMX组成。
由于大量异步操作,这自然取决于互斥锁,但是,可能可以使用调度程序或其他技巧在裸机中运行它。
经过几个小时的工作,项目编译没有错误。必须修改各种东西。 RTOS 依赖包在 osal.c 中。 pixelformat.c 已经扩展了需要 ARMCC 6 的 inline asm,所以请注意 MDK 编译器版本。
我使用了这些来源: https://github.com/allwinner-zh/media-codec/tree/master/sunxi-cedarx/SOURCE
cedarx.zip
allwinner的一篇关于LibVE架构的论文和其他一些文档
https://github.com/linux-sunxi/cedarx-libs/blob/master/doc/Libve%20User%20Guide-2011.7.6.pdf
这里是 MELIS 的 CEDAR 模块的非编译版本:
https://github.com/caochunjie45/test/tree/master/eMod/mod_cedar
遗憾的是,这仍然依赖于其他编译库,因此它不包含编写 h264 驱动程序所需的所有源代码,但它仍然很有帮助。
当然,如果我们能找到一个旧 MELIS 的完整来源,或者只是 H264 驱动程序的来源(也许一些前 Alwinner 员工可以帮助提供一个旧的 H264 PoC?或一个旧驱动程序?)可以随时自己尝试,总是很有趣。
稍加清理后,我将添加 MDK 项目
Recently, i have studied closely the feasability of implementing the H264 hardware decoding on bare metal / RTOS for the SUNIV familly (F1C100S). I will try to keep some references here, and start to share ressources.
My understanding of the allwinner driver is as follow.
VE
in charge of low level operations. Mainly consists of a state machine driven by the VE engine interrupt, it uses two timers and a tasklist.
I think this core can run bare metal (at least for PoC), there is nothing special about it. To use with RTOS only the mutexes wrapper have to be implemented. I replaced ioctl by direct functions. After few hours i was able to integrate this part into the bare metal MDK project, with few more efforts it should work OK.
This core is 3 files, cedar_ve_sl.c cedar_ve.h and list.h (linux doubly linked list implementation).
i used these source source: https://github.com/mirkerson/c600/tree/master/linux-3.10/drivers/media/cedar-ve
ve.zip
CedarX
in charge of all data handling, composed of various blocks, FB, VB, vdecoder + plugins, OMX.
Naturally this depends on mutexes due to numerous async operation, however, it is probably possible to run it in bare metal with scheduler or other trick.
After wfew hours of work the project compiles without error. Various things had to be modified. RTOS dependencies are wrapped in osal.c. pixelformat.c has extended inline asm which requires ARMCC 6, so pay attention to the MDK compiler version.
I used these source : https://github.com/allwinner-zh/media-codec/tree/master/sunxi-cedarx/SOURCE
cedarx.zip
A paper from allwinner about the architecture of LibVE and few other documents
https://github.com/linux-sunxi/cedarx-libs/blob/master/doc/Libve%20User%20Guide-2011.7.6.pdf
A non compiled version of CEDAR module of MELIS here:
https://github.com/caochunjie45/test/tree/master/eMod/mod_cedar
Sadly this still relies on other compiled libraries, so it does not contain all the sources required to write the h264 driver, but it is helpful nontheless.
Of course, it would be great if we can find the full sources of an old MELIS, or just the sources of H264 driver (maybe some former Alwinner employee can help to give an old H264 PoC? or an old driver?), anyway we can always try by ourselves, it is always interesting.
I will add the MDK projects after a little bit of cleaning
我用MDK编译MELIS,编译没有错误,生成新镜像并烧录,但是我在循环中出现这个错误,有人知道这个问题吗?
BOOT0 is starting
DBG: init jtag OK
init dram , base is 0x80000000
init dram , clk is 120
init dram , access_mode is 1
init dram , cs_num is 1
init dram , ddr8_remap is 0
init dram , sdr_ddr is 1
init dram , bwidth is 16
init dram , col_width is 10
init dram , row_width is 13
init dram , bank_size is 4
init dram , cas is 3
init dram , size is 0
dram init successed,size is 32
DBG: init heap OK, base address is 0x80000000, size is 0x00100000
DBG: load boot1 from spinor
DBG: init spinor OK
DBG: the size of BOOT1 is 71168
DBG: src_sum = 0x0x19c0ac68
DBG: sum = 0x0x19c0ac68
succeed in loading BOOT1
jump to BOOT1
DBG: boot1 starting!
DBG: init heap OK, base address is 0x80800000, size is 0x00100000
begin to init file system
DBG: init block device OK
DBG: init mini file system OK
DBG: mount c partition OK
0
jump to kernal
port=4,port_num=1,mul_sel=6 eint_num=1 trigger=2
hread running.....
partition [D] plug in..
Parts Thread work now.....
.Start Shell from partion 'c'..................................................................................
Mount Parts Thread work end....
x6969637765....
765 data fail....
&&&&&&&&&&&&0x6972 addr error&&&&&&&&&&
..
....
rror&&&&&&&&&&
37765....
ta fail....
addr error&&&&&&&&&&
0x6969637765....
7765 data fail....
&0x6972 addr error&&&&&&&&&&
&&addr=0x6969637765....
x6969637765 data fail....
&&&&&&&&0x6972 addr error&&&&&&&&&&
&&&&&&&&&&
5....
ail....
r error&&&&&&&&&&
69637765....
data fail....
972 addr error&&&&&&&&&&
dr=0x6969637765....
9637765 data fail....
&&&&0x6972 addr error&&&&&&&&&&
**0x6969637765 data fail....
&&&&&&&&&&&0x6972 addr error&&&&&&&&&&
.
...
set iic clock fail
969637765....
5 data fail....
6972 addr error&&&&&&&&&&
ddr=0x6969637765....
69637765 data fail....
&&&&&0x6972 addr error&&&&&&&&&&
***0x6969637765 data fail....
&&&&&&&&&&&&0x6972 addr error&&&&&&&&&&
..
....
rror&&&&&&&&&&
37765....
ta fail....
addr error&&&&&&&&&&
0x6969637765....
7765 data fail....
&0x6972 addr error&&&&&&&&&&
&&addr=0x6969637765....
x6969637765 data fail....
&&&&&&&&0x6972 addr error&&&&&&&&&&
&&&&&&&&&&
5....
ail....
r error&&&&&&&&&&
69637765....
data fail....
972 addr error&&&&&&&&&&
dr=0x6969637765....
9637765 data fail....
set iic clock fail
969637765....
5 data fail....
&&&&&&&&&&&&0x6972 addr error&&&&&&&&&&
..
....
rror&&&&&&&&&&
37765....
ta fail....
addr error&&&&&&&&&&
0x6969637765....
7765 data fail....
&0x6972 addr error&&&&&&&&&&
&&addr=0x6969637765....
x6969637765 data fail....
&&&&&&&&0x6972 addr error&&&&&&&&&&
&&&&&&&&&&
5....
ail....
r error&&&&&&&&&&
69637765....
data fail....
972 addr error&&&&&&&&&&
dr=0x6969637765....
9637765 data fail....
&&&&0x6972 addr error&&&&&&&&&&
**0x6969637765 data fail....
&&&&&&&&&&&0x6972 addr error&&&&&&&&&&
.
...
partition [E] plug in..
WRN:L27(osal_cache.c):he: Parameter of Length cannot be 0!
pend event sem overtime!
der=9
r_used=1 ret=0
.....................................................................................................................
press enter key(keypad or irkey) to continue!
..............................................................
.....................................................................................................
egin..............
.bin failed.
fail
..
&&&&&&&&&&&&0x6972 addr error&&&&&&&&&&
..
....
rror&&&&&&&&&&
37765....
ta fail....
addr error&&&&&&&&&&
0x6969637765....
7765 data fail....
&&&&&&&&&&&&0x6972 addr error&&&&&&&&&&
..
....
rror&&&&&&&&&&
37765....
ta fail....
addr error&&&&&&&&&&
0x6969637765....
7765 data fail....
&0x6972 addr error&&&&&&&&&&
&&addr=0x6969637765....
x6969637765 data fail....
&&&&&&&&0x6972 addr error&&&&&&&&&&
&&&&&&&&&&&&0x6972 addr error&&&&&&&&&&
..
....
rror&&&&&&&&&&
37765....
ta fail....
2
enned!........................................................................................
6969637765....
65 data fail....
x6972 addr error&&&&&&&&&&
addr=0x6969637765....
969637765 data fail....
&&&&&&0x6972 addr error&&&&&&&&&&
****0x6969637765 data fail....
&&&&&&&&
...
l....
&&&&&&&&&&&&0x6972 addr error&&&&&&&&&&
..
....
rror&&&&&&&&&&
37765....
ta fail....
addr error&&&&&&&&&&
0x6969637765....
7765 data fail....
&0x6972 addr error&&&&&&&&&&
&&addr=0x6969637765....
x6969637765 data fail....
&&&&&&&&0x6972 addr error&&&&&&&&&&
&&&&&&&&&&
5....
ail....
r error&&&&&&&&&&
69637765....
data fail....
4
set iic clock fail
969637765....
5 data fail....
&&&&&& fail &&&&&&
969637765....
5 data fail....
&&&&&& fail &&&&&&
969637765....
5 data fail....
&&&&&& fail &&&&&&
969637765....
5 data fail....
&&&&&& fail &&&&&&
969637765....
5 data fail....
&&&&&& fail &&&&&&
969637765....
5 data fail....
.....
过了一会儿我发现了问题,2个文件路径错误,被默默忽略了。这导致了错误,在制作IMG之后和刻录之前确保检查UPDATE.TXT并确保这里没有文件复制错误,如果没有复制一个文件,请在update.bat中找到哪个文件并修复问题然后重新制作IMG和闪光
BOOT0 is starting
DBG: init jtag OK
init dram , base is 0x80000000
init dram , clk is 120
init dram , access_mode is 1
init dram , cs_num is 1
init dram , ddr8_remap is 0
init dram , sdr_ddr is 1
init dram , bwidth is 16
init dram , col_width is 10
init dram , row_width is 13
init dram , bank_size is 4
init dram , cas is 3
init dram , size is 0
dram init successed,size is 32
DBG: init heap OK, base address is 0x80000000, size is 0x00100000
DBG: load boot1 from spinor
DBG: init spinor OK
DBG: the size of BOOT1 is 71168
DBG: src_sum = 0x0x19c0acb7
DBG: sum = 0x0x19c0acb7
succeed in loading BOOT1
jump to BOOT1
DBG: boot1 starting!
DBG: init heap OK, base address is 0x80800000, size is 0x00100000
begin to init file system
DBG: init block device OK
DBG: init mini file system OK
DBG: mount c partition OK
0
jump to kernal
port=4,port_num=1,mul_sel=6 eint_num=1 trigger=2
hread running.....
BOOT0 is starting
DBG: init jtag OK
init dram , base is 0x80000000
init dram , clk is 120
init dram , access_mode is 1
init dram , cs_num is 1
init dram , ddr8_remap is 0
init dram , sdr_ddr is 1
init dram , bwidth is 16
init dram , col_width is 10
init dram , row_width is 13
init dram , bank_size is 4
init dram , cas is 3
init dram , size is 0
dram init successed,size is 32
DBG: init heap OK, base address is 0x80000000, size is 0x00100000
DBG: load boot1 from spinor
DBG: init spinor OK
DBG: the size of BOOT1 is 71168
DBG: src_sum = 0x0x19c0acb7
DBG: sum = 0x0x19c0acb7
succeed in loading BOOT1
jump to BOOT1
DBG: boot1 starting!
DBG: init heap OK, base address is 0x80800000, size is 0x00100000
begin to init file system
DBG: init block device OK
DBG: init mini file system OK
DBG: mount c partition OK
0
jump to kernal
port=4,port_num=1,mul_sel=6 eint_num=1 trigger=2
hread running.....
你好,
我梦想我们可以在裸机或 RTOS 中使用 H264 硬件,在搜索时我找到了这个实现。
https://github.com/jemk/cedrus/tree/master/common
有谁知道它是否适用于F1C00S,如果它不能适用,也许它可以在AODZIP完成的5.4主线移植中进行调整检查
https://github.com/aodzip/cedar
你怎么看?
h264软解码移植了好几个,但是大都是base profile的。支持main profile的比较少。还有相关视频封装格式解析要移植,比较耗时
https://github.com/aodzip/cedar/tree/master/ve
是的,我并不是真的关心软件实现,我只是想知道让 VE 在裸机中工作会有多困难。 似乎一切都在这里,但我还没有清楚地了解它是如何工作的,它似乎写入了内存的特定区域,并且在中断中有一个大状态机,并且必须有一个系统 o 调度
有没有人用过裸机的 H264 解码器? 我想知道,因为它现在已集成到主线中,而且我还偶然发现了这个似乎不属于 linux 的库
https://github.com/huceke/libcedar/blob/master/src/CedarDecoder.cpp
你好,
有没有人在 macOS 下成功构建过这个? 当我尝试时,我在生成文件中遇到了 SED 和 SXRG 错误,因为 macOS 版本不处理生成文件中使用的某些参数。
https://github.com/aodzip/buildroot-tiny200
此版本包含 CEDAR,因此它应该能够使用硬件 h264 解码器读取 mp4。
https://github.com/aodzip/cedar
https://www.savagemessiahzine.com/sec__/forum/index.php?showtopic=287496&st=180
F15 / T7200 / SC9800 ?
您好,
我想在 3.5 和 4 英寸 LCD(带 CTP)上显示小型 MP4 视频序列。最初的计划是使用 F1C100S,但我不太确定它是否可以以 26 或 30fps 的速度显示。还有价格和供应不稳定的问题。所以我想知道哪个非常便宜的 SoC 或 MCU 或旧的 CPU 可以完成这项工作。一些MCU可能能够在小屏幕(可能是340x480)上显示30fps,但通常使用快速SPI,不适用于更大的显示(480x800),因此RGB或MIPI接口更好。数据将从MicroSD卡读取,除了MCU / CPU只需通过I2C读取传感器并通过UART接收一些蓝牙数据,所以没有要求的工作,主要问题只是解码MP4并播放有声音显示。可以是裸机、RTOS 或 Linux。如果有人有想法,请告诉我。
V3S的不方便。F1C100s我也有调试好,是rtthread系统的,但是还没有时间整理。如果你需要,我可以先发参考代码文件给你,留下你的邮箱。希望能帮助你尽快调通
谢谢师父,我的信箱是3265649676[at]qq[dot]com,我可以向您发送到目前为止已完成的工作,起初我找到了Melis USB堆栈的来源,并将所有文件移植到裸机项目中,现在可以编译了,但是 文件和依赖关系太多,因此移植似乎不太可能(此USB堆栈使用ePos的某些RTOS功能)。 然后我从u-boot移植了Sunxi堆栈,文件较少但缺少较高级别的堆栈,因此尚不能直接实现主机。 还有另一种移植,它仅从u-boot中提取了很少的文件,这个文件可以枚举,仅此而已,我感到缺少太多高级堆栈来实现HOST功能。
已经和楼主解决
这里说一下全志musb的坑
_______________________________
usb otg 做主机发送请求到设备时候,地址设置分两个寄存器的
一个是端点0和TX类请求,设置地址用的寄存器是0x98偏移的FADDR
另外一个是数据端点RX也就是IN请求,设置地址用的寄存器是0x9C偏移的RXFADDR
_______________________________
楼主的问题是枚举成功后数据端点发送IN请求请求数据的时候,地址设置还是设置FADDR,导致地址不对,设备不响应然后进入ERROR中断
您好,
您可以共享V3S的USB-HOST吗? 我花了很多时间尝试为F1C100S移植USB HOST,但仍然无法正常工作。 我认为V3S应该差不多。 如果我改变低水平的领域,它应该工作。
您好,
有人在F1C100S上通过u-boot使用USB MSD吗? 我看到一个版本可以在V3S上使用 https://whycan.cn/t_3651.html,但不适用于F1C100S,我尝试的u-boot显示为“No controllers found”。
void xboot_main(void)
{
/* Do initial memory */
do_init_mem();
/* Do initial scheduler */
do_init_sched();
/* Do initial vfs */
do_init_vfs();
/* Do all initial calls */
do_initcalls();
/* Do show logo */
do_showlogo();
/* Do auto mount */
do_automount();
/* Do auto boot */
do_autoboot();
//#if defined(CONFIG_SHELL_TASK) && (CONFIG_SHELL_TASK > 0)
/* Create shell task */
struct task_t * task = task_create(scheduler_self(), "shell", shell_task, NULL, 0, 0);
/* Resume shell task */
task_resume(task);
//#endif
/* Scheduler loop */
scheduler_loop();
/* Do all exit calls */
do_exitcalls();
}
IT应该显示一个shell提示,但没有任何提示,因此显然不起作用。
我也不认为xboot在这里会有所帮助,这是一个旨在适合许多体系结构的完整系统,与裸机相反。 我既不想也不打算了解Xboot的详细信息,也不想打算为它编写驱动程序,因为我没有用过这种系统。
我想要的只是将USB HOST堆栈移植到裸机上,无论如何,中断例程已经包含在堆栈中,我认为Xboot对我来说是行不通的。 什么也不做时已经是4MB了。
那是我开机后得到的全部,还有更多期望吗?
_ _
_ _ | |___ _____ _____ _| |_
\ \/ /| _ | _ | _ |_ _| (C) 2007-2020
) ( | |_| | |_| | |_| | | |____JIANJUN.JIANG__
/_/\_\|_____|_____|_____| |_____________________|
V3.0.0 (May 29 2020 - 16:34:12) - [sast-kk131][SAST KK131 Digital Player Based On Allwinner F1C100S]
[ 0.000000] Probe device 'blk-romdisk.0' with blk-romdisk
最后
$(NAME) : $(OBJS)
@echo [LD] Linking $@
@$(CC) $(LDFLAGS) $(LIBDIRS) -Wl $^ -o $@ $(LIBS)
hoel@iMac-de-Hoel-7 ~/Downloads/xboot-master/developments/mkz $ make
[CC] ecdsa256.c
[CC] main.c
[CC] sha256.c
[CC] lz4/lz4.c
[CC] lz4/lz4frame.c
[CC] lz4/lz4hc.c
[CC] lz4/xxhash.c
[LD] Linking mkz
16:34:12 **** Incremental Build of configuration Default for project xboot ****
make all
[ROMDISK] Packing romdisk
[CC] init/version.c
[AS] driver/block/romdisk.S
[LD] Linking ../output/xboot
[OC] Objcopying ../output/xboot.bin
copy from `../output/xboot' [elf32-littlearm] to `../output/xboot.bin' [binary]
Make header information for brom booting
bootloader size= 2200
The bootloader head has been fixed
Compressed 3990016 bytes into 2613615 bytes ==> 65.503873% [C][S]
16:34:15 Build Finished (took 2s.868ms)
再把 --cref 删掉
$(NAME) : $(OBJS)
@echo [LD] Linking $@
@$(CC) $(LDFLAGS) $(LIBDIRS) -Wl,-Map=$@.map $^ -o $@ $(LIBS)
hoel@iMac-de-Hoel-7 ~/Downloads/xboot-master/developments/mkz $ make
[LD] Linking mkz
ld: unknown option: -Map=mkz.map
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mkz] Error 1
自行编译mkz之类的工具,源码目录里有。
hoel@iMac-de-Hoel-7 ~/Downloads/xboot-master/developments/mkz $ make
[LD] Linking mkz
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mkz] Error 1
无法在macOS上静态链接crt0.o
但是当我从生成文件中删除-static标志时,弹出另一个错误
hoel@iMac-de-Hoel-7 ~/Downloads/xboot-master/developments/mkz $ make
[LD] Linking mkz
ld: unknown option: --cref
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mkz] Error 1
Try removing `-static` from LDFLAGS in the Makefile. The reason being is
that on macOS, there isn't a static version of the crt0.o library.See
https://stackoverflow.com/questions/3801011/ld-library-not-found-for-lcrt0-o-on-osx-10-6-with-gcc-clang-static-flag
for details.
改为:
PLATFORM ?=arm32-f1c100s
解决了第一个问题,我在macos上,所以我添加了mksunxi,但是仍然存在MKZ问题,提供的版本仅在linux上有效,无法在macos上执行,并且未提供源文件。 应该提供MKZ的源文件和makefile,以便我们至少可以在macOS上构建它
copy from `../output/xboot' [elf32-littlearm] to `../output/xboot.bin' [binary]
Make header information for brom booting
bootloader size= 2200
The bootloader head has been fixed
/bin/sh: arch/arm32/mach-f1c100s/tools/linux/mkz: cannot execute binary file
make[1]: *** [xend] Error 126
make: *** [all] Error 2
以下是 xboot 在QQ群的回复:
主要问题是如何集成usb栈,然后中断不知道该如何用,
不知道minimal-f1c100s有没有移植xboot的中断框架,
如果有移植的话,那么支持中断也是很容易的一件事,
不过,可以建议你直接在xboot上,移植usb栈,所有组件都是完整的。
The USB stack already has the interrupt framework. I fear It will take a lot of efforts to adapt the USB stack to xboot, i want to avoid that, the stack is already working standalone, the only adaptation is the f1c100s.ld linker file. I made good progress yesterday, now the Eclipse project can compile and produce the .hex and .bin, the only remaining problem is to adapt the linker file f1c100s.ld, because currently it includes some object fils (.0) and Eclipse is not happy about it ("multiple definition of ..." error).
If i comment the included .o files in f1c100s.ld then the linking is successful.
USB堆栈已具有中断框架。 恐怕要使USB堆栈适应xboot会花费很多精力,我想避免这种情况,该堆栈已经可以独立工作,唯一的适应是f1c100s.ld链接器文件。 我昨天取得了良好的进展,现在Eclipse项目可以编译并生成.hex和.bin,唯一剩下的问题是改编链接器文件f1c100s.ld,因为当前它包含一些对象fils(.0),而Eclipse没有。 很高兴(“ ...的多个定义”错误)。
如果我注释了包含的.o文件,则链接成功。
原始的f1c100s.ld
带有.o的f1c100s.ld进行了评论
项目设置
Hello,
Follow-up to my previous attemps on getting a working bare metal USB stack with DMA on the F1C100S, at first i found the Melis USB stack sources and spent several hours to modify them in order to compile as a standalone stack, the files can be found here USB_STACK_MELIS.zip.
It can compile but there is some calls to external functions (replaced by dummy functions), mostly in ePos, the RTOS on which Melis is based. So i decided that this is not ideal because ultimately this USB stack seems to rely on the presence of an RTOS and i dont want any RTOS.
So i have finally ported a complete bare-metal USB stack with DMA, it is the Sunxi official USB stack, extracted from u-boot, i had to spend several hours to fix all include path and sources files so that it can be compiled. The files can be found here USB_STACK_SUNXI.zip. I used gcc-arm-none-eabi 5_2-2015q4 but it should work with any gcc-arm.
To do the transplant and avoid worries on the makefile and linker script i started from an empty cross-GCC project in Eclipse and used the internal builder.
After much struggle the stack finally compiles, all dependencies are satisfied and the linker is able to link, however to get an usable Eclipse project all this stack has to be integrated into the already working bare-metal template (minimal-f1c100s), which has a working makefile and linker script and deals with the bootloader.
In the USB stack i had to integrate two assembly files : vectors.S and start.S, these two files contain some references used in the USB stack initialisation, namely IRQ, FIQ and few other things. It is a problem because the template (minimal-f1c100s) already has it own start.S file and it will be in conflict, also the interrupt vector is already declared. I am sure it is possible to get rid of vector.S and start.S from the USB stack and integrate all the sources into minimal-f1c100s directly, but I am having troubles to achieve this and i need some help with this task.
Ultimately it would be great to make an Eclipse project template which can manage the makefile itself so we dont have to edit it by hand. Contrary to Keil, Eclipse is working on all OS (windows, MacOS and Linux) it is free to use and convenient with GCC and a debugger.
I think it would be profitable to all F1C100S bare-metal users if we can put together an Eclipse template with the existing source code minimal-f1c100s, all it drivers, the USB stack and automatic makefile management. So that everyone could develop bare-metal application easily without worry for makefile and linker file hand editing, and use a debugger if they want to.
If anyone is willing to help with this process, please share your knowlhedge for the benefit of all.
Why would someone need to run F1C100S without Linux or RTOS?
because all the CPU power available is needed for the realtime signal processing, the ARM926EJ-S is a little bit old and it doesnt have some more recent instructions like SIMD found on Cortex-M serie, so the DSP is less efficient, there is also no real hardware floating point, there is a FVP (vector floating point) but for some reason GCC seems to consider it as SoftFloat. I tried to run my signal processing on Linux (5.2, with USB+DMA) and the peformance was catastrophic, when i tried to run the exact same signal processing in bare metal the performance increase was over 250%, that is why i need bare metal.
Why would someone need bare-metal USB HOST?
The data acquisition is done with an external chipset which only provide USB 2.0 interface, there is no SPI or anything else.
Why would someone need USB HOST with DMA?
Quite a lot of data is acquired in realtime continuously, DMA is necessary to achieve data acquisition without loading and interrupting the CPU which does not have much free time due to the ongoing signal processing (double buffering).
你好,
在我以前尝试在F1C100S上获得具有DMA的可用裸机USB堆栈的尝试之后,我首先找到了Melis USB堆栈源,并花了几个小时对其进行修改,以便将其编译为独立的堆栈,在此处找到 USB_STACK.zip 。
它可以编译,但是有一些对外部函数的调用(由伪函数代替),主要是在ePos(Melis所基于的RTOS)中。因此,我认为这不是理想的选择,因为最终该USB堆栈似乎依赖于RTOS的存在,因此我不希望任何RTOS。
因此,我终于移植了带有DMA的完整裸机USB堆栈,它是从u-boot提取的Sunxi官方USB堆栈,我不得不花几个小时来修复所有包含路径和源文件,以便可以对其进行编译。可以在 USB_STACK_SUNXI.zip 中找到文件。我使用了gcc-arm-none-eabi 5_2-2015q4,但它应该可以与任何gcc-arm一起使用。
为了进行移植并避免对makefile和链接程序脚本的担心,我从Eclipse中一个空的跨GCC项目开始,并使用了内部生成器。
经过艰苦的努力,堆栈最终得以编译,所有的依赖关系都得到了满足,并且链接器可以链接,但是要获得可用的Eclipse项目,请将所有这些堆栈集成到已经工作的裸机模板(minimal-f1c100s)中,该模板具有一个工作的makefile和链接程序脚本,并处理引导程序。
在USB堆栈中,我必须集成两个程序集文件:vector.S和start.S,这两个文件包含USB堆栈初始化中使用的一些引用,即IRQ,FIQ和其他一些东西。这是一个问题,因为模板(minimal-f1c100s)已经具有其自己的start.S文件,并且将发生冲突,并且中断向量也已声明。我确信可以摆脱USB堆栈中的vector.S并启动.S并将所有源直接集成到minimal-f1c100s中,但是我在实现此目标方面遇到了麻烦,因此我需要一些帮助。
最终,制作一个可以管理makefile本身的Eclipse项目模板将是很棒的,因此我们不必手动对其进行编辑。与Keil相反,Eclipse可以在所有OS(Windows,MacOS和Linux)上使用,可以免费使用,并且可以与GCC和调试器一起使用。
我认为,如果我们可以将Eclipse模板与现有的源代码minimal-f1c100s,所有驱动程序,USB堆栈和自动makefile管理放在一起,对所有F1C100S裸机用户都是有利的。这样,每个人都可以轻松开发裸机应用程序,而不必担心makefile和linker文件的手工编辑,并在需要时使用调试器。
如果有人愿意在此过程中提供帮助,请分享您的知识以造福所有人
为什么有人需要在没有Linux或RTOS的情况下运行F1C100S?
因为实时信号处理需要所有可用的CPU能力,所以ARM926EJ-S有点旧,并且没有诸如Cortex-M系列上的SIMD之类的一些最新指令,因此DSP的效率较低,因此,没有真正的硬件浮点,有一个FVP(矢量浮点),但是由于某种原因,GCC似乎将其视为SoftFloat。我尝试在Linux(5.2,带有USB + DMA)上运行信号处理,而性能却是灾难性的,当我尝试在裸机上运行完全相同的信号处理时,性能提高了250%以上,这就是为什么我需要裸机的原因金属。
为什么有人需要裸机USB HOST?
数据采集是通过外部芯片组完成的,该芯片组仅提供USB 2.0接口,没有SPI或其他任何东西。
为什么有人需要带有DMA的USB HOST?
连续不断地实时采集大量数据,DMA是实现数据采集而不需要加载和中断CPU的必要条件,由于正在进行的信号处理(双重缓冲),CPU没有太多的空闲时间。
几个小时后,它可以编译,但是需要移植一些功能,请检查porting.c和usb-os-platform.h,我将USB_OS define设置为0,因此通常它不需要ePos内核中的函数。 您只需要在Eclipse项目中选择工具链路径和前缀,就可以编译
刚调了好几个小时的灵异bug,现象是启动后有时候会死机。这时候已经启动了看门狗,但狗没有起作用,系统一直卡在那不reset。
最后调出来是个空指针错误。空指针毕竟是编程比较常见的错误,空指针能导致看门狗无效,F1C100s的这个bug也是有点严重。一番精简之后,找到了最小复现代码:
只要用一个基类指针,指向一块内容为0的区域,调用基类的第二个虚函数,就很容易使看门狗失效并死机。这个bug可能跟编译器的具体实现(C++类对象内存布局)有关,我用的GCC,其他编译器不一定是这样。
mdelay(10); // 等待超过1500ms则不出bug,等待0ms也不出bug,这之间都会遇到bug
嗨,你能分享你的Delay()过程吗? 我从uboot移植了地雷,只有timer0在工作并且时基错误,timer1根本不工作
您好,我正在使用裸机对F1C100S进行开发,因为该应用程序涉及到信号处理,而这是获得足够计算能力的唯一方法。我努力让USB HOST与裸机配合使用,尽管它现在功能还不完善,但我认为它已经有了很大的改进。基于另一篇文章的信息,我发现MELI的原始USB HOST驱动程序使用了旧3.1 linux中的设置文件,因此我将这些文件集成到裸机项目中并修复了错误,直到编译为止。现在用于USB HOST的基本环境应该没问题,有人知道如何实际使用这些文件访问外围设备吗?就我而言,我需要访问芯片组,配置一些寄存器并进行批量传输,我已经编写了STM32的驱动程序,因此可以轻松地将其调整为F1C100S支持,但我目前还不清楚如何使用usbc_host.c文件来实现我想要的功能,请问有人知道怎么操作吗?
还有一个问题,我想使用硬件计时器,在原始项目中,两个计时器文件来自XBOOT,分别是ce-f1c100s-timer.c和cs-f1c100s-timer.c,但是这两个文件依赖于XBOOT中目前项目不存在的功能。有没有人曾经在F1C100S上使用过计时器,或者知道我改如何实现我想要的功能?我只想一个时基做一些计时。
Archive.zip
应该并不是很难。KHCI的移植了,并且跑通了。然后后面又对接调通了rtthread的usb host协议栈。综合考虑,我建议用rtthread的usb host框架+sunxi hcd的bsp
您是否认为可以使用UBOOT的资源来完成? 它似乎比使用Linux的资源容易。
我曾经告诉过我,可以使用MELIS的来源来完成它,但是不幸的是,找不到MELIS USB HOST的来源
https://github.com/Lichee-Pi/u-boot/tree/master/drivers/usb/host
我也找到了这两个堆栈,如果您认为其中两个堆栈合适,请告诉我,移植Linux USB HCD驱动程序似乎很难实现。
https://github.com/kylemanna/kinetis-sdk2/tree/master/middleware/usb_1.0.0
https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/usbps/src
usb host协议栈
我没意识到,您是F1C100S裸机项目的原始作者,真是太好了。 关于USB HOST,NXP堆栈似乎不是可移植的,您是否认为我应该尝试直接移植linux HCD堆栈?
usb host协议栈
你穿了吗?
你的意思是这个堆栈吗? 好像很大
https://github.com/kylemanna/kinetis-sdk1/tree/master/usb/usb_core
"KHCI is a completely hardware-dependent set of routines that are responsible for queuing and processing USB transfers and searching"
至少根据NXP,这似乎根本不是便携式的
Also a .dtb file here :
hoel@iMac-de-Hoel-7 /Volumes/arm-linux-toolchain/openwrt/build_dir/target-arm_arm926ej-s_musl_eabi/linux-sunxi_arm9/linux-4.14.63/arch/arm/boot/dts (licheepi-nano *=) $ find *.dtb
suniv-f1c100s-licheepi-nano-with-lcd.dtb
suniv-f1c100s-licheepi-nano.dtb
not sure if it is the right one tho.
One concern is that there is no jffs2 option when i check in OpenWRT menuconfig:
i presume the modification involve doing something along these lines :
http://nano.lichee.pro/build_sys/build_flash.html
dd if=/dev/zero of=flashimg.bin bs=1M count=16 &&\
dd if=$YOUR_UBOOT_FILE of=flashimg.bin bs=1K conv=notrunc &&\
dd if=$YOUR_DTB_FILE of=flashimg.bin bs=1K seek=1024 conv=notrunc &&\
dd if=$YOUR_KERNEL_FILE of=flashimg.bin bs=1K seek=1088 conv=notrunc &&\
mkdir rootfs
tar -xzvf $YOUR_ROOTFS_FILE -C ./rootfs &&\
cp -r $YOUR_MOD_FILE rootfs/lib/modules/ &&\
# 为根文件系统制作jffs2镜像包
# --pad参数指定 jffs2大小
# 由此计算得到 0x1000000(16M)-0x10000(64K)-0x100000(1M)-0x400000(4M)=0xAF0000
mkfs.jffs2 -s 0x100 -e 0x10000 --pad=0xAF0000 -d rootfs/ -o jffs2.img &&\
dd if=jffs2.img of=$YOUR_IMG_FILE bs=1K seek=5184 conv=notrunc &&\
but not sure how to achieve this, when i check the target bin directory there is nothing else that the SD card image:
hoel@iMac-de-Hoel-7 /Volumes/arm-linux-toolchain/openwrt/bin/targets/sunxi/arm9 (licheepi-nano *=) $ ls
config.seed
openwrt-sunxi-arm9-device-suniv-f1c100s-licheepi-nano.manifest
openwrt-sunxi-arm9-suniv-f1c100s-licheepi-nano-ext4-sdcard.img.gz
openwrt-sunxi-arm9-suniv-f1c100s-licheepi-nano-squashfs-sdcard.img.gz
packages
sha256sums
No file for any of these:
$YOUR_UBOOT_FILE
$YOUR_DTB_FILE
$YOUR_KERNEL_FILE
$YOUR_ROOTFS_FILE
$YOUR_MOD_FILE
EDIT:
i found some u-boot image here :
hoel@iMac-de-Hoel-7 /Volumes/arm-linux-toolchain/openwrt/build_dir/target-arm_arm926ej-s_musl_eabi/u-boot-licheepi_nano/u-boot-2017.11 (licheepi-nano *=) $ ls
Documentation arch dts snapshot.commit u-boot.bin
Kbuild board env spl u-boot.cfg
Kconfig cmd examples test u-boot.cfg.configs
Licenses common fs tools u-boot.dtb
MAINTAINERS config.mk include u-boot u-boot.img
Makefile configs lib u-boot-dtb.bin u-boot.lds
README disk net u-boot-dtb.img u-boot.map
System.map doc post u-boot-nodtb.bin u-boot.srec
api drivers scripts u-boot-sunxi-with-spl.bin u-boot.sym
and some other images here, which seem to be related to kernel / rootfs:
hoel@iMac-de-Hoel-7 /Volumes/arm-linux-toolchain/openwrt/build_dir/target-arm_arm926ej-s_musl_eabi/linux-sunxi_arm9 (licheepi-nano *=) $ ls
backports-2017-11-01 linux-atm-2.5.2 root.ext4 vmlinux
base-files mtd root.squashfs vmlinux.debug
iptables-1.6.2 opkg-2017-12-07-3b417b9f suniv-f1c100s-licheepi-nano-kernel.bin vmlinux.elf
linux-4.14.63 packages tmp zImage
Hello,
After some struggle i managed to get a working toolchain for F1C100S on OSX, thanks to the help and suggestions of Quotation, Mango and 晕哥 https://whycan.cn/t_2571.html#p20276, OpenWRT is also building and working fine, however there is stil a problem with it: this version was adjusted to create an SD card image instead of a flash image. It is a problem with the F1C100S since the wifi uses the SDIO interface so using an SD card to store OpenWRT and filesystem prevent wifi connectivity, which is really a problem in my opinion especially if you need to debug from an IDE (Eclipse or QT Editor) since network access is required.
The OpenWRT i use has been made by Qin Fengling and can be found here https://github.com/qinfengling/openwrt/tree/licheepi-nano some tweaking was required to get it working on OSX, i will detail these in new subject (step-by-step instruction to get everything working on OSX), once this image generation problem is fixed.
I checked the sources an found the SD card image generation is done by at least the makefile and the script gen_sunxi_sdcard_img.sh which can be found here : https://github.com/qinfengling/openwrt/tree/licheepi-nano/target/linux/sunxi/image, i am not sure if any other files are involved (.dts?). When i asked Qin Fengling about adjusting this OpenWRT to generate flash image instead he told i have to make a profile :
You need to add your own profile, if you want to support 16MB Flash, you can find some reference in the code:
https://github.com/openwrt/openwrt/tree/master/target/linux
I am not sure on how to remake a profile from scratch, i have worked on another target for a specific application (MT7628) and it generates a 16MB flash image which is what i need here for the F1C100S, i checked definition of this target, i am not sure i can just modify these files to make the F1C100S profile.
Does anyone know what steps should be taken to either adjust the current target profile for making 16MB flash image, or tailor another existing profile already generating 16MB flash image to the curent F1C00S target?
Thank you.
你好,
经过一番努力,我终于在OSX上找到了一个F1C100S的工作工具链,感谢报价的帮助和建议,Mango和晕哥https://whycan.cn/t_2571.html#p20276,OpenWRT也在构建和工作,但是它仍然有问题,这个版本被调整为创建SD卡图像而不是闪存。图像,这是F1C100的一个问题,因为WiFi使用SDIO接口,所以使用SD卡存储openwrt和文件系统会阻止WiFi连接,这在我看来确实是一个问题,特别是当您需要从IDE(Eclipse或Qt编辑器)调试时,因为这需要网络访问。
我使用的openwrt是由秦凤玲制作的,可以在这里找到https://github.com/qinfengling/openwrt/tree/licheepi-nano要使它在OSX上工作,需要进行一些调整,一旦解决了这个图像生成问题,我将在新主题中详细介绍这些内容(一步一步地说明如何使所有内容都在OSX上工作)。
我检查了来源,发现SD卡图像生成至少由makefile和脚本gen_sunxi_sdcard_img.sh完成,可以在这里找到:https://github.com/qinfengling/openwrt/tree/licheepi-nano/target/linux/sunxi/image,我不确定是否涉及其他文件(.dts?)当我问秦凤玲如何调整这个openwrt来生成flash image时,他告诉我必须做一个配置文件:
您需要添加自己的配置文件,如果您想支持16MB闪存,可以在代码中找到一些参考:
https://github.com/openwrt/openwrt/tree/master/target/linux
我不知道如何从头重新创建一个配置文件,我已经为一个特定的应用程序(MT7628)在另一个目标上工作,它生成一个16MB的闪存图像,这是我在这里需要的F1C100S,我检查了这个目标的定义,但我不确定我可以直接将这些文件用于F1C100S配置文件。
是否有人知道应该采取什么步骤来调整当前目标配置文件以生成16MB闪存图像,或者将16MB闪存image中已经生成的另一个现有配置文件调整为当前的f1c00s目标?
谢谢您。
Hello,
update on the case, i tried the Mango suggestion, it turned out the resulting toolchain was not correct for F1C100S because MT7622 is AA64 but F1C100S is not (ARM926ej-s) however, i recalled that Qin Fengling made a OpenWRT port for F1C100S and i gave it a try. After few fixes mainly due to system headers incompatibilities with OSX:
1) two libfdt related headers had to be removed from usr/local/include (can probably be fixed in the makefile, much cleaner)
2) OSX specific definition has to be added in bch.c
你好,
更新案例,我尝试了芒果的建议,结果发现结果的工具链对于F1C100S是不正确的,因为MT7622是AA64,但F1C100S不是(ARM926EJ-S),但是,我记得秦凤玲为F1C100S做了一个openwrt端口,我尝试了一下。由于系统头文件与OSX不兼容,在进行了一些修复之后:
1)必须从usr/local/include中删除两个与libfdt相关的头文件(可能在makefile中修复,更干净)
2)必须在bch.c中添加OSX特定定义。
#ifdef __APPLE__
#include <libkern/OSByteOrder.h>
#define htobe16(x) OSSwapHostToBigInt16(x)
#define htole16(x) OSSwapHostToLittleInt16(x)
#define be16toh(x) OSSwapBigToHostInt16(x)
#define le16toh(x) OSSwapLittleToHostInt16(x)
#define htobe32(x) OSSwapHostToBigInt32(x)
#define htole32(x) OSSwapHostToLittleInt32(x)
#define be32toh(x) OSSwapBigToHostInt32(x)
#define le32toh(x) OSSwapLittleToHostInt32(x)
#define htobe64(x) OSSwapHostToBigInt64(x)
#define htole64(x) OSSwapHostToLittleInt64(x)
#define be64toh(x) OSSwapBigToHostInt64(x)
#define le64toh(x) OSSwapLittleToHostInt64(x)
#endif /* __APPLE__ */
The built was successful and now it compiles OpenWRT in about 4 minutes.
构建成功,现在它在大约4分钟内编译了openwrt。
hoel@iMac-de-Hoel-7 /Volumes/arm-linux-toolchain/openwrt (licheepi-nano *=) $ make -j9
time: target/linux/prereq#0.10#0.07#0.28
make[1] world
make[2] package/cleanup
make[2] target/compile
make[3] -C target/linux compile
make[2] diffconfig
make[2] package/compile
make[3] -C package/libs/libubox host-compile
make[3] -C package/system/fwtool host-compile
make[3] -C package/system/usign host-compile
make[3] -C package/utils/e2fsprogs host-compile
make[3] -C package/libs/ncurses host-compile
make[3] -C package/libs/toolchain compile
make[3] -C package/system/opkg host-compile
make[3] -C package/system/fwtool compile
make[3] -C package/libs/libnl-tiny compile
make[3] -C package/firmware/linux-firmware compile
make[3] -C package/libs/zlib compile
make[3] -C package/libs/libjson-c compile
make[3] -C package/firmware/prism54-firmware compile
make[3] -C package/utils/lua compile
make[3] -C package/system/openwrt-keyring compile
make[3] -C package/boot/uboot-sunxi compile
make[3] -C package/firmware/wireless-regdb compile
make[3] -C package/firmware/b43legacy-firmware compile
make[3] -C package/libs/mbedtls compile
make[3] -C package/network/services/dropbear compile
make[3] -C package/libs/libpcap compile
make[3] -C package/network/utils/linux-atm compile
make[3] -C package/network/utils/resolveip compile
make[3] -C package/utils/busybox compile
make[3] -C package/libs/libubox compile
make[3] -C package/libs/ncurses compile
make[3] -C package/network/utils/iw compile
make[3] -C package/system/usign compile
make[3] -C package/system/uci compile
make[3] -C package/system/ubus compile
make[3] -C package/utils/jsonfilter compile
make[3] -C package/libs/ustream-ssl compile
make[3] -C package/network/ipv6/odhcp6c compile
make[3] -C package/system/mtd compile
make[3] -C package/libs/uclient compile
make[3] -C package/network/config/swconfig compile
make[3] -C package/system/ubox compile
make[3] -C package/network/config/netifd compile
make[3] -C package/network/services/hostapd compile
make[3] -C package/network/services/dnsmasq compile
make[3] -C package/network/services/odhcpd compile
make[3] -C package/network/utils/iwinfo compile
make[3] -C package/system/opkg compile
make[3] -C package/system/procd compile
make[3] -C package/kernel/linux compile
make[3] -C package/kernel/mac80211 compile
make[3] -C package/network/utils/iptables compile
make[3] -C package/network/services/ppp compile
make[3] -C package/utils/util-linux compile
make[3] -C package/utils/f2fs-tools compile
make[3] -C package/utils/e2fsprogs compile
make[3] -C package/system/fstools compile
make[3] -C package/boot/uboot-envtools compile
make[3] -C package/base-files compile
make[3] -C package/network/config/firewall compile
make[2] package/install
make[2] target/install
make[3] -C target/linux install
make[2] package/index
make[2] checksum
hoel@iMac-de-Hoel-7 /Volumes/arm-linux-toolchain/openwrt (licheepi-nano *=) $
Of course i also end-up with a working toolchain for F1C100S on OSX !
So I made a template for Eclipse to test it, and as expected it works perfectly.
当然,我最后也得到了一个在OSX上用于F1C100的工作工具链!
所以我为Eclipse制作了一个模板来测试它,正如预期的那样,它工作得很好。
04:25:22 **** Incremental Build of configuration Debug for project F1C100S_TEMPLATE ****
make all
Building target: F1C100S_TEMPLATE
Invoking: Cross GCC Linker
arm-openwrt-linux-muslgnueabi-gcc -o "F1C100S_TEMPLATE" ./src/termios_cdc_acm/epoll2.o ./src/libs/gpio.o ./src/libs/gpiolib.o ./src/libs/spi.o ./src/libs/sqlite3.o ./src/gsm_serial.o
Finished building target: F1C100S_TEMPLATE
04:25:23 Build Finished (took 509ms)
Big thanks to @Quotation, @Mango and @晕哥 for the help with this, it very nice to have a working toolchain on OSX for this target.
非常感谢@Quotation, @Mango and @晕哥 的帮助,在OSX上为这个目标提供了一个工作的工具链。
Now there is still two issues to address : the first is that this OpenWRT has been modified to build an SD card image rather than a flash image and it is a problem with the Lichee Pi Nano because the only way to have netwrok connectivity (and so to debug conveniently from Eclipse / QT editor) is by using the Micro SD card wifi adapter, which of course cannot be plugged if we use SD card, i have opened a new subject for this matter : https://whycan.cn/t_2573.html#p20277
The other problem is that i did not manage to build the Lichee Pi Nano "official" linux (nano-4.14-exp) with this new toolchain. I tried to add the new toolchain to my PATH and .bash_profile, but when i add it to the bash profile :
现在仍然有两个问题需要解决:第一个问题是这个openwrt被修改为构建一个SD卡图像而不是一个flash图像,这是Lichee Pi Nano的一个问题,因为只有使用micro SD卡WiFi适配器才能实现网络连接(并从Eclipse/Qt编辑器方便地进行调试),而Micro SD卡WiFi适配器是如果我们使用SD卡,URSE就无法接通电源,我已经为此打开了一个新主题:https://whycan.cn/t_2573.html#p20277
另一个问题是,我没有用这个新的工具链构建Lichee Pi nano“官方”Linux(nano-4.14-exp)。我试图将新的工具链添加到我的路径和.bash_概要文件中,但当我将其添加到bash概要文件中时:
PATH="/Volumes/arm-linux-toolchain/openwrt/staging_dir/toolchain-arm_arm926ej-s_gcc-7.3.0_musl_eabi/bin"
the build fails directly, it doesnt even find make, so either i am doing something wrong with PATH or .bash_profile or something must be changed in the Linux makefile so that it uses this toolchain.
构建直接失败,甚至找不到make,所以要么我在路径或.bash_profile上做了一些错误的事情,要么必须在Linux makefile中更改一些内容,以便它使用这个工具链。
hoel@iMac-de-Hoel-7 /Volumes/arm-linux-toolchain/linux $ make menuconfig
-bash: make: command not found
hoel@iMac-de-Hoel-7 /Volumes/arm-linux-toolchain/linux $ make ARCH=arm menuconfig
-bash: make: command not found
When i remove this PATH from .bash_profile, then make menuconfig fail
当我从.bash_profile中删除此路径时,将使menuconfig失败
hoel@iMac-de-Hoel-7 /Volumes/arm-linux-toolchain/linux (nano-4.14-exp *=) $ make ARCH=arm menuconfig
getconf: no such configuration parameter `LFS_CFLAGS'
getconf: no such configuration parameter `LFS_LDFLAGS'
getconf: no such configuration parameter `LFS_LIBS'
HOSTLD scripts/kconfig/mconf
Undefined symbols for architecture x86_64:
"_acs_map", referenced from:
_dialog_checklist in checklist.o
_print_arrows in checklist.o
_dialog_clear in util.o
_draw_box in util.o
_dialog_inputbox in inputbox.o
_dialog_textbox in textbox.o
_dialog_yesno in yesno.o
...
"_cbreak", referenced from:
_init_dialog in util.o
"_delwin", referenced from:
_dialog_checklist in checklist.o
_dialog_inputbox in inputbox.o
_dialog_textbox in textbox.o
_dialog_yesno in yesno.o
_dialog_menu in menubox.o
"_doupdate", referenced from:
_dialog_checklist in checklist.o
"_endwin", referenced from:
_init_dialog in util.o
_end_dialog in util.o
"_flash", referenced from:
_dialog_inputbox in inputbox.o
"_getcurx", referenced from:
_init_dialog in util.o
_print_autowrap in util.o
_dialog_inputbox in inputbox.o
_dialog_textbox in textbox.o
_print_arrows in menubox.o
"_getcury", referenced from:
_init_dialog in util.o
_print_autowrap in util.o
_dialog_inputbox in inputbox.o
_dialog_textbox in textbox.o
_print_arrows in menubox.o
"_getmaxx", referenced from:
_conf in mconf.o
_dialog_checklist in checklist.o
_dialog_clear in util.o
_init_dialog in util.o
_dialog_inputbox in inputbox.o
_dialog_textbox in textbox.o
_refresh_text_box in textbox.o
...
"_getmaxy", referenced from:
_dialog_checklist in checklist.o
_attr_clear in util.o
_dialog_clear in util.o
_init_dialog in util.o
_dialog_inputbox in inputbox.o
_dialog_textbox in textbox.o
_refresh_text_box in textbox.o
...
"_has_colors", referenced from:
_init_dialog in util.o
_draw_shadow in util.o
"_init_pair", referenced from:
_init_dialog in util.o
"_initscr", referenced from:
_init_dialog in util.o
"_keypad", referenced from:
_dialog_checklist in checklist.o
_init_dialog in util.o
_on_key_esc in util.o
_dialog_inputbox in inputbox.o
_dialog_textbox in textbox.o
_dialog_yesno in yesno.o
_dialog_menu in menubox.o
...
"_newwin", referenced from:
_dialog_checklist in checklist.o
_dialog_inputbox in inputbox.o
_dialog_textbox in textbox.o
_dialog_yesno in yesno.o
_dialog_menu in menubox.o
"_nodelay", referenced from:
_on_key_esc in util.o
"_noecho", referenced from:
_init_dialog in util.o
"_scrollok", referenced from:
_dialog_checklist in checklist.o
_dialog_menu in menubox.o
"_start_color", referenced from:
_init_dialog in util.o
"_stdscr", referenced from:
_conf in mconf.o
_dialog_checklist in checklist.o
_dialog_clear in util.o
_init_dialog in util.o
_end_dialog in util.o
_dialog_inputbox in inputbox.o
_dialog_textbox in textbox.o
...
"_subwin", referenced from:
_dialog_checklist in checklist.o
_dialog_textbox in textbox.o
_dialog_menu in menubox.o
"_ungetch", referenced from:
_on_key_esc in util.o
"_waddch", referenced from:
_dialog_checklist in checklist.o
_print_item in checklist.o
_print_arrows in checklist.o
_attr_clear in util.o
_dialog_clear in util.o
_print_title in util.o
_print_button in util.o
...
"_waddnstr", referenced from:
_print_item in checklist.o
_print_arrows in checklist.o
_dialog_clear in util.o
_print_title in util.o
_print_autowrap in util.o
_print_button in util.o
_dialog_inputbox in inputbox.o
...
"_wattrset", referenced from:
_dialog_checklist in checklist.o
_print_item in checklist.o
_print_arrows in checklist.o
_attr_clear in util.o
_dialog_clear in util.o
_print_title in util.o
_print_button in util.o
...
"_wbkgdset", referenced from:
_dialog_textbox in textbox.o
_refresh_text_box in textbox.o
_dialog_menu in menubox.o
"_wclrtoeol", referenced from:
_refresh_text_box in textbox.o
_do_print_item in menubox.o
"_wgetch", referenced from:
_dialog_checklist in checklist.o
_on_key_esc in util.o
_dialog_inputbox in inputbox.o
_dialog_textbox in textbox.o
_dialog_yesno in yesno.o
_dialog_menu in menubox.o
"_winch", referenced from:
_draw_shadow in util.o
"_wmove", referenced from:
_dialog_checklist in checklist.o
_print_item in checklist.o
_print_arrows in checklist.o
_attr_clear in util.o
_dialog_clear in util.o
_end_dialog in util.o
_print_title in util.o
...
"_wnoutrefresh", referenced from:
_dialog_checklist in checklist.o
_dialog_clear in util.o
_draw_shadow in util.o
_dialog_textbox in textbox.o
_refresh_text_box in textbox.o
_dialog_menu in menubox.o
"_wprintw", referenced from:
_print_item in checklist.o
_refresh_text_box in textbox.o
"_wrefresh", referenced from:
_dialog_checklist in checklist.o
_print_item in checklist.o
_end_dialog in util.o
_dialog_inputbox in inputbox.o
_refresh_text_box in textbox.o
_dialog_yesno in yesno.o
_dialog_menu in menubox.o
...
"_wscrl", referenced from:
_dialog_checklist in checklist.o
_dialog_menu in menubox.o
"_wtouchln", referenced from:
_attr_clear in util.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [scripts/kconfig/mconf] Error 1
make: *** [menuconfig] Error 2
The issue seems to point out to ncurse, but i know ncurse is not the actual culprit because make menuconfig works fine with OpenWRT, so I guess the problem is : linux doesnt look / use the correct toolchain, maybe a makefile problem or something like that?
If i use make nconfig or make ARCH=arm nconfig, i got the menuconfig interface but the build fail afterwards anyway:
这个问题似乎指向了ncurse,但我知道ncurse并不是真正的罪魁祸首,因为make menuconfig在openwrt中工作得很好,所以我猜问题是:linux看起来/使用的工具链不正确,可能是makefile问题或类似的问题?
如果我使用make nconfig或make arch=arm nconfig,我得到了menuconfig接口,但是构建之后还是失败了:
hoel@iMac-de-Hoel-7 /Volumes/arm-linux-toolchain/linux (nano-4.14-exp *=) $ make ARCH=arm CROSS_COMPILE=arm-openwrt-linux-muslgnueabi- -j9
getconf: no such configuration parameter `LFS_CFLAGS'
getconf: no such configuration parameter `LFS_LDFLAGS'
getconf: no such configuration parameter `LFS_LIBS'
getconf: no such configuration parameter `LFS_CFLAGS'
getconf: no such configuration parameter `LFS_LDFLAGS'
getconf: no such configuration parameter `LFS_LIBS'
scripts/kconfig/conf --silentoldconfig Kconfig
getconf: no such configuration parameter `LFS_CFLAGS'
getconf: no such configuration parameter `LFS_LDFLAGS'
getconf: no such configuration parameter `LFS_LIBS'
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
UPD include/generated/uapi/linux/version.h
WRAP arch/arm/include/generated/uapi/asm/errno.h
WRAP arch/arm/include/generated/uapi/asm/bitsperlong.h
WRAP arch/arm/include/generated/uapi/asm/ioctl.h
WRAP arch/arm/include/generated/uapi/asm/msgbuf.h
WRAP arch/arm/include/generated/uapi/asm/ipcbuf.h
WRAP arch/arm/include/generated/uapi/asm/param.h
WRAP arch/arm/include/generated/uapi/asm/poll.h
WRAP arch/arm/include/generated/uapi/asm/resource.h
WRAP arch/arm/include/generated/uapi/asm/sembuf.h
WRAP arch/arm/include/generated/uapi/asm/shmbuf.h
WRAP arch/arm/include/generated/uapi/asm/siginfo.h
WRAP arch/arm/include/generated/uapi/asm/socket.h
WRAP arch/arm/include/generated/uapi/asm/sockios.h
WRAP arch/arm/include/generated/uapi/asm/termbits.h
WRAP arch/arm/include/generated/uapi/asm/termios.h
WRAP arch/arm/include/generated/asm/clkdev.h
WRAP arch/arm/include/generated/asm/current.h
WRAP arch/arm/include/generated/asm/early_ioremap.h
WRAP arch/arm/include/generated/asm/emergency-restart.h
WRAP arch/arm/include/generated/asm/exec.h
WRAP arch/arm/include/generated/asm/extable.h
WRAP arch/arm/include/generated/asm/irq_regs.h
WRAP arch/arm/include/generated/asm/kdebug.h
WRAP arch/arm/include/generated/asm/local.h
WRAP arch/arm/include/generated/asm/local64.h
WRAP arch/arm/include/generated/asm/mm-arch-hooks.h
WRAP arch/arm/include/generated/asm/msi.h
WRAP arch/arm/include/generated/asm/parport.h
WRAP arch/arm/include/generated/asm/preempt.h
WRAP arch/arm/include/generated/asm/rwsem.h
WRAP arch/arm/include/generated/asm/seccomp.h
WRAP arch/arm/include/generated/asm/segment.h
WRAP arch/arm/include/generated/asm/serial.h
WRAP arch/arm/include/generated/asm/simd.h
WRAP arch/arm/include/generated/asm/sizes.h
WRAP arch/arm/include/generated/asm/timex.h
WRAP arch/arm/include/generated/asm/trace_clock.h
HOSTCC scripts/kallsyms
HOSTCC scripts/conmakehash
HOSTCC scripts/sortextable
CC scripts/mod/empty.o
HOSTCC scripts/mod/mk_elfconfig
CC scripts/mod/devicetable-offsets.s
HOSTCC scripts/dtc/dtc.o
HOSTCC scripts/dtc/flattree.o
scripts/sortextable.c:23:10: fatal error: 'elf.h' file not found
#include <elf.h>
^
scripts/mod/mk_elfconfig.c:5:10: fatal error: 'elf.h' file not found
#include <elf.h>
^
1 error generated.
make[2]: *** [scripts/mod/mk_elfconfig] Error 1
make[2]: *** Waiting for unfinished jobs....
HOSTCC scripts/dtc/fstree.o
1 error generated.
make[1]: *** [scripts/sortextable] Error 1
make[1]: *** Waiting for unfinished jobs....
HOSTCC scripts/dtc/data.o
HOSTCC scripts/dtc/livetree.o
HOSTCC scripts/dtc/treesource.o
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/dtc/checks.o
HOSTCC scripts/dtc/util.o
SHIPPED scripts/dtc/dtc-lexer.lex.c
SHIPPED scripts/dtc/dtc-parser.tab.h
SHIPPED scripts/dtc/dtc-parser.tab.c
HOSTCC scripts/dtc/dtc-lexer.lex.o
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTLD scripts/dtc/dtc
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
UPD include/config/kernel.release
If anyone has some ideas about what i should do to adjust OpenWRT image generation for 16M flash or to build the official Lichee Pi Nano with the new toolchain, please let me know. Once everything is working fine i will make a new subject that give all the steps to :
-get working toolchain for F1C100S on OSX
-get working OpenWRT for F1C100S on OSX (with flash image)
-get working Lichee Pi Nano linux on OSX
-setup Eclipse or another IDE to build and debug applications on F1C100S for linux directly from OSX (debug via wifi)
Thank you.
如果有人对我应该做些什么来调整16M闪存的openwrt图像生成或者用新的工具链构建官方的lichee pi nano有什么想法,请告诉我。一旦一切正常,我将提出一个新的主题,给出所有步骤:
-在OSX上获取F1C100S的工作工具链
-在OSX上获取F1C100S的工作openwrt(带Flash图像)
-在OSX上运行Lichee Pi Nano Linux
-设置Eclipse或其他IDE,以便直接从OSX(通过WiFi进行调试)在F1C100S上为Linux构建和调试应用程序。
谢谢您。
光滑如婴儿皮肤
hoel@iMac-de-Hoel-7 /Volumes/EABI $ cd /Volumes/EABI/minimal_f1c100s/tools/mksunxi/
hoel@iMac-de-Hoel-7 /Volumes/EABI/minimal_f1c100s/tools/mksunxi $ make
gcc -Wall -Wextra -O2 mksunxi.c -o mksunxi
hoel@iMac-de-Hoel-7 /Volumes/EABI/minimal_f1c100s/tools/mksunxi $ cd ..
hoel@iMac-de-Hoel-7 /Volumes/EABI/minimal_f1c100s/tools $ cd ..
hoel@iMac-de-Hoel-7 /Volumes/EABI/minimal_f1c100s $ make
mkdir -p build
mkdir -p build/arch/arm32/lib
mkdir -p build/driver
mkdir -p build/lib
mkdir -p build/machine
CC main.c
(...)
arm-none-eabi-size build/firmware.elf
text data bss dec hex filename
30276 88 524424 554788 87724 build/firmware.elf
arm-none-eabi-objcopy -v -O binary build/firmware.elf build/firmware.bin
copy from `build/firmware.elf' [elf32-littlearm] to `build/firmware.bin' [binary]
Make header information for brom booting
bootloader size= 1800
The bootloader head has been fixed
hoel@iMac-de-Hoel-7 /Volumes/EABI/minimal_f1c100s $
@Quotation Thank you very much for the detailed answer and steps to get a barebone toolchain working on OSX, much appreciated ! Ultimately the goal is to setup the toolchain for Linux and uboot, however for now i want to work on UI + touch + some peripheral so your suggestion is perfect. As a first step i am going to setup the barebone toolchain, run Xboot, try LittleVGL, QT (and maybe AWTK).
Hello,
i would like to setup the toolchain for Sunxi F1C100S and F1C200S on OSX but i am struggling despite many attempts.
The reason why i want to install it on OSX rather that using Linux (Ubuntu/Debian) on a virtual machine (VirtualBox) is simple : the performance of Ubuntu on VirtualBox is too bad, so the compilation is too long, also my IDEs are all on OSX (Eclipse, QT Editor).
I have installed crosstool-ng with Homebrew, i also created an empty case sensitive volume (16GB) which is ready to use. I did not found a way yet to install the correct toolchain for F1C100S with crosstool-ng.
As a side note, i also installed a toolchain for MT7628 (RAMIPS) some time ago, everything is in a case sensitive volume and it works perfectly, it can build OpenWRT and compile C programs from Eclipse with no problem at all, it is very fast and convenient.
So the final goal is to do the same for F1C100S.
Does anyone succeed to do that or have any advce on how i should proceed?
N.B. the boards i use are the LicheePi Nano (with 5 inch LCD + capacitive touch) and the very nice F1C200S board from HQEmbed (with 5 inch LCD + capacitive touch).
Thank you !
你好,
我想在OSX上为Sunxi F1C100S和F1C200S设置工具链,但是尽管尝试了很多次,我还是在努力。
我想在OSX上安装它,而不是在虚拟机(virtualbox)上使用Linux(ubuntu/debian)的原因很简单:ubuntu在virtualbox上的性能太差,所以编译时间太长,而且我的IDE都在OSX上(eclipse,qt editor)。
我已经安装了Crosstool-ng和自制,还创建了一个空的大小写敏感卷(16GB),可以使用。我还没有找到使用Crosstool-ng为F1C100S安装正确工具链的方法。
顺便说一下,我之前也为MT7628(RAMIPS)安装了一个工具链,所有的东西都在一个区分大小写的卷中,并且工作得很好,它可以从Eclipse构建OpenWRT和编译C程序,一点问题都没有,它非常快速和方便。
所以最后的目标是对F1C100S做同样的事情。
是否有人成功地做到了这一点,或者有人对我应该如何继续工作有任何建议?
注意:我使用的是Licheepi Nano(带有5英寸LCD+电容式触摸)和HQEmbed(带有5英寸LCD+电容式触摸)的非常漂亮的F1C200S板。
谢谢您!
页次: 1