Rustわからん (raspberry pi corss compile編)
前提
Raspberry Pi Zero HW
SH1106使う
WS-13890
1.3inch_OLED_HAT
コンパイラ?
cross
クロスコンパイルだいたいできそう
arm-unknown-linux-gnueabi
わからんがこれは動く
hello world
target triple
hello world on Raspi Zero
arch
arm -> o
armv7 -> 多分だめ?
hfじゃないのが無い
abi
gnueabi -> o
gnueabihf -> x
musleabi -> o
musleabihf -> x
arm-unknown-linux-musleabihf
いけた
色々
eh_personality
error: language item required, but not found: eh_personality
HAL / I2C / SPI
Error
error: linking with arm-linux-musleabihf-gcc failed: exit code: 1
= note: /rust/lib/rustlib/arm-unknown-linux-musleabihf/lib/crt1.o: In function `_start_c':
/build/musl-1.1.22/crt/crt1.c:18: undefined reference to `main'
collect2: error: ld returned 1 exit status
linux-embedded-halくさい
panic_handler function required, but not found
code:rust
fn my_panic(_info: &core::panic::PanicInfo) -> ! {
loop {}
}
error: language item required, but not found: eh_personality
code:rust
panic = "abort"
panic = "abort"
OLED
i2cdetectが動いてない?
Key
Raspberry Pi側
raspi-gpio
キー操作するには、下記必要だった
sudo vim /boot/config.txt
gpio=6,19,5,26,13,21,20,16=pu
できた