Tool/software: Code Composer Studio
I have a problem with memory allocation.
I use CCS 7.1.0.00016.
When I put two structures into different ram sections, size of data is correct 22x16b + 44x16b.
typedef struct { float dat[2]; } complex_float; typedef struct SlidingGoertzelDFT { float32 value[1]; float32 phase[1]; struct { float32* vr0k; float32* vr1k; float32* vr2k; float32 xn[1]; complex_float vk[1]; float32 vr0t[1]; float32 vr1t[1]; float32 vr2t[1]; } tables; } SlidingGoertzelDFT; typedef struct PQAHarmonicsPhaseData { SlidingGoertzelDFT Voltage; SlidingGoertzelDFT Current; } PQAHarmonicsPhaseData; typedef struct PQAHarmonicsData { PQAHarmonicsPhaseData L1; } PQAHarmonicsData; PQAHarmonicsData PQAHarmonicsMeasurement; #pragma DATA_SECTION(PQAHarmonicsMeasurement, "DMARAML7"); PQAHarmonicsData PQAHarmonicsMeasurement; typedef struct ttest { float32 value[1]; float32 phase[1]; struct { float32* vr0k; float32* vr1k; float32* vr2k; float32 xn[1]; complex_float vk[1]; float32 vr0t[1]; float32 vr1t[1]; float32 vr2t[1]; } tables; } ttest; #pragma DATA_SECTION(ttesttt, "DMARAML6"); ttest ttesttt;
Result of compiler is:
**** Build of configuration Debug for project APF_v0_01 **** "C:\\ti\\ccs710\\ccsv7\\utils\\bin\\gmake" -k -j 8 all -O 'Building file: ../_APF/PQA_HarmMeasurement.c' 'Invoking: C2000 Compiler' "C:/ti/ccs710/ccsv7/tools/compiler/ti-cgt-c2000_17.3.0.STS/bin/cl2000" -v28 -ml -mt --float_support=fpu32 -O1 --opt_for_speed=5 --include_path="C:/ti/workspace_v7/APF_v0_01/_DSP" --include_path="C:/ti/workspace_v7/APF_v0_01/_APF/Headers" --include_path="C:/ti/workspace_v7/APF_v0_01/_APF" --include_path="C:/ti/workspace_v7/APF_v0_01/_DSP/Headers" --include_path="C:/ti/workspace_v7/APF_v0_01/_PCB" --include_path="C:/ti/workspace_v7/APF_v0_01/_PCB/Headers" --include_path="C:/ti/workspace_v7/APF_v0_01/_APF Hardware" --include_path="C:/ti/workspace_v7/APF_v0_01/_APF Hardware/Headers" --include_path="C:/ti/workspace_v7/APF_v0_01" --include_path="C:/ti/ccs710/ccsv7/tools/compiler/ti-cgt-c2000_17.3.0.STS/include" --advice:performance=all --define=_INLINE --define=SAMPLING_51200 --define=DEBUG_DC_HISTOGRAM -g --symdebug:dwarf_version=3 --diag_warning=225 --diag_wrap=off --display_error_number --c_src_interlist --gen_func_info_listing --section_sizes=on --preproc_with_compile --preproc_dependency="_APF/PQA_HarmMeasurement.d" --obj_directory="_APF" "../_APF/PQA_HarmMeasurement.c" FILE: _APF\PQA_HarmMeasurement.obj DATA size (bytes): 66
But when I change DATA_SECTION of ttesttt also to DMARAML7, I have data size of 108x16b:
**** Build of configuration Debug for project APF_v0_01 **** "C:\\ti\\ccs710\\ccsv7\\utils\\bin\\gmake" -k -j 8 all -O 'Building file: ../_APF/PQA_HarmMeasurement.c' 'Invoking: C2000 Compiler' "C:/ti/ccs710/ccsv7/tools/compiler/ti-cgt-c2000_17.3.0.STS/bin/cl2000" -v28 -ml -mt --float_support=fpu32 -O1 --opt_for_speed=5 --include_path="C:/ti/workspace_v7/APF_v0_01/_DSP" --include_path="C:/ti/workspace_v7/APF_v0_01/_APF/Headers" --include_path="C:/ti/workspace_v7/APF_v0_01/_APF" --include_path="C:/ti/workspace_v7/APF_v0_01/_DSP/Headers" --include_path="C:/ti/workspace_v7/APF_v0_01/_PCB" --include_path="C:/ti/workspace_v7/APF_v0_01/_PCB/Headers" --include_path="C:/ti/workspace_v7/APF_v0_01/_APF Hardware" --include_path="C:/ti/workspace_v7/APF_v0_01/_APF Hardware/Headers" --include_path="C:/ti/workspace_v7/APF_v0_01" --include_path="C:/ti/ccs710/ccsv7/tools/compiler/ti-cgt-c2000_17.3.0.STS/include" --advice:performance=all --define=_INLINE --define=SAMPLING_51200 --define=DEBUG_DC_HISTOGRAM -g --symdebug:dwarf_version=3 --diag_warning=225 --diag_wrap=off --display_error_number --c_src_interlist --gen_func_info_listing --section_sizes=on --preproc_with_compile --preproc_dependency="_APF/PQA_HarmMeasurement.d" --obj_directory="_APF" "../_APF/PQA_HarmMeasurement.c" FILE: _APF\PQA_HarmMeasurement.obj DATA size (bytes): 108
I can't undesrstand how 22x16 + 44x16 equals 108x16 ???
Because of this I can't fit my data inside ram section.
Can anyone help me in this matter?