Accessing HI-8435 via SPI from Jetson TX2

Hi,
I am trying to access the hi-8435 (by HOLT) via SPI. This device is a Supply/Open sensor.

The driver for this chip is provided in the L4T kernel, thus I have run ./getKernelSources.sh and was provided the Kernel Configuration application were I looked for the driver and checked it to be included in the kernel as a driver. This driver depends on the SPI and IIO.

I saved this configuration and exit the application, and completed the kernel update with ./makeKernel.sh and ./copyImage.sh and reset the board.

I have made the relevant connections of MISO, MOSI, CS0 and clock between the evaluation board and J21 (pins 24, 23, 21 ,19).

I have also updated the device tree and flashed it correctly (I verified it by the following command which created a text version of the dtb: dtc -I fs -O dts -o ~test_dtc/tree_from_proc_verify.dts /proc/device-tree). The spi portion looks now like this:
spi@3240000 {
compatible = “nvidia,tegra186-spi”;
reg = <0x0 0x3240000 0x0 0x10000>;
interrupts = <0x0 0x27 0x4>;
nvidia,dma-request-selector = <0x19 0x12>;
#address-cells = <0x1>;
#size-cells = <0x0>;
#stream-id-cells = <0x1>;
dmas = <0x19 0x12 0x19 0x12>;
dma-names = “rx”, “tx”;
nvidia,clk-parents = “pll_p”, “clk_m”;
clocks = <0xd 0x4a 0xd 0x10d 0xd 0x261>;
clock-names = “spi”, “pll_p”, “clk_m”;
resets = <0xd 0x2b>;
reset-names = “spi”;
status = “okay”;
linux,phandle = <0x80>;
phandle = <0x80>;
sensor@0 {
compatible = “holt,hi8435”;
reg = <0>;
# gpios = <&gpio6 1 0>;
spi-max-frequency = <1000000>;
};

};
Now, upon reboot I was expecting the invocation of the driver by the device tree manager (hope I name it correctly). But I did not find the device neither in /dev nor in the initial log (via dmesg).

Could you please advise on this matter? Am I doing something wrong?

Thanks,
Igal

Try to put more message to the hi-8435 probe function to debug.

@ShaneCCC,
thanks for the reply.

The problem is that although I have applied the above process, I could not find the hi8435.ko file on the target (Jetson TX2 evaluation board), or any file that resembles the driver (hi*.ko, 8435.ko).

It looks like the ./makeKernel.sh did not compile the driver’s sources.
The only files that I have found were:

  • /usr/src/kernel-4.4/include/cofig/hi8435.h
  • /usr/src/kernel-4.4/drivers/iio/adc/hi8435.o
  • /usr/src/kernel-4.4/drivers/iio/adc/hi8435.c

So this is a too early stage to add messages to the probe.

Please advise.

Igal

You can see the .o means it already compile as build-in module. You just need to replace the Image that will include this driver.