Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
RISC-VボードでRustを動かす話
Search
Daniel
July 03, 2019
Technology
1
950
RISC-VボードでRustを動かす話
最近買ったRISC-VボードHifive1 RevBの上でRustを動かす話です。(時間の関係ではなせなかった部分が少し増えてます)
Daniel
July 03, 2019
Tweet
Share
More Decks by Daniel
See All by Daniel
Juliaで機械学習
peshogo
2
800
一年生へ
peshogo
1
73
炭酸飲料が飲めない学校で炭酸飲料を飲めるよにした話
peshogo
0
92
Other Decks in Technology
See All in Technology
会社紹介資料 / Sansan Company Profile
sansan33
PRO
11
390k
投資戦略を量産せよ 2 - マケデコセミナー(2025/12/26)
gamella
0
590
First-Principles-of-Scrum
hiranabe
2
960
Everything As Code
yosuke_ai
0
480
ルネサンス開発者を育てる 1on1支援AIエージェント
yusukeshimizu
0
130
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
12k
Oracle Cloud Infrastructure:2025年12月度サービス・アップデート
oracle4engineer
PRO
0
180
技術選定、下から見るか?横から見るか?
masakiokuda
0
170
人工知能のための哲学塾 ニューロフィロソフィ篇 第零夜 「ニューロフィロソフィとは何か?」
miyayou
0
320
Agentic AIが変革するAWSの開発・運用・セキュリティ ~Frontier Agentsを試してみた~ / Agentic AI transforms AWS development, operations, and security I tried Frontier Agents
yuj1osm
0
200
コールドスタンバイ構成でCDは可能か
hiramax
0
130
松尾研LLM講座2025 応用編Day3「軽量化」 講義資料
aratako
15
4.9k
Featured
See All Featured
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
140
A Modern Web Designer's Workflow
chriscoyier
698
190k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
120
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
0
1.8k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.5k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
120
YesSQL, Process and Tooling at Scale
rocio
174
15k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
170
Mobile First: as difficult as doing things right
swwweet
225
10k
Transcript
RISC-VボードでRustを動かす話
⾃⼰紹介 Self Self { { name name: : " ダニエル"
" ダニエル", , school school: : " 東京農⼯⼤学" " 東京農⼯⼤学", , twitter twitter: : "@daniel_program" "@daniel_program", , } }
RISC-V
RISC-Vとは… CPUのオープンソースな命令セット(ISA)の⼀種
HIFive RevB HIFive RevB のページ
HIFive RevB Hifive RV IMAC Rust riscv imac-unknown-none-elf このボード向けにコンパイルできるのでは?
やってみた C⾔語からRustを呼び出す Rust単体で実⾏する
Cから呼び出す rustから使いやすいようにCを書く rustを書く staticlib として書き出す cbindgenで.h ファイルを作る ⼀緒にコンパイルする
rustから使いやすいようにCを書く freedom-e-sdk void void led_on led_on( () ) { {.
.. .. .} } void void led_off led_off( () ) { {. .. .. .} } int int main main( () ) { { . .. .. . blink_rs blink_rs( () ); ; } }
rustを書く extern extern { { fn fn led_on led_on( ()
); ; fn fn led_off led_off( () ); ; } } #[no_mangle] #[no_mangle] pub pub extern extern fn fn blink_rs blink_rs( () ) { { loop loop { { unsafe unsafe{ { led_on led_on( () ); ; } } delay delay( () ); ; unsafe unsafe{ { led_off led_off( () ); ; } } delay delay( () ); ; } } } }
staticlib Cargo.toml [ [package package] ] name name = =
"blink" "blink" version version = = "0.1.0" "0.1.0" authors authors = = [ ["Daniel" "Daniel"] ] edition edition = = "2018" "2018" [ [lib lib] ] crate-type crate-type= =[ ["staticlib" "staticlib"] ] [ [dependencies dependencies] ]
cbindgen $ cargo $ cargo install install cbindgen cbindgen $
cbindgen $ cbindgen . . .. .... .. void blink_rs void blink_rs( (void void) ); ;
⼀緒にコンパイルする コンパイラにstaticlib も投げればコンパイルしてくれる。 今回はMakefile の依存関係に書くだけでコンパイルしてくれた。
Rust単体で実⾏する Github - riscv-rust-quickstart https://github.com/riscv-rust/riscv-rust-quickstart
"cargo run " で実⾏ができる!
Example leds_blinkでLチカができている
None
実⾏はしっかりできます
まとめ riscvボードでRustは動かせる。 Cとつなげるのは⾯倒くさい ライブラリ周りがまだしっかりしていない
ありがとうございます! @daniel_program