[yocto] SAMA5D3 header files for C application development

Bryan Evenson bevenson at melinkcorp.com
Wed Jul 1 06:08:37 PDT 2015


Sam,


> From: yocto-bounces at yoctoproject.org [mailto:yocto-bounces at yoctoproject.org] On Behalf Of SAS NONE
> Sent: Wednesday, July 01, 2015 12:36 AM
> To: yocto at yoctoproject.org
> Subject: [yocto] SAMA5D3 header files for C application development
>
> Hi,
>
> I'm using SAMA5D3-xplained board and built a Linux kernel 3.18 distro for it using the Poky Yocto build directory.  I've also created the sdk and installed it in /opt/poky-atmel/1.7.2.  Ran hello world example in eclipse however I'm trying to find the C header files for the peripherals so I can develop applications using the SPI bus or the i2c bus.  Any help in locating these header files or how to go about developing and cross compiling the C code in eclipse?  I've already looked at the Yocto adt manual for eclipse which is very minimum.
> 
> Any help is greatly appreciated.

I'm assuming based on your questions that you are new to the device tree setup for ARM in the Linux kernel and how to make use of it on the kernel side and the userspace side.  If so, I'd suggest you go to http://www.at91.com/linux4sam/bin/view/Linux4SAM/LinuxKernel and read the documentation linked in the "Changes introduced by Device Tree Support section".  Then Atmel has documentation specific to their SPI and I2C with the Linux kernel documentation.  Look under Documentation/devicetree/bindings/spi/spi_atmel.txt and Documentation/devicetree/bindings/i2c/i2c-at91.txt in your kernel source.

In summary, if you are lucky enough that the device you want to communicate with has device tree support, then you would add that device to your device tree files and follow their documentation on how to communicate with it from userspace.  For example, I am using the AD5446 DAC on my hardware, and Analog Devices has excellent documentation of their DAC Linux kernel driver here: http://wiki.analog.com/resources/tools-software/linux-drivers/iio-dac/ad5446.  For this device I open up a file and write a value for the desired output voltage, and then the driver takes care of communicating to the AD5446.  Otherwise I think you can use the generic spidev interface for reading and writing data on the SPI port (and I think there is something similar for I2C?).

Since you have questions that are specific to your hardware, I think you may be able to get better answers on Atmel's AT91 forums or checking for information on Linux kernel driver support for your specific I2C and SPI devices.  If you are having problems building an application with the Eclipse ADT and getting to run on your hardware, then let us know some specific details with the problems you are seeing.

Regards,
Bryan

> 
> Thanks,
> 
> Sam


More information about the yocto mailing list