Rebuild BSP with IAR error

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

Rebuild BSP with IAR error

跳至解决方案
3,064 次查看
GaQuay
Contributor I

Hi,

I am trying to rebuild the bsp using IAR v6.0 and the compiler generates these of errors.

 

Error[Pe144]: a value of type "int" cannot be used to initialize an entity of type "unsigned int const volatile *"

 

The error points to this code

 

static  uint32_t volatile * const pctl_ptr_arr[] = {
    &(PORTA_PCR(0)),
    &(PORTB_PCR(0)),
    &(PORTC_PCR(0)),
    &(PORTD_PCR(0)),
    &(PORTE_PCR(0))
};


I rebuilt the BSP on another machine (windows xp) and it compiled just fine.

 

Does any one have this same problem?

 

0 项奖励
回复
1 解答
2,326 次查看
PetrM
Senior Contributor I

Hello,

 

I'm able to compile this with IAR 6.10.1:

 

 

static  uint32_t volatile * const pctl_ptr_arr[] = {
    &(PORTA_PCR(0)),
    &(PORTB_PCR(0)),
    &(PORTC_PCR(0)),
    &(PORTD_PCR(0)),
    &(PORTE_PCR(0))
};

 

 

uint32_t volatile * port;
port = pctl_ptr_arr[2];

 

 

Do your macros PORTx_PCR() resolve to uint32_t volatile type? Maybe they are not known and compiler assumes int...

 

Regards,

PetrM

 

在原帖中查看解决方案

0 项奖励
回复
4 回复数
2,327 次查看
PetrM
Senior Contributor I

Hello,

 

I'm able to compile this with IAR 6.10.1:

 

 

static  uint32_t volatile * const pctl_ptr_arr[] = {
    &(PORTA_PCR(0)),
    &(PORTB_PCR(0)),
    &(PORTC_PCR(0)),
    &(PORTD_PCR(0)),
    &(PORTE_PCR(0))
};

 

 

uint32_t volatile * port;
port = pctl_ptr_arr[2];

 

 

Do your macros PORTx_PCR() resolve to uint32_t volatile type? Maybe they are not known and compiler assumes int...

 

Regards,

PetrM

 

0 项奖励
回复
2,326 次查看
GaQuay
Contributor I

Thank for the hint. I will try to look into it.  The message seems to point to what you suggested.

But just out of curiosity, I compiled this same piece of code using other machine, XP 32 bit, it works just fine.

Thanks I will post what I find out.

 

 

0 项奖励
回复
2,326 次查看
akvarel
Contributor I

I have IAR 6.20.2 and on that compiller I get an error:

Error[Pe144]: a value of type "int" cannot be used to initialize an entity of type "unsigned long volatile *" C:\Program Files\Freescale\Freescale MQX 3.7\mqx\source\io\lcd\lcd_twrk40x256.c 71 

The same for other 2 files from MQX. It is compiled just fine with IAR 6.20.1 and with CW10.1. Where can be the problem? How to fix it ?

0 项奖励
回复
2,326 次查看
anthony_huereca
NXP Employee
NXP Employee

There was a bug introduced in IAR 6.20.2. Download 6.20.3 and you should be good to go.

0 项奖励
回复