cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 6 MCU

Anva_2903386
New Contributor II

The example I use "PSoC_EmEEPROM_PSoC601"  compile no Error  

Using the the same in my program I get the following error at the line

"Em_EEPROM_config.userFlashStartAddr = (uint32_t)Em_EEPROM_em_EepromStorage; " 

error - cannot assign to variable 'Em_EEPROM_config' with const-qualified type 'constcy_stc_eeprom_config_t'

This is different in my program:

Device CYBLE416045-02

I use FREERTOS

I  use BLE DFU and changed the following:

dfu_cmop.ld - em_eeprom (rx) : ORIGIN = 0x14000000, LENGTH = 0x4000

dfu_cm4.ld - em_eeprom (rx) : ORIGIN = 0x14004000, LENGTH = 0x4000

 

0 Likes
1 Solution
DheerajK_81
Moderator
Moderator

Hello @Anva_2903386 ,

The reason you are seeing this error is that you probably have "Config data in flash" checkbox checked in the Em_EEPROM component as shown below:

DheerajK_81_0-1611921779483.png

What this setting does is, it creates the configuration structures as a const type. You can check the Em_EEPROM.h file for this:

extern cy_stc_eeprom_config_t const Em_EEPROM_config;

 

Since this is const, the structure will be stored in flash and hence you cannot manipulate this in main.c directly. This is why you get the error. 

In the project that builds successfully, you can see that this option isn't checked. So, it gets stored in the SRAM allowing you to manipulate it in the code.

Hope this resolves your query 🙂

Regards,
Dheeraj

View solution in original post

0 Likes
1 Reply
DheerajK_81
Moderator
Moderator

Hello @Anva_2903386 ,

The reason you are seeing this error is that you probably have "Config data in flash" checkbox checked in the Em_EEPROM component as shown below:

DheerajK_81_0-1611921779483.png

What this setting does is, it creates the configuration structures as a const type. You can check the Em_EEPROM.h file for this:

extern cy_stc_eeprom_config_t const Em_EEPROM_config;

 

Since this is const, the structure will be stored in flash and hence you cannot manipulate this in main.c directly. This is why you get the error. 

In the project that builds successfully, you can see that this option isn't checked. So, it gets stored in the SRAM allowing you to manipulate it in the code.

Hope this resolves your query 🙂

Regards,
Dheeraj

View solution in original post

0 Likes
Top labels