cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 6 MCU

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
Reply
1 Solution
himam_31
Employee

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
Reply
4 Replies
himam_31
Employee

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
Reply
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
Reply
himam_31
Employee

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
Reply
Anonymous
Not applicable

That fixed it. Thank you!

0 Likes
Reply
Top labels