We want to use ADC for fixed-frequency downsampling, and we want to use IIO buffer interface to meet our requirements. After the CONFIG_IIO_SYSFS_TRIGGER=y is enabled in the kernel configuration, the corresponding interface appears. As shown in the picture below:
After our tests, the cache is now available, and the maximum available sampling frequency provided by the system is 206250, as shown in the figure below:
But now we need a higher sampling frequency. Through reading the manual, we know that the maximum sampling frequency of the development board is 1MHZ. How should we set this?
The current device tree configuration is as follows:
Thank you!
could you tell me which version of BSP are you using?
# The test procedure is as follows:
# Test buffer cache for ADC continuous acquisition
# First make sure iio_sysfs_trigger is enabled by the kernel
# The sampling frequency available in the driver is as follows:
206250 58098 29676 15000 7541
Currently test 58098 29676 15000 7541 available, 206250 will cause a stuck situation.
# The test procedure is as follows:
# 1. Jump to devices
cd /sys/bus/iio/devices
# 2. Create a trigger
echo 0 > iio_sysfs_trigger/add_trigger
# 3. trigger write
cat trigger0/name > iio:device0/trigger/current_trigger
# 4. Check the trigger
cat iio:device0/trigger/current_trigger
# 5. Enter the iio device
cd iio:device0
# 6, Change the sampling frequency (default sampling frequency is 58098)
echo 206250 > in_voltage_sampling_frequency
# 7. Check the sampling frequency
cat in_voltage_sampling_frequency
# 8. Enable scanning
echo 1 > scan_elements/in_voltage3_en
# 9. Check the scan
cat scan_elements/in_voltage3_en
# 10. Cache size settings
echo 1024 > buffer/length
# 11. Enable cache
echo 1 > buffer/enable
# 12. Close the cache
echo 0 > buffer/enable
# 13. Check available data
cat buffer/data_available
# 14. Print data
hexdump -e '"iio0 :" 8/2 "%04x " "\n"' /dev/iio:device0
We build systems based on nxp 2020.10 uboot, 4.19.35 or 4.19.71 kernels, and the image-builder project.
The kernel source code is as follows:
Embedfire/ebf_linux_kernel at ebf_4.19.35_imx6ul (github.com)
The device tree is as follows:
The device tree plug-in is as follows:
The uboot is as follows:
Embedfire/ebf_linux_uboot at ebf_v2020_10_imx (github.com)
The image-builder project is described as follows:
23. 构建野火鲁班猫镜像 — [野火]嵌入式Linux镜像构建与部署——基于LubanCat-i.MX6ULL-MP157开发板 文档 (embedfire.com)
and
24. image-builder编译流程及用户配置 — [野火]嵌入式Linux镜像构建与部署——基于LubanCat-i.MX6ULL-MP157开发板 文档 (embedfire.com)
Thank you!
We are based on nxp's uboot version 2020.10, kernel version 4.19.35, and debian system customized by the image-builder project.
Item description Address:
23. 构建野火鲁班猫镜像 — [野火]嵌入式Linux镜像构建与部署——基于LubanCat-i.MX6ULL-MP157开发板 文档 (embedfire.com)
Project source code:
https://gitee.com/Embedfire/ebf-image-builder.git
Kernel source address:
Embedfire/ebf_linux_kernel at ebf_4.19.35_imx6ul (github.com)
Uboot source address:
Embedfire/ebf_linux_uboot at ebf_v2020_10_imx (github.com)