Another case of Build error: CY_BOOT: Section .cy_checksum_exclude size exceeds specified limit.

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

cross mob
GeIo_1586191
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

I see there have a been a few similar queries before where other modules have generated this Build error but none of the answers given in those queries help me understand this issue.

Background:

I have a Solar Powered IoT Device Kit (with BLE module CYBLE-022001. I tried to build the Simple_BLE example but get the error "Section .cy_checksum_exclude size exceeds specified limit." When you double click on the error message it opens up the Linker script file cm0gcc.ld but does not highlight which line.

Based on other online searches and comparing this to the LED_ONOFF example, which does compile/ build ok, it appears to be related to this line here

CY_CHECKSUM_EXCLUDE_SIZE        = ALIGN(640, CY_FLASH_ROW_SIZE);

The LED_ONOFF example has

CY_CHECKSUM_EXCLUDE_SIZE        = ALIGN(0, CY_FLASH_ROW_SIZE);

So my question is, where did the "640" come from in the Simple_BLE example. How/where was this set.

I know that if I go to the Bootloadable component in TopDesign and change the "Checksum exclude size (bytes)" to 640 it does work and I can build my project.

But still no idea why.

Any advice will be greatly appreciated.

Thanks.

0 Likes
1 Solution
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

This error occur when you update both BLE and cy_boot component from Project > Update Components in Simple_BLE project.

The latest BLE component places cyBle_flashStorage in cy_checksum_exclude section by default. Please refer to BLE_gatt.c for more details.

#if(CYBLE_MODE_PROFILE)

    #if defined(__ARMCC_VERSION)

        CY_ALIGN(CYDEV_FLS_ROW_SIZE) const CY_BLE_FLASH_STORAGE cyBle_flashStorage CY_SECTION(".cy_checksum_exclude") =

    #elif defined (__GNUC__)

        const CY_BLE_FLASH_STORAGE cyBle_flashStorage CY_SECTION(".cy_checksum_exclude")

            CY_ALIGN(CYDEV_FLS_ROW_SIZE) =

    #elif defined (__ICCARM__)

        #pragma data_alignment=CY_FLASH_SIZEOF_ROW

        #pragma location=".cy_checksum_exclude"

        const CY_BLE_FLASH_STORAGE cyBle_flashStorage =

    #endif  /* (__ARMCC_VERSION) */

    {

     .....

    };

#endif /* (CYBLE_MODE_PROFILE) */

#endif  /* (CYBLE_MODE_PROFILE) && (CYBLE_BONDING_REQUIREMENT == CYBLE_BONDING_YES) */

cy_boot component checks whether required and provided cy_checksum_exclude sizes mach, if not throws an error (cm0gcc.ld).

    /* Bootloadable applications only: verify that size of the data in the section is within the specified limit. */

    cy_checksum_exclude_size = (CY_APPL_LOADABLE == 1) ? SIZEOF(.cy_checksum_exclude) : 0;

    ASSERT(cy_checksum_exclude_size <= CY_CHECKSUM_EXCLUDE_SIZE, "CY_BOOT: Section .cy_checksum_exclude size exceedes specified limit.")

cyBle_flashStorage requires 0x285 bytes and linker file allocates 640 bytes in a BLE project  by default. Once you add atleast 1 byte in the checksum exclude size (bootloadable configuration window), one flash row will be added and cyBle_flashStorage can be placed in cy_checksum_exclude section successfully (Simple_BLE.map).

.cy_checksum_exclude

                0x0001fc80      0x285

*(.cy_checksum_exclude)

.cy_checksum_exclude

                0x0001fc80      0x285 .\CortexM0\ARM_GCC_541\Debug\Simple_BLE.a(BLE_gatt.o)

                0x0001fc80                cyBle_flashStorage

                0x00000285                cy_checksum_exclude_size = (CY_APPL_LOADABLE == 0x1)?SIZEOF (.cy_checksum_exclude):0x0

                0x00000001                ASSERT ((cy_checksum_exclude_size <= CY_CHECKSUM_EXCLUDE_SIZE), CY_BOOT: Section .cy_checksum_exclude size exceedes specified limit.)

                0xf0000000                cyloadermeta_start = (cy_project_type_bootloader || cy_project_type_app_for_stack_and_copier)?(LENGTH (rom) - CY_METADATA_SIZE):0xf0000000

ccy_chcy_checksum_exclude ecksum_excludey_checksum_exclude

View solution in original post

7 Replies
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

Checksum exclude section is used to store flash variables or Emulated EEPROM whose content is expected to vary over lifecycle. The size of this memory section is provided in the Bootloadable configuration window and it gets reflected in the linker file. If the LED_ONOFF project is placing any varible to this region, there will be a size limitation. Please confirm whether LED_ONOFF project is placing any variables in the cy_checksum_exclude section.

0 Likes

Thanks for the reply.

I'm not sure if you are aware, but both LED_ONOFF and Simple_BLE projects are examples provided by Cypress as part of the downloadable package for the Solar Powered IoT device kit.

All the LED_ONOFF project does is blink an LED on the board. So I can see no need for a Checksum exclude section value to be > 0 and hence 0 looks good to me and the program builds and works as expected.

With the Simple_BLE project, this is not clear.

By way of background; these are old examples, so when you load them into PSoC Creator 4.2 you need to update the components. Maybe the Checksum exclude section in the Bootloadable component was reset back to 0 as it is not set at 640.

Anyway, as the Bootloadable component had Checksum exclude as 0 the linker file still showed a different value, for Checksum Exclude namely 640. Hence the confusion, as it appears that the 640 value did not reflect the Bootloadable component and I cannot figure out why this is the case.

Hence the question, how does the linker file get configured as it is not behaving as you explained.

0 Likes

I've been playing around trying to figure this out.

So, this is what I've discovered, but now I just want to check if this is the best way to do things.

1. Import the Simple_BLE example.

2. Update components.

3. Then select "Generate Application" which generates all the source files including the Linker script file cm0gcc.ld

4. Open the Linker script file and seek out:

CY_CHECKSUM_EXCLUDE_SIZE        = ALIGN(640, CY_FLASH_ROW_SIZE);

5. copy the 640 (or whatever value is given here)

6. Open up the bootloadable

7. Insert/Paste the copied value into Checksum exclude size (bytes)

8. Build

0 Likes

Following on from those steps I described, I tried something different and got a very strange response indeed.

So as I first described, if we leave the checksum within the Bootloadable component as zero we get an error.

Now, what I've just discovered, is that if I change the checksum value within the Bootloadable component to 1 it sorts itself out and the project builds without error.

I noticed the following output messages during the build process:

No ELF section .cychecksum found, creating one

Application checksum calculated and stored in ELF section .cychecksum

Checksum calculated and stored in ELF section .cymeta

The cm0gcc.ld file also gets automatically amended.

I now have the following:

CY_CHECKSUM_EXCLUDE_SIZE        = ALIGN(641, CY_FLASH_ROW_SIZE);

So, more confused than ever...

0 Likes

More testing done today and I have discovered the "culprit".

Basically I took the example that worked (LED_ONOFF) and slowly added in components and parts of the code from the example that does not work, namely Simple_BLE.

Please find attached the archive which can trigger the problem.

To remove the problem, simply remove the following section of code, which is found in void ProcessBeaconEvents(void):

        switch(beacon_state)

        {

            case BEACON_WAIT:

                /* Wait 1 second to earn enough power to start advertising */

                beacon_state = BEACON_START;

            break;

               

            case BEACON_START:

                /* Stop SOURCE_COUNTER, and start advertisement */

                CySysWdtUnlock(); /* Unlock the WDT registers for modification */

               

                CySysWdtDisable(CY_SYS_WDT_COUNTER0_MASK);

               

                CySysWdtLock();

               

                /* Start Advertisement and enter Discoverable mode*/

                apiResult = CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);

                /* If fails to start advertisement, halt the processor. */

                if(apiResult != CYBLE_ERROR_OK)

                {

                    CYASSERT(0);

                }

                beacon_state = BEACON_RUN;

                wdt_trigger_on_flag = false;

            break;

               

            default:

            break;

        }

As you will notice I am not even using the function.

Rather intrigued...

0 Likes

To remove the problem, simply remove the following section of code, which is found in void ProcessBeaconEvents(void):

I am unable to remove the error by commenting/removing shared code.

0 Likes
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

This error occur when you update both BLE and cy_boot component from Project > Update Components in Simple_BLE project.

The latest BLE component places cyBle_flashStorage in cy_checksum_exclude section by default. Please refer to BLE_gatt.c for more details.

#if(CYBLE_MODE_PROFILE)

    #if defined(__ARMCC_VERSION)

        CY_ALIGN(CYDEV_FLS_ROW_SIZE) const CY_BLE_FLASH_STORAGE cyBle_flashStorage CY_SECTION(".cy_checksum_exclude") =

    #elif defined (__GNUC__)

        const CY_BLE_FLASH_STORAGE cyBle_flashStorage CY_SECTION(".cy_checksum_exclude")

            CY_ALIGN(CYDEV_FLS_ROW_SIZE) =

    #elif defined (__ICCARM__)

        #pragma data_alignment=CY_FLASH_SIZEOF_ROW

        #pragma location=".cy_checksum_exclude"

        const CY_BLE_FLASH_STORAGE cyBle_flashStorage =

    #endif  /* (__ARMCC_VERSION) */

    {

     .....

    };

#endif /* (CYBLE_MODE_PROFILE) */

#endif  /* (CYBLE_MODE_PROFILE) && (CYBLE_BONDING_REQUIREMENT == CYBLE_BONDING_YES) */

cy_boot component checks whether required and provided cy_checksum_exclude sizes mach, if not throws an error (cm0gcc.ld).

    /* Bootloadable applications only: verify that size of the data in the section is within the specified limit. */

    cy_checksum_exclude_size = (CY_APPL_LOADABLE == 1) ? SIZEOF(.cy_checksum_exclude) : 0;

    ASSERT(cy_checksum_exclude_size <= CY_CHECKSUM_EXCLUDE_SIZE, "CY_BOOT: Section .cy_checksum_exclude size exceedes specified limit.")

cyBle_flashStorage requires 0x285 bytes and linker file allocates 640 bytes in a BLE project  by default. Once you add atleast 1 byte in the checksum exclude size (bootloadable configuration window), one flash row will be added and cyBle_flashStorage can be placed in cy_checksum_exclude section successfully (Simple_BLE.map).

.cy_checksum_exclude

                0x0001fc80      0x285

*(.cy_checksum_exclude)

.cy_checksum_exclude

                0x0001fc80      0x285 .\CortexM0\ARM_GCC_541\Debug\Simple_BLE.a(BLE_gatt.o)

                0x0001fc80                cyBle_flashStorage

                0x00000285                cy_checksum_exclude_size = (CY_APPL_LOADABLE == 0x1)?SIZEOF (.cy_checksum_exclude):0x0

                0x00000001                ASSERT ((cy_checksum_exclude_size <= CY_CHECKSUM_EXCLUDE_SIZE), CY_BOOT: Section .cy_checksum_exclude size exceedes specified limit.)

                0xf0000000                cyloadermeta_start = (cy_project_type_bootloader || cy_project_type_app_for_stack_and_copier)?(LENGTH (rom) - CY_METADATA_SIZE):0xf0000000

ccy_chcy_checksum_exclude ecksum_excludey_checksum_exclude