Automatic startup_mke02z4 file modification

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

Automatic startup_mke02z4 file modification

Jump to solution
2,426 Views
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?

Labels (1)
0 Kudos
Reply
1 Solution
2,351 Views
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

View solution in original post

0 Kudos
Reply
2 Replies
2,351 Views
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 Kudos
Reply
2,352 Views
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 Kudos
Reply