stray @ in program

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

stray @ in program

2,677 次查看
ankurchauhan
Contributor I

Hi,

I'm trying to use MCU initialization by using bellow givin function :

 

void MCU_Init(void)

{

 

 

  /* Common initialization of the write once registers */

  /* SOPT1: COPE=0,COPT=1,STOPE=0,WAITE=1,??=0,RSTOPE=0,BKGDPE=1,RSTPE=0 */

  SOPT1 = 0x52;                

  /* SPMSC1: LVDF=0,LVDACK=0,LVDIE=0,LVDRE=1,LVDSE=1,LVDE=1,??=0,BGBE=0 */

  SPMSC1 = 0x1C;               

  /* SPMSC2: LPR=0,LPRS=0,LPWUI=0,??=0,PPDF=0,PPDACK=0,PPDE=1,PPDC=0 */

  SPMSC2 = 0x02;               

  /* SPMSC3: LVDV=0,LVWV=0,LVWIE=0 */

  SPMSC3 &= ~(byte)(0x38);

 

   /*  System clock initialization */

  if (*(unsigned char*)0x03FF != 0xFF) { /* Test if the device trim value is stored on the specified address */

    MCGTRM = *(unsigned char*)0x03FF;  /* Initialize MCGTRM register from a non volatile memory */

    MCGSC = *(unsigned char*)0x03FE;   /* Initialize MCGSC register from a non volatile memory */

  }

  /* MCGC2: BDIV=0,RANGE=0,HGO=0,LP=0,EREFS=0,ERCLKEN=0,EREFSTEN=0 */

  MCGC2= 0x00;                /* Set MCGC2 register */

  /* MCGC1: CLKS=0,RDIV=0,IREFS=1,IRCLKEN=1,IREFSTEN=0 */

  MCGC1= 0x06;                /* Set MCGC1 register */

  /* MCGC3: LOLIE=0,PLLS=0,CME=0,DIV32=0,VDIV=1 */

  MCGC3= 0x01;                /* Set MCGC3 register */

  /* MCGC4: ??=0,??=0,DMX32=0,??=0,??=0,??=0,DRST_DRS=2 */

  MCGC4= 0x02;                /* Set MCGC4 register */

  while(!MCGSC_LOCK) {                 /* Wait until FLL is locked */

  }

 

}

 

 

I include "mc9s08dv16.h" file for bove macro defination.

but i'm getting

DescriptionResourcePathLocationType
stray '@' in program expected '=', ',', ';', 'asm' or '__attribute__' before numeric constantmc9s08dv16.h/lcd_config/Sourcesline 454C/C++ Problem

this error.

 

what should i do to resolve it.

标签 (1)
0 项奖励
回复
8 回复数

2,360 次查看
trytohelp
NXP Employee
NXP Employee

Hi Ankur,

What is the tool version used ?

strange than the mc9s08dv16.h introduces an error.

Most of the time the @ keyword is used to define a memory address.

For instance:

    int glob @0x0500 = 10; // OK, global variable "glob" is at 0x0500, initialized with 10

You will find more information in the manual:

    \CW MCU v10.6.4\MCU\Help\PDF\MCU_HCS08_compiler.pdf


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

2,360 次查看
ankurchauhan
Contributor I

Hi Pascal,

Thanks for reply.

I'm using Codewarrior 10.6.4.

In mc9s08dv16.h way of declaration is different :-

extern volatile SOPT1STR _SOPT1 @0x00001802;

there is no "=" assignment operator here.

compiler is expecting that operator  to be there.

Regards

Ankur

0 项奖励
回复

2,360 次查看
trytohelp
NXP Employee
NXP Employee

Hi Ankur,

With the Project wizard you can create 2 types of applications:

    - with Processor Expert,

    - without Processor Expert.

By default all header files are already included in the project and you should not include other device declaration files.

May be this is the problem.

To have really the error message you must to check in the Console Tab.

The Problems Tab display some information only.

Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

2,360 次查看
ankurchauhan
Contributor I

Hi Pascal,

These are  the console box msgs:

../Sources/mc9s08dv16.h:123:0: warning: ignoring #pragma MESSAGE DISABLE [-Wunknown-pragmas]

../Sources/mc9s08dv16.h:209:1: error: stray '@' in program

../Sources/mc9s08dv16.h:244:1: error: stray '@' in program

../Sources/mc9s08dv16.h:279:1: error: stray '@' in program

../Sources/mc9s08dv16.h:314:1: error: stray '@' in program

../Sources/mc9s08dv16.h:349:1: error: stray '@' in program

../Sources/mc9s08dv16.h:384:1: error: stray '@' in program

Regards

Ankur

0 项奖励
回复

2,360 次查看
trytohelp
NXP Employee
NXP Employee

Ankur,

Can we have the project you're using ?

On my side I've the project example created with the project wizard is working fine.

In the mc9s08dv16.h file there are:

    line 123: #pragma MESSAGE DISABLE C1106 /* WARNING C1106: Non-standard bitfield type */

    line 209: extern volatile PTADSTR _PTAD @0x00000000;

I don't see what is the problem.

It should be linked to your application.


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

2,360 次查看
ankurchauhan
Contributor I

Hi Pascal,

I'm using demo project given by freescale for TWR-LCD.

This demo project is for CW MCU 6.3 and i'm using 10.6 so i could not able to import the project or .mcp file.

That's y i'm copying the code in to my workspace and trying.

Can you provide any twr-lcd demo code for CW MCU 10.6

My micro-controller is of k70 series.

Regards

Ankur

0 项奖励
回复

2,360 次查看
trytohelp
NXP Employee
NXP Employee

Ankur,

CW for MCU V6.3 is the last version based on Classic IDE.

This version is supporting HC08, HCS08, RS08 and ColdFire V1 core only.

Kinetis devices are not supported in MCU V6.3.

CW for MCU V10.6.4 is the last version released some months ago and supporting:

    ColdFire®, ColdFire+, DSC, Kinetis, Qorivva, RS08, S08 and S12Z architectures

Under MCU V10.6.4, there are several build tool chain depending of the processor used.

The @ keyword is not defined in C and is not working similar with all architectures.

The definition you're using in HCS08 can not be used in Kinetis.

You must refer to the appropriate manual in the Help folder.

Based on your application ...

You can not create a project for K70 and add the code for mc9s08dv16.h.

This is not working like that.

What do you want to do ?

1- import the MCU v6.3 project to MCU V10.6.4 ?

          This is for the same processor.

You can refer to the AN4727:

      Import project from CW classic to CW MCU v10 4 CodeWarrior for Microcontrollers v10.4

  http://cache.freescale.com/files/soft_dev_tools/doc/app_note/AN4727.pdf

What 's about project using Processor Expert ?

By default on MCU V10.6.4 you must create a project including Processor Expert.

When the project is created to import PEx settings you just need to copy the .pe file to MCU project.

Then rename it as MCU one.

Now when the MCU project is re-opened, the classic PEx settings will be used

2- switch from HCs08dv16 to K70

Do we have example using TWR-LCD running under this device ?

I don't know BUT under the installation we provide lot of examples using Processor Expert.

You can access it under the folder \CW MCU v10.6.4\MCU\CodeWarrior_Examples

The Processor_Expert folder contains lot of examples.

If needed, the MQX can be installed too.

Regarding the example included in the TWR-LCD

I don't have this module and the DVD but according to the manual I've found the MCU v6.3 was used.

If you want you can import the project to MCU v10.6.4 if you refer to the AN4227 and change the .pe file as explained above.

I think this should work.

After that when the application is working under the mc9s08dv16 you can try to change the processor to K70 with PEx.

PEx will show you all points you need to check to be compliant with the Kinetis device.

Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

2,360 次查看
ankurchauhan
Contributor I

Hi Pascal,

These are  the console box msgs:

../Sources/mc9s08dv16.h:123:0: warning: ignoring #pragma MESSAGE DISABLE [-Wunknown-pragmas]

../Sources/mc9s08dv16.h:209:1: error: stray '@' in program

../Sources/mc9s08dv16.h:244:1: error: stray '@' in program

../Sources/mc9s08dv16.h:279:1: error: stray '@' in program

../Sources/mc9s08dv16.h:314:1: error: stray '@' in program

../Sources/mc9s08dv16.h:349:1: error: stray '@' in program

../Sources/mc9s08dv16.h:384:1: error: stray '@' in program

Regards

Ankur

0 项奖励
回复