I want read status of button KEY CanMVk230 kit

Viewed 76

重现步骤

i check path /sys/class/gpio
But i don't find that

期待结果和实际结果

软硬件版本信息

k230 CanMv
K230_linux_sdk

错误日志

尝试解决过程

How do I configure buildroot? And do I need to make any edits?

补充材料

1 Answers

echo "CONFIG_GPIO_SYSFS=y" >> buildroot-overlay/board/canaan/k230-soc/linux.fragment

,or make linux-menuconfig and enable CONFIG_GPIO_SYSFS=y.

i fix it ok, base address is 512, so echo 533 to /export.

when i echo 21 > /sys/class/gpio/export
[ 4053.284053] export_store: invalid GPIO 21
sh: write error: Invalid argument

in k230_canmv_01studio.dts,
// KEY_GPIO21
(IO21) ( 0<<SEL | 0<<SL | BANK_VOLTAGE_IO14_IO25<<MSC | 1<<IE | 1<<OE | 0<<PU | 0<<PD | 15<<DS | 1<<ST )
How can i fix this issue?