Em_EEPROM_config is a const and causing warnings in PSoC Creator 4.2

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I'm trying to incorporate the example from the eeprom example:

CE195313 PSoC Emulated EEPROM

into my project.

However when I compile the code, it generates Em_EEPROM_config as a const, and therefore causes warnings when I compile with the following line:

eepromReturnValue = Cy_Em_EEPROM_Init(&Em_EEPROM_config, &Em_EEPROM_context);

The warning is:

prj.M0121: passing argument 1 of 'Cy_Em_EEPROM_Init' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

The example project does not generate this as a const, but mine does in PSoC Creator 4.2.

Any help would be much appreciated.

Thanks

0 Likes
1 Solution
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello ,

Can you make sure that the "Config Data in Flash" option is unchecked in the Em_EEPROM component configuration window Built-in tab.

Thanks,

Hima

View solution in original post

0 Likes
4 Replies
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Can you please attach your project. In the example project this is not declared as a const.

extern cy_stc_eeprom_config_t Em_EEPROM_config;

This is declared as a variable of type cy_stc_eeprom_config_t type.The actual declaration is inside the file Em_EEPROM.c.

Thanks,

Hima

0 Likes
Anonymous
Not applicable

I'm sorry, I cannot share the project.

If you create an emulated EEPROM block in one of your TopDesign windows and compile, does it generate the config as a const? How do I get it to generate it to match the example project?

0 Likes
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello ,

Can you make sure that the "Config Data in Flash" option is unchecked in the Em_EEPROM component configuration window Built-in tab.

Thanks,

Hima

0 Likes
Anonymous
Not applicable

That fixed it. Thank you!

0 Likes