Colibri iMX6 512MB IT v1.1B
Colibri Evaluation Board v 3.2B
torizon-core-docker-evaluation-colibri-imx6-Tezi_5.6.0-devel-202202+build.21.container.tar
Hi guys,
I have been surfing around for how to get my SPI bus up and running as quickly as possible.
I understand the quickest way to do this is to use TorizonCore’s device tree overlays,
(i.e. do NOT try to build your own (custom) TorizonCore image, with a device tree, but use a pre-built image and override the device tree with the overlay.)
It seems there is still lot of work to do here, but here is a short checklist of what resources I have found, and what I have done so far (added incase others find this useful, I added some errors I bumped into along the way… my actual question is further down)
INSTALL TorizonCore Builder on your PC
Note that you cannot close the session, or you may have to start this procedure from scratch (environment variable will be lost)
Create and enter a working directory where your customization will be stored:
$ mkdir ~/tcbworkdir
$ cd ~/tcbworkdir
Use the setup script named tcb-env-setup.sh, available on the Toradex Github]tcb-env-setup/tcb-env-setup.sh at master · toradex/tcb-env-setup · GitHub
to setup TorizonCore Builder:
$ wget https://raw.githubusercontent.com/toradex/tcb-env-setup/master/tcb-env-setup.sh
$ source ./tcb-env-setup.sh
Error: -sh: source: tcb-env-setup.sh: file not found
Error: could not pull TorizonCore Builder from Docker Hub!
Are you doing this on the target? Should be on your PC!
WATCH the video:
It shows you how to:
-create a template
$ torizoncore-builder build --create-template
-edit the template carefully in vi
- (for non-linux people: i to edit, esc to stop editing, :w to save :q to quit)
- remember that every uncommented line needs all headings above it to be uncommented as well
-download the latest image from:
Toradex Download Links (Torizon, Linux BSP, WinCE and Partner Demos) | Toradex Developer Center - copy the image to the working directory
-download a docker-compose-example.yml file (32 bits for the iMX6) - find an example .dts file and copy into working directory
- modify the example as explained here:
Device Tree Customization Examples (toradex.com)
I found another thread which suggests the following changes to his .dts file:
diff --git a/arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi b/arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi
index 1db5aa5..28a8bc7 100644
--- a/arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi
+++ b/arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi
@@ -101,14 +101,14 @@
interrupt-parent = <&gpio5>;
interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
spi-max-frequency = <10000000>;
- status = "okay";
+ status = "disabled";
};
spidev0: spidev@0 {
compatible = "toradex,evalspi";
reg = <0>;
spi-max-frequency = <23000000>;
- status = "disabled";
+ status = "okay";
};
};
RUN torizoncore-builder
$ torizoncore-builder build
Here is where I made it so far… Now I have parsing errors.
=>Parsing errors found:
tcbuild.yaml: ‘source-dir’ is a required property, while parsing /customization/kernel/modules/1
CODE
I found the SPI API described here:
SPI Lib API (toradex.com)
but it does not seem to mention the iMX6 so I don’t know if its the right link for me.
Sorry if this post was a little long…
My questions are:
- Which .dts example should I start with for Colibri-Eval-Board and iMX6, and where to find it?
- How to fix parsing errors above (source-dir) am I supposed to define this as an environment variable
- Once I have the device tree overlay working, how to test?
- by command line
- by spidev.c
- Is there other example code for the Colibi-Eval-Board which I should know about, like using the CAN bus? I have not found any examples yet, not even to flash an LED.
- The note about not shutting down your session is worrysome. What can I do to ensure I can repeat these steps properly in the future?
- what do I include in my .h file. I have tried various versions of
#include <spi/spi.h>
but it not found by the linker.