KDS 3.0.0  unknown type name '__no_init'

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KDS 3.0.0  unknown type name '__no_init'

Jump to solution
1,211 Views
lordtheo
Contributor I

Hello

 

I am trying to compile this DAC code with KDS3.0.0

 

---------------------------------------------------------------------------------------------------

typedef union

{

unsigned long Word;

struct

{

  unsigned char DACDATx_L;

  unsigned char DACDATx_H;

}Bytes;

}DACDATx_FULL_REG;

 

__no_init DACDATx_FULL_REG DACDATx @0x400CC000;

---------------------------------------------------------------------------------------------------

 

I got the following error: unknown type name '__no_init'

 

can someone help please.

Labels (1)
0 Kudos
Reply
1 Solution
1,013 Views
DavidS
NXP Employee
NXP Employee

Hi Theodore,

First have a look at following post to see if it helps:

Second could you declare a the following:

// __no_init DACDATx_FULL_REG DACDATx @0x400CC000;

volatile DACDATx_FULL_REG *DACDATx_FULL_REG_ptr;

In your code then:

    DACDATx_FULL_REG_ptr = 0x400CC000;

    unsigned char read_DAC_DATx_L;

    read_DAC_DATx_L = DACDATx_FULL_REG_ptr->Bytes.DACDATx_L;

Assuming the DAC had been initialized then it should read the correct register value.

One observation though is I think you want to change unsigned long Word; to unsigned short Word;

My code example:

typedef union

{

unsigned short Word;

struct

{

  unsigned char DACDATx_L;

  unsigned char DACDATx_H;

}Bytes;

}DACDATx_FULL_REG;

//DES __no_init DACDATx_FULL_REG DACDATx @0x400CC000;

volatile DACDATx_FULL_REG *DACDATx_FULL_REG_ptr; //DES test

After DAC initialized:

#if 1//DES 1=test, 0=default code

    DACDATx_FULL_REG_ptr = 0x400CC000;

    unsigned char read_DAC_DATx_L, read_DAC_DATx_H;

    read_DAC_DATx_L = DACDATx_FULL_REG_ptr->Bytes.DACDATx_L;

    read_DAC_DATx_H = DACDATx_FULL_REG_ptr->Bytes.DACDATx_H;

    DACDATx_FULL_REG_ptr++;

    read_DAC_DATx_L = DACDATx_FULL_REG_ptr->Bytes.DACDATx_L;

    read_DAC_DATx_H = DACDATx_FULL_REG_ptr->Bytes.DACDATx_H;

#endif

This seemed to read the correct L/H pair.

Regards,

David

View solution in original post

0 Kudos
Reply
2 Replies
1,014 Views
DavidS
NXP Employee
NXP Employee

Hi Theodore,

First have a look at following post to see if it helps:

Second could you declare a the following:

// __no_init DACDATx_FULL_REG DACDATx @0x400CC000;

volatile DACDATx_FULL_REG *DACDATx_FULL_REG_ptr;

In your code then:

    DACDATx_FULL_REG_ptr = 0x400CC000;

    unsigned char read_DAC_DATx_L;

    read_DAC_DATx_L = DACDATx_FULL_REG_ptr->Bytes.DACDATx_L;

Assuming the DAC had been initialized then it should read the correct register value.

One observation though is I think you want to change unsigned long Word; to unsigned short Word;

My code example:

typedef union

{

unsigned short Word;

struct

{

  unsigned char DACDATx_L;

  unsigned char DACDATx_H;

}Bytes;

}DACDATx_FULL_REG;

//DES __no_init DACDATx_FULL_REG DACDATx @0x400CC000;

volatile DACDATx_FULL_REG *DACDATx_FULL_REG_ptr; //DES test

After DAC initialized:

#if 1//DES 1=test, 0=default code

    DACDATx_FULL_REG_ptr = 0x400CC000;

    unsigned char read_DAC_DATx_L, read_DAC_DATx_H;

    read_DAC_DATx_L = DACDATx_FULL_REG_ptr->Bytes.DACDATx_L;

    read_DAC_DATx_H = DACDATx_FULL_REG_ptr->Bytes.DACDATx_H;

    DACDATx_FULL_REG_ptr++;

    read_DAC_DATx_L = DACDATx_FULL_REG_ptr->Bytes.DACDATx_L;

    read_DAC_DATx_H = DACDATx_FULL_REG_ptr->Bytes.DACDATx_H;

#endif

This seemed to read the correct L/H pair.

Regards,

David

0 Kudos
Reply
1,013 Views
lordtheo
Contributor I

Hi David

Thank you very much. It compiles fine.

I haven't yet test it to see if it reads correctly. Once I finish building up the code I will check.

Once again Thank you.

Best Regards,

--

Theo

0 Kudos
Reply