viable alternative at input 'ASSERT'

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

viable alternative at input 'ASSERT'

2,140 次查看
tbiberdorf
Contributor IV

I have been getting the following linker error being posted by a host of .ld files that included in my workspace but not used by my project settings and I'm not sure how to have MCUXpresso ignore them.

tbiberdorf_0-1622827127935.png

I am using version v11.2.1 of MCUXpresso:

tbiberdorf_1-1622827272560.png

 

I modified my project settings as per the following forum entry but this has made no effect on the ASSERT issue.

https://community.nxp.com/t5/MCUXpresso-IDE/How-can-we-disable-the-syntax-checking-of-linker-files/m...

This does not prevent my project from building and I am still able to load and debug my project with no issues.  It's just that I don't know why MCUXpresso is indicating that they are there 

tbiberdorf_2-1622827452434.png

 

Does anyone have any other suggestions to follow?

Thanks

0 项奖励
回复
3 回复数

2,134 次查看
ErichStyger
Specialist I

Hi @tbiberdorf ,

if you could post your linker file(s) here then the NXP IDE engineering team could have a look and fix the problem in linker file parser (I hope).

Otherwise: if you open the file with the text editor, the errors still remain in the Problems view.

To get them removed, go to the view and delete them:

ErichS_0-1622830445899.png

 

I hope this helps,

Erich

0 项奖励
回复

2,130 次查看
tbiberdorf
Contributor IV

attached is one of the linker files.

The interesting thing is that my project does not even use any of these .ld files, so all these error messages really confuse finding and fixing errors when they do happen.

The error message is associated with lines 117 and 154.

. = ASSERT((__data_load_start__ + SIZEOF(.data)) >= __FLASH_segment_start__ && (__data_load_start__ + SIZEOF(.data)) <= (__FLASH_segment_end__) , "error: .data is too large to fit in FLASH memory segment");

. = ASSERT(__heap_end__ >= __SRAM_segment_start__ && __heap_end__ <= (__SRAM_segment_end__) , "error: .heap is too large to fit in SRAM memory segment");

0 项奖励
回复

2,120 次查看
ErichStyger
Specialist I

Hi @tbiberdorf ,

>>The interesting thing is that my project does not even use any of these .ld files,

The IDE parses the file when you open it, flagging errors that time. The messages are not coming from the linker but from the IDE.

Looking closer to your ASSERTs I think they are indeed wrong, see https://sourceware.org/binutils/docs/ld/Miscellaneous-Commands.html : you cannot use them as expressions and assign it to the current location: you need to remove the .= in front of them.

 

I hope this helps,

Erich

 

0 项奖励
回复