Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


Design Components

  • petalinux_bsp
  • heartbeat.elf


Build Flow Tutorials


This tutorial uses both XSDK and PetaLinux tools. It is recommended to use separate shells for each of the tools.

Heartbeat Application
Anchor
heartbeat
heartbeat


The heartbeat application is a FreeRTOS application that executes on RPU-0 after the FSBL has finished. This application is a simple dual task application that demonstrates communication between the two tasks by printing messages to the UART1 console.
  • Create a new SDx workspace.

    Code Block
    themeMidnight
    % cd $TRD_HOME/workspaces/ws_heartbeat
    % xsdk -workspace . &&


  • Click 'Import Project' from the welcome screen, browse to the current working directory and make sure the heartbeat, heartbeat_bsp, and hw_platform_0 projects are selected. Click Finish.
  • Right-click on the heartbeat project and select 'Build Project'.
  • Copy the generated heartbeat executable into the PetaLinux BSP.

    Code Block
    themeMidnight
    cp heartbeat/Debug/heartbeat.elf $TRD_HOME/petalinux/bsp/images/linux


PetaLinux BSP


This tutorial shows how to build a boot image that includes the heartbeat application using the PetaLinux build tool. This step assumes you have run through the PetaLinux build in DM1 previously.
  • Create a boot image.

    Code Block
    themeMidnight
    % cd $TRD_HOME/petalinux/bsp/images/linux
    % petalinux-package --boot --bif=../../project-spec/boot/dm2.bif --force


  • Copy the generated boot image to the dm2 SD card directory.

    Code Block
    themeMidnight
    % mkdir -p $TRD_HOME/sd_card/dm2
    % cp BOOT.BIN $TRD_HOME/sd_card/dm2




Run Flow Tutorial

  • See here for board setup instructions.
  • Copy all the files from the $TRD_HOME/sd_card/dm2 SD card directory to a FAT formatted SD card.
  • Power on the board to boot the images; make sure all power rail LEDs are lit green.
  • The user can now see FSBL prints on UART-0 and prints from heartbeat application can be viewed on UART-1 which is shown in the following picture:

    Code Block
    languagebash
    themeMidnight
    Hello from Freertos example main
    Rx task (task number: 0) received string from Tx task: I am alive
    Rx task (task number: 1) received string from Tx task: I am alive
    Rx task (task number: 2) received string from Tx task: I am alive
    Rx task (task number: 3) received string from Tx task: I am alive
    Rx task (task number: 4) received string from Tx task: I am alive
    Rx task (task number: 5) received string from Tx task: I am alive
    Rx task (task number: 6) received string from Tx task: I am alive
    Rx task (task number: 7) received string from Tx task: I am alive
    Rx task (task number: 8) received string from Tx task: I am alive
    Rx task (task number: 9) received string from Tx task: I am alive
    Rx task (task number: 10) received string from Tx task: I am alive
    Rx task (task number: 11) received string from Tx task: I am alive
    Rx task (task number: 12) received string from Tx task: I am alive




...