AN 669: Drive-On-Chip Design Example for Cyclone V Devices

ID 683466
Date 5/15/2022
Public
Document Table of Contents

5.2. Preparing the µC/OS-II HPS Software Files

To complete the software files for the Drive-on-Chip Design Example, you need to download the uC/OS II files from the Micrium web site, then construct the software directory structure with a script provided with the design archive.
  1. Start a web browser and go to the Weston Embedded website.
  2. Launch SoC EDS command shell.
  3. Go to the micrium-examples page by selecting MICRIUM > EXAMPLES from the upper menu.
  4. Search de10-nano_webserver and click the download link.
  5. Change the current directory to software\Setup in the command shell by typing cd <project_dir>/software/Setup.
  6. Type mkdir Micrium_files; cd Micrium_files .
  7. Type git clone https://github.com/weston-embedded/uC-CPU.git.
    If you see this error, fatal: unable to access …: error setting certificate verify locations …, type git config --global http.sslCAInfo /usr/ssl/certs/ca-bundle.crt.
    The software creates the uC-CPU directory under the current folder.
  8. Type git clone https://github.com/weston-embedded/uC-LIB.git.
  9. Type git clone https://github.com/weston-embedded/uC-OS2.git.
  10. Download the DE10 Nano webserver example design from the Weston Embedded website.
    1. Register and login.
    2. Access the DE10 Nano web page.
    3. Right click Download, and select Save link as....
    4. Navigate to <project_dir>/software/Setup/Micrium_files directory , and save the file as de10-nano_webserver.zip.
  11. Change the current directory to the software\Setup directory in the command shell by typing cd <project_dir>/software/Setup .
  12. Run the script to integrate software files.
  13. Type source setup_software_files.sh.
Table 3.  Software Project DirectoriesThe table shows the software project directories in the <project_dir>/software/DOC_TANDEM_CVSX/ directory.
Directory Description
hwlibs The build process copies selected files from the Intel Quartus Prime Design Suite hardware libraries to this directory.
objects The build process creates object files here.
src\Micrium Real time operating system.
src\DriveOnChip\bms Battery management system. (SOC estimation.)
src\DriveOnChip\components Motor control component source and header files.
src\DriveOnChip\mc Motor control source and header files.
src\DriveOnChip\motorsim Motor simulation model, not applicable for this design.
src\DriveOnChip\perf Performance monitor source and header files.
src\DriveOnChip\platform Platform (development kit and RTOS) specific source and header files.
src\DriveOnChip\waveform Waveform generation for motor control.