PSoC 63 PSoC Creator 4.4 DFU Example App1 works but too small to add my code

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

cross mob
SimonCanada
Level 3
Level 3
25 replies posted 10 questions asked 50 sign-ins

I'm using a PSoC63, PSoC Creator 4.4 and have based my project on CE216767 to get a DFU OTA. A colleague got this example working and I'm using his copy. All fine until I added my application code, which worked fine as a "bare bones" app (i.e. no BLE and no DFU. Both App0 and App1 in the code I inherited are running the BLE exclusively in the CM0p, and both run their applications in the CM0p. Once I added the same functionality to App1, I got a build error "Build error: region `flash_app1_core0' overflowed by 11568 bytes" in dfu_cm0p.ld

Assuming that this just needed a small change to the linker file, which was originally

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

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

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

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

and tried to increase the size of flash_app1_core0 by changing the last two to

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

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

but now I am getting

Merge error: section at 0x10071534 from C:PSoC Creator\DFU-OTA\App1.cydsn\CortexM4\ARM_GCC_541\Debug\App1_signed.elf overlaps section at 10071600 from C:\PSoC Creator\DFU-OTA\App1.cydsn\CortexM0p\ARM_GCC_541\Debug\App1.elf

(I have redacted the full path names to make it easier to read).

Please can you tell me what I have done wrong?

0 Likes
1 Solution
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi @SimonCanada ,

The loader program should always know where to put App1.
This has to be decided at compile time.
 
Regards,
Alakananda

View solution in original post

4 Replies
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi @SimonCanada ,

Please make sure that the memory regions are all aligned in the linker scripts of all the apps and not just App1.

Can you share the linker script of both apps so that we can verify at our end.

Regards,

Alakananda
0 Likes

Hi Alakananda

"Please make sure that the memory regions are all aligned in the linker scripts of all the apps and not just App1."

I think they are.

"Can you share the linker script of both apps so that we can verify at our end."

The four files are enclosed in the zip. I have added -app0 and -app1 to the names of the files in the zip. The files in the projects have the original names.

What happened is that before you replied last night (my time) I had restarted PSoC Creator and when I compiled both programs together using these linker changes only in App1, without having changed anything else, no errors were reported.

Before your reply, I had not changed the linker files in App0. Please tell me why this is necessary? Other projects from different silicon companies (e.g. Silabs, STM, Hitachi) I have worked on that use a loader program do not give the loader program (e.g. App0) any information about the target program (e.g. App1) at compile time. I would like to understand.

Thank you, Simon

0 Likes
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi @SimonCanada ,

The loader program should always know where to put App1.
This has to be decided at compile time.
 
Regards,
Alakananda

Hi Alakananda

Thank you. This feature is all-important to this project as once the product has been assembled, it will not be possible to access the PSoC physically to upgrade the firmware. I will need to discuss this with the project leader as it looks like we have to make some long-term decisions about the expected maximum sizes.

Thank you for your advice, Simon

0 Likes