4 Buildroot Build System

We will first generate the Buildroot SD card image and then boot the target.

  1. Generate the SD card image:
    1. Install the software packages required for the host development system:
      sudo apt-get install wget sed make binutils build-essential diffutils gcc g++ bash patch gzip bzip2 perl tar cpio unzip rsync file bc findutils gawk libgnutls28-dev
    2. Export the cross-tool:
      export PATH=/home/administrator/Buildroot/buildroot-mchp/output/host/usr/bin:$PATH
      Note: Replace /home/administrator/Buildroot/ with the path where Buildroot has been cloned or installed.
      export CC=arm-buildroot-linux-gnueabihf-gcc
    3. Create an empty directory that will serve as your workspace:
      
      mkdir buildroot-dev
      cd buildroot-dev
      
    4. Clone the required repositories:
      
      git clone https://github.com/linux4microchip/buildroot-mchp.git
      git clone https://github.com/linux4microchip/buildroot-external-microchip.git
      
    5. Check out the following release branch:
      
      cd buildroot-external-microchip/
      git checkout linux4microchip-2025.10 -b linux4microchip-2025.10
      cd ../buildroot-mchp/
      git checkout linux4microchip-2025.10 -b linux4microchip-2025.10
      
    6. Unzip the demo_linux_ocpp_v1.6_certification.zip sample application into the buildroot-dev folder.
    7. Copy the ocpp16-demo folder located in the demo_linux_ocpp_v1.6_certification/ocpp16-demo package into the buildroot-external-microchip/package folder.
    8. Add the following line to buildroot-external-microchip/Config.in:
      source "$BR2_EXTERNAL_MCHP_PATH/package/ocpp16-demo/Config.in"
    9. Navigate to the buildroot-mchp directory and set up BR2_EXTERNAL:
      export BR2_EXTERNAL=../buildroot-external-microchip/
    10. Run defconfig for the board:
      make sama5d27_wlsom1_ek_headless_defconfig
    11. Open the buildroot configuration menu:
      make menuconfig
    12. Enable the OCPP support as follows:
      1. Go to External Options>Ocpp 1.6 Demo and press y. This displays the Ocpp repo path or the URL option.
      2. Press Enter on the string Ocpp demo source path and enter the absolute path to the demo_linux_ocpp_v1.6_certification/src folder (this source can be located anywhere in the system and does not need to be placed in the buildroot folder).
        Figure 4-1. Buildroot Menuconfig Configuration
        ???
      3. Save and exit the configuration.
    13. Build the project:
      make
      Once the build is successful, the SD card OS image (sdcard.img) can be found in the buildroot-mchp/output/images/ folder.
    14. Program the SD card using the balenaEtcher tool. Refer to SAMA5D27WLSOM1-EK in the Linux4SAM Developer Help.
  2. Boot the target:
    1. Press the RESET push button to boot the device using the SD card. The following is a snippet of the boot logs:
      
      [  OK  ] Started Notify NFS peers of a restart.
      Welcome to the Microchip SAMA5D27 Wireless SOM1 Evaluation Kit Demo
      sama5 login: root (automatic login)
      [root@sama5 ~]$
      
    2. Run the OCPP demo application:
      
      [root@sama5 ~]$cd ocpp16
      [root@sama5 ocpp16]$./ocpp1.6_WD
      2025-12-10 08:47:03 [DEBUG]: [APP_LOG] Options:
      Reboot the application:
              0: Reboot the applicationCore:
              A: Authorize
              B: Boot Notification
              c: Change Configuration
              D: Data Transfer
              H: Heart Beat
              M: Meter Values
              R: Reset
              S: StartTransaction
              N: StatusNotification
              Z: StopTransaction
      
    3. Go to OCPP Compliance Test Tool (OCTT) Server Setup.