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

PSoC™ 4 Forum Discussions

MiEl_3261856
Level 2
Level 2
First like given

Hi,

I use PSOC 4 and i have a few variables that I saving in cy_checksum_exclude section.

How can I save the variables in predefined flash addresses only in the cy_checksum_exclude section?

0 Likes
3 Replies
RyanZhao
Moderator
Moderator
Moderator
750 replies posted 100 sign-ins 100 likes received

Hi Mich,

According to your describing, I think you have known how to enable cy_checksum_exclude section. The only problem is how to put a variable in a absolute address in Flash.

The KBA is FYI:

https://community.cypress.com/docs/DOC-9476#Section2

Thanks,

Ryan

0 Likes

I define a variables in the checksum exclude section in the flash:

static const volatile uint8_t  g_DisableNoActivity1 CY_SECTION(".cy_checksum_exclude")

static const volatile uint8_t  g_DisableNoActivity2 CY_SECTION(".cy_checksum_exclude")

static const volatile uint8_t  g_DisableNoActivity3 CY_SECTION(".cy_checksum_exclude")

and I want that g_DisableNoActivity1/2/3 will predefined in permanent flash addresses in the range of checksum exclude section addresses.

I tried to set addresses through the Project--> Build Settings--> linker but I had to change the variables section name:

static const volatile uint8_t  g_DisableNoActivity1 CY_SECTION(".SECTION1")

static const volatile uint8_t  g_DisableNoActivity2 CY_SECTION(".SECTION2")

static const volatile uint8_t  g_DisableNoActivity3 CY_SECTION(".SECTION3")

--> custom Flags --> -Wl,--section-start=.SECTION1=0x0000001080 -Wl,--section-start=.SECTION2=0x0000003088 -Wl,--section-start=.SECTION3=0x0000005090 -Wl,--section-start=.SECTION4=0x0000007098

It made me new sections but that's not what I was looking for.

I want that the variables be set in the permanent addresses inside the checksum exclude section.

thanks,

Michelle

0 Likes

Hi Mich,

checksum exclude section always occupies last several rows if user not specifying address.

Actually you can set the variable address inside the checksum exclude section area.

/*************************************************************************/

uint8 my_var[10] CY_SECTION(".MY_test_sect") = {0x10, 0x12, 0x13, 0x14, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A};

/*************************************************************************/

Then in cm0gcc.ld. add this sentence:

/*************************************************************************/.

MY_test_sect 0x7fc0 : { KEEP(*(.MY_test_sect)) }>rom

/*************************************************************************/

Thanks,

Ryan

0 Likes