Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Embedded Linux Development with i.MX6ULL: Environment Setup and Basic Concepts

Tech 1

System Configuration and Fundamental Concepts

Hardware and Virtual Machine Setup

For embedded Linux development, the setup involves a development board, a Windows machine, and a virtual environment.

There are three network adapter modes for virtual machines:

  1. VMnet1 (Host-Only): Enables communication between VMs and the host, but prevents internet access.
  2. VMnet8 (NAT): Allows internal communication and provides internet access via the host, but external access to the VM is blocked.
  3. VMnet0 (Bridged): Treats the VM as a physical device on the network, allowing full access and connectivity.

To connect the development board with the virtual machine, configure the VM in bridged mode and assign both devices the same subnet IP address:

Ubuntu IP: 192.168.5.11
Development Board IP: 192.168.5.9

Both devices must also be connected to the same router via Ethernet cable.

Serial Communication

The development board requires a USB-to-serial converter chip to enable serial communication.

Cross-Compilation Toolchain

A cross-compilation toolchain is essential for building software for the target architecture.

Linux Environment Variables

Environment variables link paths to system resources, simplifying command execution by replacing long paths with varible names.

Core Linux Commends

Common commands for system management include:

  • df -h: Disk usage overview
  • top or ps: Process monitoring
  • kill -9: Force process termination
  • free: Memory status
  • echo: Output text
  • whereis: Locate files
  • touch, cat: File creation and viewing
  • unzip, tar: Archive handling
  • chmod: Permission control (read=4, write=2, execute=1)
  • grep: Text search within files

Archiving and Compression

TAR

  • tar -zcvf test.tar.gz ./test: Compress directory using gzip
  • tar -cvf test.tar ./test: Create uncompressed tar archive
  • tar -cjf test.tar.bz2 ./test: Compress with bzip2
  • tar -czf test.tar.Z ./test: Compress with compress

Decompression:

  • tar -xzvf test.tar.gz: Extract gzip-compressed archive
  • tar -xvf test.tar: Extract standard tar archive
  • tar -vxjf test.tar.bz2: Extract bzip2 archive

ZIP

  • zip -r mydata.zip mydata: Compress directory
  • unzip mydata.zip: Extract zip file

GZ

  • gzip 1.txt: Compress single file (not directories)
  • gzip -d 1.txt.gz: Decompress gz file

GREP

  • grep "example" demo.txt: Search for pattern in file
  • grep -r "Hello" /opt/: Recursively search directory

Kernel Compilation Essentials

Key configuration files for kernel compilation:

  • .config: Generated configuration used during build
  • defconfig: Default configuration file; used when .config is missing

The path for defconfig files on the system:

/home/xzj/Desktop/linux-imx-rel_imx_4.1.15_2.1.0_ga/arch/arm/configs
  • Kconfig: Provides options for menuconfig interface

Device Tree and Kernel Image

Device trees (.dts) define hardware details like memory layout and clock configurations. These are compiled into .dtb files.

Kernel images (.bin) contain core OS components and data structures necessary for runtime resource management.

The build process generates an image which is compressed into zImage format.

Development Environment Setup

Installing Cross-Compilation Toolchain

Copy the toolchain to /usr/local/arm/ and update the environment:

sudo vi /etc/profile
export PATH=$PATH:/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin

Install required libraries:

sudo apt-get install lsb-core lib32stdc++6

Verify installation:

arm-linux-gnueabihf-gcc -v
gcc -v

Remote Access Using VSCode

On the VM:

  1. Install SSH server:

    sudo apt-get install ssh
    
  2. Start SSH service:

    sudo service ssh start
    
  3. Install network tools:

    sudo apt-get install net-tools
    
  4. Check IP address:

    ifconfig
    
  5. In VSCode, install the Remote SSH extension and connect using the VM's IP address.

Ensure the SSH config file includes the username at the end:

Host vm-ip
  HostName <IP_ADDRESS>
  User <USERNAME>

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.