A pure Golang implementation of Rockchip rknand
vendor storage interface.
package main
import (
"fmt"
"github.com/jamesits/go-rkvendorstorage"
)
func main() {
size, data, err := rkvendorstorage.Read(rkvendorstorage.IDVendorSN)
fmt.Printf("size=%d, data=%s, err=%s\n", size, string(data), err)
}
See read_test.go for more examples.
- Linux is the only OS supported for now
- An artificial 1024-byte limit is applied to the read/write buffer
- Endianness is hardcoded as little endian
If you have valid use cases that exceed the current limitations, please raise an issue.
The following articles are referenced during the development of this library:
- rktoolkit/vendor_storage.c
- RK Vendor Storage Application Note
- Golang ioctl sample
- Another random ioctl sample
Thank Qingping for sponsoring some RK3128 development boards.