cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 6 MCU

New Contributor II

I have a project with psoc6 which includes dfu and app, app0 is dfu and app1 is my application.

now i want to upgrade my app to a new version via BLE, not programmer, and the new version app need to reallocate app1's flash and ram.

Questions:

1. Keep app0's flash and ram same as before,  can i reallocate the app1's flash and ram ?

2. if above is right, just modify 4 files, App0{dfu_cm0p.ld, dfu_cm4.ld}, App1{dfu_cm0p.ld, dfu_cm4.ld},  or i need other steps to take ?

3. i am not sure whether app0(dfu) have both app0 and app1's flash and ram map, so i can not change app1's?

4. Any papers or datasheets have this situation ?

// Modify the bold code.

MEMORY

{

    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

    ....

    ram_app0_core0    (rwx) : ORIGIN = 0x08000100, LENGTH = 0x7F00

    ram_app0_core1    (rwx) : ORIGIN = 0x08008000, LENGTH = 0x8000

    ram_app1_core0    (rwx) : ORIGIN = 0x08000100, LENGTH = 0x7F00

    ram_app1_core1    (rwx) : ORIGIN = 0x08008000, LENGTH = 0x8000

     ....

}

0 Likes
Reply
1 Solution
Moderator
Moderator

docn_292601

Yes, you can re-allocate the ram/flash size for cm0+/cm4 based on your application requirements, so long as the ram/flash space not overlapped for both cores and the whole ram/flash size allocated for both cores not exceed the available size.

For this purpose, you need to modify all the 4 linker files - dfu_cm0p.ld, dfu_cm4.ld for both app0/app1, to make ram/flash allocation identical. Except for that, you need to do nothing.

The Memory Layout part of AN213903 may be a good reference for you - https://www.cypress.com/file/396601/download

View solution in original post

0 Likes
Reply
5 Replies
Moderator
Moderator

docn_292601

Yes, you can re-allocate the ram/flash size for cm0+/cm4 based on your application requirements, so long as the ram/flash space not overlapped for both cores and the whole ram/flash size allocated for both cores not exceed the available size.

For this purpose, you need to modify all the 4 linker files - dfu_cm0p.ld, dfu_cm4.ld for both app0/app1, to make ram/flash allocation identical. Except for that, you need to do nothing.

The Memory Layout part of AN213903 may be a good reference for you - https://www.cypress.com/file/396601/download

View solution in original post

0 Likes
Reply
New Contributor II

Thanks a lot.

I thought there is only one chance to decide both app0 and app1's flash and ram location and size, because both app0 and app1's project have the same *.ld files, and only app1 was able to upgrade.

So app1 memory info part in app0's ld files doesn't matter to hex and cyacd2 file. am i right?

0 Likes
Reply
New Contributor II

谢谢您回答我的问题, 我还是想确认下, 我的产品已经送到客户那里, 剩下的更新只能通过DFU进行。

我的问题不是设计之初规划flash和RAM, 而是后面通过BLE OTA的模式重新对app1的flash和ram进行重新分配。

另外一个问题,app0和app1的ld文件相同的问题,这个让人很迷惑,一方面要求相同,另一方面app0又不能更新, 只能更行app1, 这个是我问题的主要来源,这是cypress开发工具的缺陷吗?

0 Likes
Reply
Moderator
Moderator

对于app0已经烧录完成后,在使用过程中app1的memory大小分配发生变化,是可以继续通过原有app0完成固件升级的,前提是app1 linker文件中app0的memory大小分配没有变化。

在dfu过程中,app1 linker文件中的memory大小分配会通过CY_DFU_CMD_SET_APP_META命令更新至device本地metadata。所以应该不存在你担心的问题。

0 Likes
Reply
New Contributor II

再次感谢。

0 Likes
Reply
Top labels