CX3 How to adjust code area and data area size?

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

cross mob
bayi_4531756
Level 1
Level 1

I now want to copy the sensor configurations into the CX3 firmware. But the sensor configurations occupy 28kB space. And my code area and data area size is 180kB and 30kB repectively by default.  The data area space is insufficient. So I want to adjust the code area size to 150kB and the data area size to 60kB. How can I achieve it?

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

You need to make changes to fx3.ld file as well cyfxtx.c file in the project you are working on.

Path for fx3.ld file ..Cypress\EZ-USB FX3 SDK\1.3\fw_build\fx3_fw

Default

{

I-TCM : ORIGIN = 0x100 LENGTH = 0x3F00                        // 15 KB I TCM Area

SYS_MEM : ORIGIN = 0x40003000 LENGTH = 0x2D000  // 180 KB  Code Area

DATA : ORIGIN = 0x40030000 LENGTH = 0x8000            // 32 KB    Data Area

}

Modifications in fx3.ld file

I-TCM : ORIGIN = 0x100 LENGTH = 0x3F00                        // 15 KB Descriptor Area

SYS_MEM : ORIGIN = 0x40003000 LENGTH = 0x25800  // 150 KB  Code Area

DATA : ORIGIN = 0x40028800 LENGTH = 0xF000            // 60 KB Data area    (40003000+ 0x25800=0x40028800)

Modifications in cyfxtx.c file

#define CY_U3P_MEM_HEAP_BASE        (0x40037800) //  Heap base  (0x40028800 + 0xF000 = 0x40037800)

#define CY_U3P_MEM_HEAP_SIZE        (0x8000)    // 32 KB Heap (not changed)

after these modifications the path to the new fx3.ld file need to be updated in the properties (attachment) and then build the project

Please find the modified fx3.ld file in the attachement (as per the requirements mentioned). I have tested this with gpiftousb example of SDK 1.3.4, the firmware is building successfully.

Regards,

Rashi

Regards,
Rashi

View solution in original post

0 Likes
2 Replies
bayi_4531756
Level 1
Level 1

Below is my error log trace after I copy the sensor configurations into the CX3 firmware.

1.jpg

0 Likes
lock attach
Attachments are accessible only for community members.
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

You need to make changes to fx3.ld file as well cyfxtx.c file in the project you are working on.

Path for fx3.ld file ..Cypress\EZ-USB FX3 SDK\1.3\fw_build\fx3_fw

Default

{

I-TCM : ORIGIN = 0x100 LENGTH = 0x3F00                        // 15 KB I TCM Area

SYS_MEM : ORIGIN = 0x40003000 LENGTH = 0x2D000  // 180 KB  Code Area

DATA : ORIGIN = 0x40030000 LENGTH = 0x8000            // 32 KB    Data Area

}

Modifications in fx3.ld file

I-TCM : ORIGIN = 0x100 LENGTH = 0x3F00                        // 15 KB Descriptor Area

SYS_MEM : ORIGIN = 0x40003000 LENGTH = 0x25800  // 150 KB  Code Area

DATA : ORIGIN = 0x40028800 LENGTH = 0xF000            // 60 KB Data area    (40003000+ 0x25800=0x40028800)

Modifications in cyfxtx.c file

#define CY_U3P_MEM_HEAP_BASE        (0x40037800) //  Heap base  (0x40028800 + 0xF000 = 0x40037800)

#define CY_U3P_MEM_HEAP_SIZE        (0x8000)    // 32 KB Heap (not changed)

after these modifications the path to the new fx3.ld file need to be updated in the properties (attachment) and then build the project

Please find the modified fx3.ld file in the attachement (as per the requirements mentioned). I have tested this with gpiftousb example of SDK 1.3.4, the firmware is building successfully.

Regards,

Rashi

Regards,
Rashi
0 Likes