Importing Matlab SImulink Model into Dave for debugging

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
User19299
Level 2
Level 2
First solution authored
Hello,

I'm trying to import an existing Simulink Model code into Dave.
I used the XMCLib for matlab which includes the periphals such as VADC, CCU4x...
Since there is literally no info guide about this, I'm having probelms.
Importing the project folder didn't work, for me, even though it worked for someone else in the forum.

I tried importing the model by manually copying all c and h files from
$Project$\Infineon\XMC4400_series\Source\
$Project$\Infineon\XMC4400_series\Include\
$Project$\Lib\
$Project$\Newlib\
and from the top level folder.
This threw the least amount of errors at me.

The Code generation in simulink of the model didn't show any errors.


The Dave console says the following:

../BATT_DCDC_12VFAN_XMC4400.cpp:61:1: sorry, unimplemented: non-trivial designated initializers not supported
'Invoking: ARM-GCC C++ Compiler'
};
"C:/Program Files (x86)/DAVE-IDE-4.4.2-64Bit/eclipse/ARM-GCC-49/bin/arm-none-eabi-g++" -MMD -MT "BATT_DCDC_12VFAN_XMC4400.o" -DXMC4400_F100x512 -I"C:/Users/...___.../BATT_DCDC_12VFAN_XMC4400_xmc_rtw/Libraries/XMCLib/inc" -I"C:/Users/...___.../BATT_DCDC_12VFAN_XMC4400_xmc_rtw/Libraries/CMSIS/Include" -I"C:/Users/...___.../BATT_DCDC_12VFAN_XMC4400_xmc_rtw/Libraries/CMSIS/Infineon/XMC4400_series/Include" -I"C:/Users/Steve/OneDrive - Technische Universität Ilmenau/Docs/5 Poject Porsche/EVALUATION BOARD/BATT_DCDC_12VFAN_XMC4400_xmc_rtw" -I"C:/Users/...___.../BATT_DCDC_12VFAN_XMC4400_xmc_rtw/Dave/Generated" -I"C:/Users/S...___.../BATT_DCDC_12VFAN_XMC4400_xmc_rtw/Libraries" -O0 -ffunction-sections -fdata-sections -Wall -mfloat-abi=softfp -Wa,-adhlns="BATT_DCDC_12VFAN_XMC4400.o.lst" -fno-exceptions -fno-rtti -pipe -c -fmessage-length=0 -MMD -MP -MF"BATT_DCDC_12VFAN_XMC4400.d" -MT"BATT_DCDC_12VFAN_XMC4400.o" -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mthumb -g -gdwarf-2 -o "BATT_DCDC_12VFAN_XMC4400.o" "../BATT_DCDC_12VFAN_XMC4400.cpp"
^
subdir.mk:166: recipe for target 'BATT_DCDC_12VFAN_XMC4400.o' failed
../BATT_DCDC_12VFAN_XMC4400.cpp:61:1: sorry, unimplemented: non-trivial designated initializers not supported
../BATT_DCDC_12VFAN_XMC4400.cpp:61:1: sorry, unimplemented: non-trivial designated initializers not supported
../BATT_DCDC_12VFAN_XMC4400.cpp:61:1: sorry, unimplemented: non-trivial designated initializers not supported
../BATT_DCDC_12VFAN_XMC4400.cpp:61:1: sorry, unimplemented: non-trivial designated initializers not supported
../BATT_DCDC_12VFAN_XMC4400.cpp:61:1: error: too many initializers for 'XMC_VADC_CHANNEL_CONFIG_t {aka XMC_VADC_CHANNEL_CONFIG}'
../BATT_DCDC_12VFAN_XMC4400.cpp:89:1: sorry, unimplemented: non-trivial designated initializers not supported
};
^
../BATT_DCDC_12VFAN_XMC4400.cpp:89:1: sorry, unimplemented: non-trivial designated initializers not supported
../BATT_DCDC_12VFAN_XMC4400.cpp:89:1: sorry, unimplemented: non-trivial designated initializers not supported
../BATT_DCDC_12VFAN_XMC4400.cpp:89:1: sorry, unimplemented: non-trivial designated initializers not supported
../BATT_DCDC_12VFAN_XMC4400.cpp:89:1: sorry, unimplemented: non-trivial designated initializers not supported
../BATT_DCDC_12VFAN_XMC4400.cpp:89:1: error: too many initializers for 'XMC_VADC_CHANNEL_CONFIG_t {aka XMC_VADC_CHANNEL_CONFIG}'
../BATT_DCDC_12VFAN_XMC4400.cpp:117:1: sorry, unimplemented: non-trivial designated initializers not supported
};
^


and the same for all the following initiazations....
This is the BATT_DCDC_12VFAN_XMC4400.cpp file:

//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
//
// File: BATT_DCDC_12VFAN_XMC4400.cpp
//
// Code generated for Simulink model : BATT_DCDC_12VFAN_XMC4400.
// Model version : 1.30
// Simulink Coder version : 9.3 (R2020a) 18-Nov-2019
// TLC version : 9.3 (Jan 23 2020)
// C/C++ source code generated on : Tue Oct 6 22:02:20 2020
//
// Target selection: Infineon_XMC_Family.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex
// Code generation objectives: Unspecified
// Validation result: Not run
//
#include "BATT_DCDC_12VFAN_XMC4400.h"
#include "BATT_DCDC_12VFAN_XMC4400_private.h"

// Global variable definition for Interrupt
#define INTSR_22 IRQ_Hdlr_22

// Block signals (default storage)
B_BATT_DCDC_12VFAN_XMC4400_T BATT_DCDC_12VFAN_XMC4400_B;

// Block states (default storage)
DW_BATT_DCDC_12VFAN_XMC4400_T BATT_DCDC_12VFAN_XMC4400_DW;

// Real-time model
RT_MODEL_BATT_DCDC_12VFAN_XMC_T BATT_DCDC_12VFAN_XMC4400_M_ =
RT_MODEL_BATT_DCDC_12VFAN_XMC_T();
RT_MODEL_BATT_DCDC_12VFAN_XMC_T *const BATT_DCDC_12VFAN_XMC4400_M =
&BATT_DCDC_12VFAN_XMC4400_M_;

// Channel 0 Configuration
XMC_VADC_CHANNEL_CONFIG_t ch0_config_g1 = {
.input_class = XMC_VADC_CHANNEL_CONV_GROUP_CLASS0,
.event_gen_criteria = XMC_VADC_CHANNEL_EVGEN_NEVER,
.sync_conversion = true,
.result_reg_number = 0,
.use_global_result = false,
.result_alignment = XMC_VADC_RESULT_ALIGN_RIGHT,
.broken_wire_detect_channel = XMC_VADC_CHANNEL_BWDCH_VAGND,
.broken_wire_detect = false,
.channel_priority = false,
.alias_channel = XMC_VADC_CHANNEL_ALIAS_DISABLED,
.boundary_flag_mode_ch0 = XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_DISABLED,
.flag_output_condition_ch0 = XMC_VADC_CHANNEL_BOUNDARY_CONDITION_ABOVE_BAND,
.invert_boundary_flag_ch0 = false,
.boundary_flag_mode_ch1 = XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_DISABLED,
.flag_output_condition_ch1 = XMC_VADC_CHANNEL_BOUNDARY_CONDITION_ABOVE_BAND,
.invert_boundary_flag_ch1 = false,
.boundary_flag_mode_ch2 = XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_DISABLED,
.flag_output_condition_ch2 = XMC_VADC_CHANNEL_BOUNDARY_CONDITION_ABOVE_BAND,
.invert_boundary_flag_ch2 = false,
.boundary_flag_mode_ch3 = XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_DISABLED,
.flag_output_condition_ch3 = XMC_VADC_CHANNEL_BOUNDARY_CONDITION_ABOVE_BAND,
.invert_boundary_flag_ch3 = false,
};

uint8_t regG1Ch0;

// Channel 1 Configuration
XMC_VADC_CHANNEL_CONFIG_t ch1_config_g1 = {
.input_class = XMC_VADC_CHANNEL_CONV_GROUP_CLASS0,
.event_gen_criteria = XMC_VADC_CHANNEL_EVGEN_NEVER,
.sync_conversion = true,
.result_reg_number = 1,
.use_global_result = false,
.result_alignment = XMC_VADC_RESULT_ALIGN_RIGHT,
.broken_wire_detect_channel = XMC_VADC_CHANNEL_BWDCH_VAGND,
.broken_wire_detect = false,
.channel_priority = false,
.alias_channel = XMC_VADC_CHANNEL_ALIAS_DISABLED,
.boundary_flag_mode_ch0 = XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_DISABLED,
.flag_output_condition_ch0 = XMC_VADC_CHANNEL_BOUNDARY_CONDITION_ABOVE_BAND,
.invert_boundary_flag_ch0 = false,
.boundary_flag_mode_ch1 = XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_DISABLED,
.flag_output_condition_ch1 = XMC_VADC_CHANNEL_BOUNDARY_CONDITION_ABOVE_BAND,
.invert_boundary_flag_ch1 = false,
.boundary_flag_mode_ch2 = XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_DISABLED,
.flag_output_condition_ch2 = XMC_VADC_CHANNEL_BOUNDARY_CONDITION_ABOVE_BAND,
.invert_boundary_flag_ch2 = false,
.boundary_flag_mode_ch3 = XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_DISABLED,
.flag_output_condition_ch3 = XMC_VADC_CHANNEL_BOUNDARY_CONDITION_ABOVE_BAND,
.invert_boundary_flag_ch3 = false,
};

uint8_t regG1Ch1;

// Channel 2 Configuration
XMC_VADC_CHANNEL_CONFIG_t ch2_config_g1 = {
.input_class = XMC_VADC_CHANNEL_CONV_GROUP_CLASS0,
.event_gen_criteria = XMC_VADC_CHANNEL_EVGEN_NEVER,
.sync_conversion = true,
.result_reg_number = 2,
.use_global_result = false,
.result_alignment = XMC_VADC_RESULT_ALIGN_RIGHT,
.broken_wire_detect_channel = XMC_VADC_CHANNEL_BWDCH_VAGND,
.broken_wire_detect = false,
.channel_priority = false,
.alias_channel = XMC_VADC_CHANNEL_ALIAS_DISABLED,
.boundary_flag_mode_ch0 = XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_DISABLED,
.flag_output_condition_ch0 = XMC_VADC_CHANNEL_BOUNDARY_CONDITION_ABOVE_BAND,
.invert_boundary_flag_ch0 = false,
.boundary_flag_mode_ch1 = XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_DISABLED,
.flag_output_condition_ch1 = XMC_VADC_CHANNEL_BOUNDARY_CONDITION_ABOVE_BAND,
.invert_boundary_flag_ch1 = false,
.boundary_flag_mode_ch2 = XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_DISABLED,
.flag_output_condition_ch2 = XMC_VADC_CHANNEL_BOUNDARY_CONDITION_ABOVE_BAND,
.invert_boundary_flag_ch2 = false,
.boundary_flag_mode_ch3 = XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_DISABLED,
.flag_output_condition_ch3 = XMC_VADC_CHANNEL_BOUNDARY_CONDITION_ABOVE_BAND,
.invert_boundary_flag_ch3 = false,
};
.
.
.


I included the cpp file in the attachements


I see now, that importing my project worked, but obviously my periphals aren't configured correctly. My mistake.
Can still someone help me at configuring VADC and CCU4 on which configs are missing?
0 Likes
1 Reply
User19299
Level 2
Level 2
First solution authored
Hello everyone,

I now used not my code, but unchanged example code from the infineon library in Matlab Simulink, from Matlab XMCLib. I imported the project the way I descriebed in my first post.

I get the exact same problem: " sorry, unimplemented: non-trivial designated initializers not supported "

I was expecting the example would not give erros, so it seems that the code generation from the XMCLib is not working how it's supposed to.

Are there Model settings that have to be changed in order for the code generation via XMCLib in Matlab to work?
0 Likes