HOME
  • GM-3568JHF
  • M4-R1
  • M5-R1
  • SC-3568HA
  • M-K1HSE
  • CF-NRS1
  • CF-CRA2
  • 1684XB-32T
  • 1684X-416T
  • C-3568BQ
  • C-3588LQ
  • GC-3568JBAF
  • C-K1BA
Shop
  • English
  • 简体中文
HOME
  • GM-3568JHF
  • M4-R1
  • M5-R1
  • SC-3568HA
  • M-K1HSE
  • CF-NRS1
  • CF-CRA2
  • 1684XB-32T
  • 1684X-416T
  • C-3568BQ
  • C-3588LQ
  • GC-3568JBAF
  • C-K1BA
Shop
  • English
  • 简体中文
  • GM-3568JHF

    • 1. Introduction

      • GM-3568JHF Introduction
    • 2. Quick Start

      • 01 Environment Construction
      • 02 Compilation Instructions
      • 03 Burning Guide
      • 04 Debugging Tools
      • 05 Software Update
      • 06 View information
      • 07 Test Command
      • 08 Application Compilation
      • 09 Source code acquisition
    • 3. Peripherals and Interfaces

      • USB
      • Display and touch
      • Ethernet
      • WIFI
      • Bluetooth
      • TF-Card
      • Audio
      • Serial Port
      • CAN
      • RTC
    • 4. Application Development

      • 01 UART read and write case
      • 02 Key detection case
      • 03 LED light flashing case
      • 04 MIPI screen detection case
      • 05 Read USB device information example
      • 06 FAN Detection Case
      • 07 FPGA FSPI Communication Case
      • 08 FPGA DMA read and write case
      • 09 GPS debugging case
      • 10 Ethernet Test Cases
      • 11 RS485 reading and writing examples
      • 12 FPGA IIC read and write examples
      • 13 PN532 NFC card reader case
      • 14 TF card reading and writing case
    • 5. QT Development

      • 01 ARM64 cross compiler environment construction
      • 02 QT program added automatic startup service
    • 6. Others

      • 01 Modification of the root directory file system
      • 02 System auto-start service

08 Application Compilation

In the early days, due to the insufficient performance of the processor chip, limited storage space, and insufficient compilation performance, early development boards generally adopted cross-compilation. However, cross-compilation has several disadvantages: offline compilation is not possible, operation is cumbersome, and environment configuration is complex, etc.

The processor performance of GM-3568JHF is powerful, and it will take a long time to compile the program on the development board. Therefore, we recommend using the GCC software integrated on the board to compile directly, which can save a lot of time on file transfer.

GM-3568JHF comes with GCC compiler, we can use the following command to check the GCC version

#查看gcc命令
gcc -v

#查看gcc的安装路径
which gcc

#如果没有gcc,下载安装
sudo apt update
sudo apt install gcc -y

As shown below:

GCC

The version of gcc used by the author is 12.2.0. The version number of gcc may vary depending on the image and system, but it does not affect the compilation.

1 Compile and generate executable files

Code:

#include <stdio.h>

int main(void)
{
        printf("Hello World!\n");
        return 0;
}

Compilation steps:

#使用vi创建hello.c文件
 vi hello.c

 #键盘敲入'i'或'a'进入编辑模式
 #复制代码到vim编辑器里
 #键盘敲入'Esc'键
 #然后敲入":wq" 保存并退出

 #也可以直接把源码下载到板卡上,然后进行编译
 #输入命令编译
 gcc -o hello hello.c

 #执行程序
 ./hello

As shown below:

GCC_2
Edit this page on GitHub
Last Updated:
Contributors: zsl, zwhuang
Prev
07 Test Command
Next
09 Source code acquisition