Skip to content

Commit

Permalink
projects:stm32_documentation:Added the files related to stm32
Browse files Browse the repository at this point in the history
restructuring

1)Added the project_build_stm32.rst file and useful_links_stm32.rst

Signed-off-by: Kantipudi-Supriya <[email protected]>
  • Loading branch information
Kantipudi-Supriya committed Oct 4, 2024
1 parent 7d6a75f commit 24e48bb
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
82 changes: 82 additions & 0 deletions doc/sphinx/source/build/project_build_stm32.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
===========
Build Guide
===========

Build Prerequisites
-------------------

Prior to building a firmware project, it is required to set up an environment so
that the build process may find the necessary tools (compiler, linker, SDK etc.).
Use the following steps to prepare your environment for building firmware projects
for respective platform.

.. collapsible:: Windows

.. collapsible:: STM32

.. collapsible:: For STM32 IDE based Build

* Install `STM32CubeIDE <https://www.st.com/en/development-tools/stm32cubeide.html>`_

* Install `STM32CubeMX <https://www.st.com/en/development-tools/stm32cubemx.html>`_

.. image:: /source/build/environmental_variables.png
:width: 400


Building a project
------------------

Once the build enviornment is setup, follow the guide below to build your project
and generate executable file (.bin/.hex)

.. collapsible:: Windows

.. collapsible:: STM32

.. collapsible:: Build Using STM32 IDE

* Open the respective project directory by navigating into the "precision_converters_firmware/projects/" folder.

* In the "STM32" folder present within the project directory, double click and open the .ioc file present within.

.. image:: /source/build/stm32_project_directory.png
:width: 600

* Click on the "Generate Code" option seen on the top right corner

.. image:: /source/build/stm32_generate_code.png
:width: 600

* Upon successful generation of drivers for the selected MCU, the autogenerated files would be seen in the same directory where the .ioc file was present. Double click and open the ".project" file seen in the list of files

.. image:: /source/build/stm32_auto_generated_files.png
:width: 600

* After the project is loaded to the STM32CubeIDE, unfold the adxxxx_iio project seen in the project explorer, right click the "app" folder, select "Settings" under the "C/C++ Build" section on the left pane and un-check the "Exclude resources from build" checkbox. This would ensure that the project specific files are included by the build system

.. image:: /source/build/stm32_exclude_files_option.png
:width: 600

* In order to choose STM32 platform in the firmware, select the "ACTIVE_PLATFORM" as "STM32_PLATFORM" in the app_config.h from the respective project. Alternately , add compiler flag "ACTIVE_PLATFORM=value of STM32_PLATFORM in app_config.h" for selecting stm32 platform.

* Add compiler flags "-u _printf_float" to the project settings.

.. image:: /source/build/stm32_compiler_flag.png
:width: 600

* Program by clicking on the "Run adxxxx_iio" option seen or by performing a copy->paste option of the .hex file seen in the STM32/Debug folder

.. image:: /source/build/stm32_run_option.png
:width: 600


Running a project
-----------------

Once the firmware build is successful and binary file is generated, copy the
generated binary into USB drive hosted by your MCU board (e.g. USB drive hosted
by SDP-K1 board on windows). This will flash the binary file into MCU present
on the controller board. Programming might vary based on the tools used for building
a project. The 'Project Build' section above talks about this exception at the end
of all build steps.
18 changes: 18 additions & 0 deletions doc/sphinx/source/useful_links_stm32.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
============
Useful Links
============

* `Source Code: Precision Converters Firmware <https://github.com/analogdevicesinc/precision-converters-firmware>`_

* `no-OS: Software drivers for systems without OS <https://github.com/analogdevicesinc/no-OS>`_

* `SDP-K1 <https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-boards-kits/sdp-k1.html#eb-overview>`_

* `Linux Drivers <https://github.com/analogdevicesinc/linux>`_

* `HDL Source Code <https://github.com/analogdevicesinc/hdl>`_

.. note::

Linux and HDL are not used in emebdded IIO firmware projects but
they may be of interest if you require Linux and/or FPGA support.

0 comments on commit 24e48bb

Please sign in to comment.