Posts for: #Toradex

MicroPython running on NXP VF6XX M4 Core

This is an experimental port of MicroPython for NXP VF6XX M4 Core.

Source code

Supported features include:

  • REPL (Python prompt) over UART2
  • Garbage collector
  • GPIO, UART support

Build

The toolchain required is the Linaro ARM Embedded toolchain (e.g. 4.9 2015 Q3):

tar xjf ${HOME}/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2
export PATH=$PATH:$HOME/gcc-arm-none-eabi-4_9-2015q3/bin/

Then build:

cd ${HOME}/micropython/vf6xx
make

Booting the M4 Core

Two methods are supported:

1. From U-Boot using bootaux:

Colibri VFxx # fatload mmc 0:1 ${loadaddr} firmware.elf
Colibri VFxx # bootaux ${loadaddr}

2. From Linux using remoteproc:

[false]

libsoc Examples on Colibri VF61

Examples using libsoc on a Colibri VF61 module with an Aster carrier board and Pioneer600 Raspberry Pi expansion cape.

Hardware

Hardware Setup

Cross-compiling libsoc

Build and install the Yocto SDK first, then:

git clone -b master https://github.com/jackmitch/libsoc.git
cd libsoc
. /usr/local/oecore-x86_64/environment-setup-armv7at2hf-neon-angstrom-linux-gnueabi
autoreconf -i
./configure --host=arm-angstrom-linux-gnueabi \
    --prefix=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/
make -j$(nproc)
sudo make install

Cross-compiling the examples

git clone https://github.com/bhuvanchandra/libsoc-examples.git
cd libsoc-examples/ssd1306/
MACHINE=colibri-vf make

Copy the binary to the target via SSH and run.

[false]

Understanding Linux LCD Display Timings

Mapping LCD/TFT display timings to Linux Kernel data structures

Most LCD/TFT display datasheets provide the following timing information:

  • Horizontal Back Porch (HBP): Number of pixel clk pulses between HSYNC signal and the first valid pixel data.
  • Horizontal Front Porch (HFP): Number of pixel clk pulses between the last valid pixel data in the line and the next hsync pulse.
  • Vertical Back Porch (VBP): Number of lines (HSYNC pulses) from a VSYNC signal to the first valid line.
  • Vertical Front Porch (VFP): Number of lines (HSYNC pulses) between the last valid line of the frame and the next VSYNC pulse.
  • VSYNC pulse width: Number of HSYNC pulses when a VSYNC signal is active.
  • HSYNC pulse width: Number of pixel clk pulses when a HSYNC signal is active.
  • Active frame width: Horizontal resolution.
  • Active frame height: Vertical resolution.
  • Screen width: Active frame width + HBP + HFP
  • Screen height: Active frame height + VBP + VFP
  • VSYNC polarity: Value of VSYNC to indicate the start of a new frame (active LOW or HIGH)
  • HSYNC polarity: Value of HSYNC to indicate the start of a new line (active LOW or HIGH)

Some datasheets provide horizontal and vertical blanking period instead:

[false]

Configuring an Embedded Linux Machine as a WiFi Hotspot

How to configure an embedded Linux board (Colibri VF61) as a WiFi access point using hostapd, udhcpd, and iptables.

Test Setup

  • Colibri VF61 V1.1A
  • Colibri Evaluation Board V3.1a / Iris V1.1
  • Ambicom WL250N-USB (Ralink RT3070 chipset)

Steps Overview

  1. Assign a static IP to wlan0
  2. Configure udhcpd as the DHCP server
  3. Configure hostapd as the AP daemon
  4. Enable IP forwarding and NAT between wlan0 and eth0
  5. Wire it all up with systemd service files

1. Static IP for wlan0

ifconfig wlan0 192.168.0.1 up

2. udhcpd configuration

/etc/udhcpd.conf:

[false]