This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Error #7: unrecognized token



Hello,

i am using Simulink Coder and the TI ARM 5.2.5 Toolchain to produce my C-Code
for the TMS570LC43xx.

When I don't use any data block in Simulink (constant or step), everything is working fine.
As soon as I do, a Modellname_data.c is generated with the following code:

/*** This file was patched on  02-Dec-2015 13:20:17 ***/ 
/*
 * File: Modellname_data.c
 *
 * Code generated for Simulink model 'Modellname'.
 *
 * Model version                  : 1.26
 * Simulink Coder version         : 8.5 (R2013b) 08-Aug-2013
 * TLC version                    : 8.5 (Aug  6 2013)
 * C/C++ source code generated on : Wed Dec 02 13:20:13 2015
 *
 * Target selection: realtime.tlc
 * Embedded hardware selection: ARM Compatible->ARM Cortex
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#include "Modellname_Test.h"
#include "Modellname_private.h"

/* Block parameters (auto storage) */
const P_Modellname_T Modellname_P @"PARAM" = { 
  1U                                   /* Computed Parameter: Constant_Value
                                        * Referenced by: '<Root>/Constant'
                                        */
};

/*
 * File trailer for generated code.
 *
 * [EOF]
 */

This file generates the following error using the TI compiler:

"Modellname_data.c", line 22: error #7: unrecognized token
const P_Modellname_T Modellname_P @"PARAM" = {
^

"Modellname_data.c", line 22: error #66: expected a ";"
const P_Modellname_T Modellname_P @"PARAM" = {
^

Maybe there is a missing compiler flag which processes this expression correctly?

CM