Automatic startup_mke02z4 file modification

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

Automatic startup_mke02z4 file modification

跳至解决方案
2,449 次查看
mauriziospagni
Contributor II

Each time I save the file startup_mke02z4.c from the MCUxpresso IDE this part of the code:

  __attribute__((used, section(".FlashConfig"))) const struct
  {
    unsigned int word1;
    unsigned int word2;
    unsigned int word3;
    unsigned int word4;
  } Flash_Config = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFEFFFF };

is surreptitiously changed to:

const struct
  __attribute__((used, section(".FlashConfig")))
  {
    unsigned int word1;
    unsigned int word2;
    unsigned int word3;
    unsigned int word4;
  } Flash_Config =
  { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFEFFFF };

I don't care too much about the formatting, but the second form results in:

- "warning: 'used' attribute does not apply to types [-Wattributes]"

- "warning: 'section' attribute does not apply to types [-Wattributes]"

- "arm-none-eabi/bin/ld.exe: Linker Flash Config Support Enabled, but no .FlashConfig section provided within application"

- "error: ld returned 1 exit status"

All that for a change I didn't ask for nor I want.

To make any change I must always modify, and save, that file with an external editor.

Why does MCUxpresso IDE behave so?

标签 (1)
0 项奖励
回复
1 解答
2,374 次查看
mauriziospagni
Contributor II

Of course "formatter" was the first place I looked into, but the formatting must be requested.

And in "Save actions", "Format source code" is unchecked.

What I overlooked was "Align const", that was checked.

Thank you

在原帖中查看解决方案

0 项奖励
回复
2 回复数
2,374 次查看
lpcxpresso_supp
NXP Employee
NXP Employee

I don't see this behaviour - no reformatting of that block in code I'm looking at now.

You should check the "Formatter" and "Save Actions" settings in your workspace Preferences.

Regards,

MCUXpresso IDE Support

pastedImage_1.png

0 项奖励
回复
2,375 次查看
mauriziospagni
Contributor II

Of course "formatter" was the first place I looked into, but the formatting must be requested.

And in "Save actions", "Format source code" is unchecked.

What I overlooked was "Align const", that was checked.

Thank you

0 项奖励
回复