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

PSoC™ 6 Forum Discussions

Anonymous
Not applicable

I am following the CE216767 BLE bootloadable project example to convert my project ble project to a BLE bootloadable one. I keep getting an error message during generation of the bootloadable file (.cyacd):

ERROR: C:\Users\FelixLe\Documents\PSoC Creator\Design0592_1\Design0592.cydsn\CortexM0p\ARM_GCC_541\Debug\Design0592_link.elf section `i.betacyRetentionInit' will not fit in region `flash_app1_core0'

ERROR: region `flash_app1_core0' overflowed by 1376 bytes

I understand what the issue is (I think) but I'm not sure how to increase the size of my flash_app1_core0. I have tried increasing the size in the bootload_common.ld file from:

    flash_app0_core0  (rx)  : ORIGIN = 0x10000000, LENGTH = 0x10000

    flash_app0_core1  (rx)  : ORIGIN = 0x10010000, LENGTH = 0x30000

    flash_app1_core0  (rx)  : ORIGIN = 0x10040000, LENGTH = 0x32000

    flash_app1_core1  (rx)  : ORIGIN = 0x10072000, LENGTH = 0x02000

to

    flash_app0_core0  (rx)  : ORIGIN = 0x10000000, LENGTH = 0x10000

    flash_app0_core1  (rx)  : ORIGIN = 0x10010000, LENGTH = 0x33000

    flash_app1_core0  (rx)  : ORIGIN = 0x10043000, LENGTH = 0x35000

    flash_app1_core1  (rx)  : ORIGIN = 0x10078000, LENGTH = 0x02000

However no changes I make in this file affect anything and I still get the same error message. I even tried breaking the code in the bootload_common.ld but it still builds just fine and gives me the exact same error. Can someone help me figure out how to increase the size of the flash region for my app1 on core 0. I am fairly sure that I only need to increase the flash region b/c I managed to convert a very simple led project (it didn't have BLE) to a ble bootloadable one. I have attached my project files below. Thank you for your time!

0 Likes
1 Solution

Please find the attached bootloadable project which is modified based on the original project you provided.

Note below several points:

1)need to enable cm4 because the post-build batch file can only be added for cm4 to generate .cyacd2 file.

2)need to comment the eeprom space allocation for cm4, to avoid the mismatch of eeprom allocation for two cores.  There would always conflict between BLE and EEPROM component for eeprom space allocation. Also there maybe some other workarounds.

3)need to expand flash and ram size for cm0+ use, because two much stuff involved on cm0+, but need to take care not to overlap the boundry of memory for app0 you used.

View solution in original post

0 Likes
6 Replies
ShipingW_81
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

Can you please attach the original project without any modification?

The project you attached looks like semi-finished, maybe not easy to lock the root-cause.

0 Likes
Anonymous
Not applicable

Yeah, here it is. Thank you!

Attachment 002-16767 is the example ble bootloader. My original project is the Desgin0592 attachment.

0 Likes

Please find the attached bootloadable project which is modified based on the original project you provided.

Note below several points:

1)need to enable cm4 because the post-build batch file can only be added for cm4 to generate .cyacd2 file.

2)need to comment the eeprom space allocation for cm4, to avoid the mismatch of eeprom allocation for two cores.  There would always conflict between BLE and EEPROM component for eeprom space allocation. Also there maybe some other workarounds.

3)need to expand flash and ram size for cm0+ use, because two much stuff involved on cm0+, but need to take care not to overlap the boundry of memory for app0 you used.

0 Likes
Anonymous
Not applicable

Thank you for the help! I have a few questions regarding your answers.

1.) How do you enable the cm4 core? I'm not sure how to do that.

2.) When you say comment the eeprom space allocation for cm4, where am I supposed to do this (as in what file and general location)

3.) When you say expand flash and ram size for cm0+ to use, how do I do this. Also how do I know how much of these resources are being used?

Lastly, could you explain to me your modifications of the original project file to a bootloadable one? I ask this b/c when I looked at the project you uploaded, it doesn't have any of the booload scripts that the CE216767 project instructions on converting a project to a bootloadable one required. The instructions required for example the bootload_common.{ld|icf} files, but the one you uploaded doesn't have them. The only change I noticed was that the post_build_core1.bat file was included.

I ran the design and it was booloadable. Thanks again!

0 Likes

to your questions-

1.) How do you enable the cm4 core? I'm not sure how to do that.

Just add line in KinOS_Boot() -- Cy_SysEnableCM4(CY_CORTEX_M4_APPL_ADDR);

2.) When you say comment the eeprom space allocation for cm4, where am I supposed to do this (as in what file and general location)

comment below code snippet in bootload_cm4.ld, instead of cy8c6xx7_cm4_dual.ld.

/* Emulated EEPROM Flash area */

             .cy_em_eeprom :

            {

                  KEEP(*(.cy_em_eeprom))

   } > em_eeprom

3.) When you say expand flash and ram size for cm0+ to use, how do I do this. Also how do I know how much of these resources are being used?

Generally, it would show which memory section is overflowed. For instance, if it shows memory section flash_app1_core0 overflowed, you need expand range of flash_app1_core0 in bootload_common.ld accordingly. You can see in the project I attached, the LENGTH is modified as LENGTH = 0x60000. But not to touch the ORIGIN address.

MEMORY

{

    flash_app0_core0  (rx)  : ORIGIN = 0x10000000, LENGTH = 0x10000

    flash_app0_core1  (rx)  : ORIGIN = 0x10010000, LENGTH = 0x30000

   flash_app1_core0  (rx)  : ORIGIN = 0x10040000, LENGTH = 0x60000

   flash_app1_core1  (rx)  : ORIGIN = 0x100A0000, LENGTH = 0x10000

...

}

As for the required files for bootloadable project, I double checked they all exist in that project. Take bootload_common.ld as example, please find it under path Shared Files -> ARM GCC Generic.

Lastly, again, chapter 4.3 in AN213924 should be a good guidance for this process.

Anonymous
Not applicable

Thank you so much for all the help! I really appreciate it!

0 Likes