User`s guide
Preventing Memory Corruption When You Export C oefficients to Processor Memory
Preventing Memor y Corruption When You Export
Coefficients to
Processor Memor y
In this section...
“Allocating Sufficient or Extra Memory for Filter Coefficients” on page 5-15
“Example: UsingtheExportedHeaderFiletoAllocateExtraProcessor
Memory” on page 5-15
“Replacing Existing Coefficients in Memory w ith Updated Coef ficients”
on page 5-16
“Example: Changing Filter Coefficients Stored on Your Processor” on page
5-17
Allocating Su
fficient or Extra Memory for Filter
Coefficient
s
You can alloc
ate extra memory by editing the generated ANSI C header file.
You can then l
oad the associated program file into your pro c esso r as described
in “Example:
Using the E xported Header File to Allocate Extra Process or
Memory” on p
age 5-15. Extra memory lets you chan g e filter coefficients and
overwrite e
xisting coef ficients stored in processor memory more easily.
To prev ent p
roblems when you update filter coefficients in a project, , such as
writing coe
fficients to unintended memory locations, use the
C header file
export mod
e option in FDATool to update filter coefficients in your program.
Example: U
sing the Exported Header File to Allocate
Extra Proc
essor Memory
You can edi
t the generated h eader file so the linked program file all ocates
extra pro
cessor memory. By allocating extra memory, you avoid the problem
of insuffi
cient m emory when you export new coefficients directly to allocated
memory.
For examp
le, changing the following command in the header file:
const real64_T NUM[47] = {...}
5-15