scons编译rv32m1_vega ri5cy内核报错

发表在 内核学习营2019-7-6 19:13 [复制链接] 5 230

编译主机: win10" {% c' M* r: C& a& Y" U
env版本: env_released_1.1.2
1 y# P2 N. n0 y: U4 I内核目录: rt-thread\rt-thread\bsp\rv32m1_vega\ri5cy
/ E( w6 T4 e: J; V4 B% p  N
: ]/ J0 A2 l# L. ?0 O6 N操作步骤:0 ^* ?& R0 m& r7 ^6 u/ U
step0:  执行env.bat4 M* M+ E4 a% O! \3 ?
9 H' @; b3 m% g8 ^
: ?9 l% @2 Z5 U4 ^
step1:  执行scons, 报错如下:; h- e& z9 t& L) U
> scons
6 U. n7 a" A6 |5 i+ t6 ^' E; Cscons: Reading SConscript files ...
1 M9 N$ i8 z; n) o# w8 Q" P/ q8 \scons: done reading SConscript files.
% c: e8 f! m' C/ r; Wscons: Building targets ...
9 c' K+ |( a/ o9 j& Q. [scons: building associated VariantDir targets: build4 d" Y4 C7 u+ ?* ]- P9 V) w
CC build\applications\main.o$ g4 w3 J1 B! |- V
Error in calling command:riscv-none-embed-gcc' x  Y5 E/ A3 \: k. t( n
Exception: No such file or directory# ]$ v/ E: \  m8 K- e! n1 s

' k5 p# [, G0 e. K5 }4 l0 ~Please check Toolchains PATH setting.
( Z, K, {5 u1 o. x3 t7 ?3 F% y
3 t: z/ Y" @, I6 \1 d" F+ }scons: *** [build\applications\main.o] Error 21 v# K) r' G2 R- Q) \* f
scons: building terminated because of errors.
% T* x3 u, `% v0 L' {; J6 B
  F" H% c' d0 U( [+ w) ~! T# x- y  M2 n* {
问题:+ A8 V. j( G! P# D( u' U
riscv-none-embed-gcc 已加入系统变量
. @1 `: x* T% e( k% o+ gPS C:\Users\Administrator> riscv-none-embed-gcc
5 s0 W5 \& }/ a# m' D/ Jriscv-none-embed-gcc.exe: fatal error: no input files6 p; t' e3 j% G' i9 B, Y
compilation terminated.! t, I* E4 T1 a- {: P$ k
3 P$ [: o- T3 `: h- k" r& c

" [9 ], u9 @, ^6 N! u; [: p还有什么设置要做?  麻烦各位了。/ ]" m7 }) W. S7 Z" b
使用道具 举报 显示全部楼层 回复
最新评论 | 正序浏览
显示全部楼层 |楼层直达:
发表于 2019-7-8 08:56:08 | 显示全部楼层
env是属于主动设置环境变量,所以你需要在env里把环境变量设置下,指向到你按照RISC-V GCC的目录6 R/ O5 j& j6 c" Z2 B
  @2 C6 @, U  R. O6 ?2 I
例如在env终端控制台下,输入命令进行设置:
$ Q1 X8 {( ~5 {. ?/ g' m- N+ `; R3 C) }* U$ ?8 h+ |
set RTT_EXEC_PATH=E:\Tools\env\tools\ConEmu\ConEmu\..\..\..\tools\gnu_gcc\riscv64\bin# ^- p3 S4 H, S% M% e6 \1 c  ]8 R$ A
. Y' X/ x/ H; e5 L. @# l  v! D
方便起见,你也可以在env/conemu中主动配置一项RISC-V相关的配置。可以把
; L! W6 y$ _: e% w9 |6 {8 G' y9 [) C' t" Y) j3 `
env\tools\ConEmu\ConEmu\CmdInit.cmd
" H/ C1 R; ]; M9 c/ D& I6 K. N1 Q& ?6 _
修改下,命名成CmdInitRV.cmd(如果你只用RISC-V,则直接改上面文件也就可以了)
使用道具 举报 回复
发表于 2019-7-8 09:26:01 | 显示全部楼层
scons 会在 rtconfig.py 里面获取工具链+ l" c2 C; A/ Z& w/ [1 s
  y. r0 V7 t6 Y( g% \6 a, P  R4 C$ n
  1. if  CROSS_TOOL == 'gcc':
    2 i9 L3 Q, [1 P( M8 q/ k
  2.     PLATFORM    = 'gcc'5 |: {: d2 X* ~
  3.     EXEC_PATH   = r'/opt/unknown-gcc/bin'
    $ {/ S% [8 B/ q* P2 U
  4. else:
    # y) Z) A8 \3 j( l$ z* T
  5.     print('Please make sure your toolchains is GNU GCC!')
    - D' M2 A$ l8 u0 f
  6.     exit(0)
    ( F3 h- N+ J# s2 i0 f, `
  7. 3 d& F$ Y  e0 h4 `* {; ?* M
  8. if os.getenv('RTT_EXEC_PATH'):
    1 G3 a! T" Z: A6 P. s/ }! g9 `
  9.     EXEC_PATH = os.getenv('RTT_EXEC_PATH')
复制代码
使用道具 举报 回复
发表于 2019-7-8 09:48:48 | 显示全部楼层
wuhanstudio 发表于 2019-7-8 09:26
$ J; N( w" l3 m: G* D" `scons 会在 rtconfig.py 里面获取工具链
( C2 t( X, r( i  `1 W9 f
但是会优先使用环境变量的,所以对于env,还是一定得配环境变量,仅rtconfig.py中配置会被覆盖掉的。
使用道具 举报 回复
发表于 2019-7-8 11:08:37 | 显示全部楼层
bernard 发表于 2019-7-8 09:48
+ U8 Y" ?9 ~) x9 R2 C但是会优先使用环境变量的,所以对于env,还是一定得配环境变量,仅rtconfig.py中配置会被覆盖掉的。 ...
; @$ E6 r) B4 e) }) h
哈哈,熊大说得对,RTT_EXEC_PATH 得要,想和他说明一下 scons 的配置文件在哪里可以找到
使用道具 举报 回复
发表于 2019-7-8 15:26:47 | 显示全部楼层
感谢各位的帮助, 已成功构建:
) d% n6 z* s6 N8 N$ H; C) V
% X2 m0 S! \! W$ c> scons* R# V4 c- M& X3 D" v$ g
scons: Reading SConscript files ...
7 H) A" ~" R* Z  I! i  T0 H9 H; Pscons: done reading SConscript files.: ]2 i  C: d4 e- |7 K
scons: Building targets ...  X" H, R  A$ N8 o( [# Z
scons: building associated VariantDir targets: build4 P' R4 p/ e# n: c' o+ B+ x7 o7 t& O4 f
CC build\applications\main.o
* H: S3 i1 }2 Y( l% W5 YCC build\applications\mnt.o: U8 }0 H' p7 z( Y6 S
CC build\board\board.o
; q+ O( I2 i: l! ^% R" @' g) aCC build\board\clock_config.o
5 k2 b. U" r, ]! r8 m  i0 VCC build\board\fsl_host.o
+ a1 C' x0 i3 J; T3 JCC build\board\pin_mux.o
; _, h! X+ |$ ZCC build\driver\drv_gpio.o$ Z* ?, @* G( ?4 O2 D2 k( Z; o5 y
CC build\driver\drv_sdcard.o
; _$ m+ ^, _$ D  c1 MCC build\driver\drv_uart.o
! t& d0 a+ p% R& QCC build\kernel\components\dfs\filesystems\devfs\devfs.o* z  Y) r) k  n) v/ m
CC build\kernel\components\dfs\filesystems\elmfat\dfs_elm.o3 \  b$ `$ I6 p3 ?; s) ?* L7 {: V
CC build\kernel\components\dfs\filesystems\elmfat\ff.o: L/ Y) q7 h) H; H2 g4 H
CC build\kernel\components\dfs\filesystems\elmfat\option\ccsbcs.o7 {! u* p: ~4 S: d2 z
CC build\kernel\components\dfs\src\dfs.o+ r; q' W1 D' k/ m6 m
CC build\kernel\components\dfs\src\dfs_file.o
! ?# `& o) R# M7 iCC build\kernel\components\dfs\src\dfs_fs.o
, \3 J: K, m! U3 @2 T6 o1 {CC build\kernel\components\dfs\src\dfs_posix.o
! b# a6 f% m, J! A7 ^' U0 pCC build\kernel\components\dfs\src\poll.o
  u4 Y$ v$ l0 f, G  g7 dCC build\kernel\components\dfs\src\select.o* e% Q; J5 N- H' ?3 ^8 ^5 P
CC build\kernel\components\drivers\misc\pin.o" L8 ?: v' {/ b7 v, Z( v! D
CC build\kernel\components\drivers\rtc\rtc.o& Z$ d, n" `4 X5 M0 ]$ u* o
CC build\kernel\components\drivers\serial\serial.o
- f- y' v) l5 k0 @0 q$ l- LCC build\kernel\components\drivers\src\completion.o# d7 F$ t" \+ R. v" p, e
CC build\kernel\components\drivers\src\dataqueue.o5 E3 H" C& w" |2 c( U, e
CC build\kernel\components\drivers\src\pipe.o9 g2 X3 F% Z" l; ]1 j
CC build\kernel\components\drivers\src\ringblk_buf.o
5 F- x+ j0 z0 a, q7 y5 I& bCC build\kernel\components\drivers\src\ringbuffer.o
; v# S$ q4 x* t: W7 }" U5 lCC build\kernel\components\drivers\src\waitqueue.o
! o' N$ Y2 i3 \  rCC build\kernel\components\drivers\src\workqueue.o
( ]% r5 k/ H& {9 F0 B3 q, R% m, ?CC build\kernel\components\finsh\cmd.o
/ P$ _1 z- u8 D+ c7 iCC build\kernel\components\finsh\msh.o
! g) B- Z$ L' G; j" Z# DCC build\kernel\components\finsh\msh_cmd.o, j8 M* H( @5 ^1 n
CC build\kernel\components\finsh\msh_file.o4 q) U6 d% g  L& C. B8 [& {4 X1 k
CC build\kernel\components\finsh\shell.o
) T& b+ ^& H6 BCC build\kernel\components\finsh\symbol.o7 T! o; T6 [9 _# `5 N
CC build\kernel\components\libc\compilers\common\gmtime_r.o
6 k' W; o4 A; O% H( pCC build\kernel\components\libc\compilers\newlib\libc.o
9 l2 T0 a4 @* n7 ~( VCC build\kernel\components\libc\compilers\newlib\libc_syms.o
% b' a" _$ w; f$ \3 d* K, ^CC build\kernel\components\libc\compilers\newlib\stdio.o
' t8 C3 D% u$ `8 vCC build\kernel\components\libc\compilers\newlib\syscalls.o' e! C9 d3 l9 U7 Q! Y
CC build\kernel\components\libc\compilers\newlib\time.o
( F. D: G' r1 o1 ?- A% [% P( ICC build\kernel\components\utilities\ulog\backend\console_be.o$ A3 y% H; }2 J, G% c1 L( M
CC build\kernel\components\utilities\ulog\ulog.o
3 ?9 D' u" E9 L8 J) AAS build\kernel\libcpu\risc-v\common\context_gcc.o5 K/ [2 G) f5 Z4 m9 u
CC build\kernel\libcpu\risc-v\common\cpuport.o
, s. A- @" Z# }- _: U7 FCC build\kernel\libcpu\risc-v\rv32m1\interrupt.o* }3 S; w* P, s, A) ~  t; s0 F
AS build\kernel\libcpu\risc-v\rv32m1\interrupt_gcc.o
. y0 f) ~! X4 _6 H( bCC build\kernel\src\clock.o
, `  M& l$ e7 u2 }+ K+ Y' Q  VCC build\kernel\src\components.o% Y( y: Y- }! B& l( w' L
CC build\kernel\src\cpu.o
# `+ @0 Z6 V" J8 k4 TCC build\kernel\src\device.o4 C1 A1 [( l9 a1 H6 B: _; \
CC build\kernel\src\idle.o
2 k: J+ |/ h9 R( i5 O2 tCC build\kernel\src\ipc.o
: }( o: V1 W3 O) [/ _; Z! rCC build\kernel\src\irq.o
4 h" R" g/ g4 b, N3 ]" p- U& v. Q/ nCC build\kernel\src\kservice.o
" P8 P* m7 j, }6 g! D( B) z9 u3 n/ WCC build\kernel\src\mem.o
. k/ q& v  _# T9 |; OCC build\kernel\src\mempool.o* i2 [7 N2 r2 l$ t& E# S6 m
CC build\kernel\src\object.o  ?- i. T& V+ Y# b' S
CC build\kernel\src\scheduler.o  y* i/ Y  k: g- H; r
CC build\kernel\src\signal.o( t2 j# S' a0 c& |1 P8 F
CC build\kernel\src\thread.o  h; d; c1 s1 Q% {) k* G+ l
CC build\kernel\src\timer.o2 w4 F& p/ @( F5 d% n
CC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\system_RV32M1_ri5cy.o
2 z* c' g1 A- s" DCC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\drivers\fsl_clock.o6 P  A: c$ K  T" \0 C( \; K
CC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\drivers\fsl_common.o
4 C1 p5 p' X. F8 ]CC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\drivers\fsl_lpuart.o
# {' O& \* o3 f. i: I$ g6 WCC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\drivers\fsl_gpio.o
, j9 v" {: F! QCC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\drivers\fsl_msmc.o
* v* M+ a5 ]1 r. a* N9 tCC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\drivers\fsl_usdhc.o
! K9 y; }0 g6 t6 y' Q) PCC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\drivers\fsl_intmux.o" _) z* b: h) ?, W7 ~
AS E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\gcc\startup_RV32M1_ri5cy.o
8 w3 W2 ^: ~* Q0 ]. |CC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\sdmmc_2.1.2\src\fsl_sd.o
8 t. w2 s- O- p! X% r3 m6 O7 qCC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\sdmmc_2.1.2\src\fsl_sdmmc.o" @, O; y- ?3 ~
LINK rtthread.elf, i/ B9 T2 Z; O
riscv-none-embed-size rtthread.elf
" W$ S$ E4 C' S3 J, X  j- `& ]   text    data     bss     dec     hex filename
: y" a0 L! }; X! P2 t) M 241008    2452    7684  251144   3d508 rtthread.elf
; L' \, z( ]9 d( L( u* K: F4 ?  `scons: done building targets.
使用道具 举报 回复
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|RT-Thread开发者社区 ( 沪ICP备13014002号-1

有害信息举报电话:021-31165890 手机:18930558079

© 2006-2019 上海睿赛德电子科技有限公司

Powered by RT-Thread

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