Skip to content

Commit 49cd0b3

Browse files
committed
added explanation for MICROCONTROLLER_BUILD
1 parent 7cff4be commit 49cd0b3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,14 @@ Codec 2 can be added to the project in the following way.
236236
237237
1. Add Codec 2 to the target_link_libraries in the same file.
238238
239-
## Building Codec 2 for microcontrollers
239+
## Building Codec 2 for Microcontrollers
240240
241-
Codec 2 can be run on certain microcontrollers (such as the IMRT1052 used in Teensy 4/4.1). This requires the
242-
MICROCONTROLLER_BUILD option to be set in CMake during configuration in order to properly set compiler arguments.
243-
Additionally, defines should be added for the FreeDV/Codec2 modes to enable. If on ARM, using \_\_EMBEDDED\_\_ and
244-
also including the ARM CMSIS library will improve performance on ARM-based microcontrollers.
241+
Codec 2 requires a hardware Floating Point Unit (FPU) to run in real time.
242+
243+
Two build options have been added to support building on microcontrollers:
244+
1. Setting the `cmake` variable MICROCONTROLLER_BUILD disables position independent code (-fPIC is not used). This was required for the IMRT1052 used in Teensy 4/4.1).
245+
246+
1. On ARM machines, setting the C Flag \_\_EMBEDDED\_\_ and linking with the ARM CMSIS library will improve performance on ARM-based microcontrollers.
245247
246248
A CMakeLists.txt example for a microcontroller is below:
247249
@@ -271,8 +273,6 @@ set(LPCNET OFF CACHE BOOL "")
271273
add_subdirectory(${codec2_SOURCE_DIR} ${codec2_BINARY_DIR} EXCLUDE_FROM_ALL)
272274
```
273275
274-
*Note: Codec 2 relies extensively on single-precision floating point. Use on a device without a FPU is thus not advised as performance will be degraded.*
275-
276276
## Building Debian packages
277277
278278
To build Debian packages, simply run the "cpack" command after running "make". This will generate the following packages:

0 commit comments

Comments
 (0)