You are here

Modify code size in fx3.ld file | Cypress Semiconductor

Modify code size in fx3.ld file

Summary: 5 Replies, Latest post by AMi Entertainment on 19 Feb 2013 10:53 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
YI's picture
15 posts

I am working on FX3 firmware, my firmware size about 200KB is bigger than the default 180KB in fx3.ld, I changed the fx3.ld file as attached:

SYS_MEM : ORIGIN = 0x40003000 LENGTH = 0x3D000
DATA : ORIGIN = 0x40040000 LENGTH = 0x8000

Also I changed the RTOS heap area in cyfxtx.c

#define CY_U3P_MEM_HEAP_BASE ((uint8_t *)0x40040000/*0x40038000*/)
#define CY_U3P_MEM_HEAP_SIZE (0x8000)

Compiler PASS, but PC host can't build the connection with FX3. If I reduced the file size and used the defualt fx3.ld, everything works normally.

What is my problem and how to fix it? Thank you!


Lumpi6's picture
341 posts

Hi Yi,


I think you should change the MEM_HEAP_BASE in the cyfxtx.c file not as you wrote


#define CY_U3P_MEM_HEAP_BASE ((uint8_t *)0x40040000/*0x40038000*/)
#define CY_U3P_MEM_HEAP_SIZE (0x8000)


because you are using 0x10000 more so you should use 0x40048000 instead of 0x40040000 like


#define CY_U3P_MEM_HEAP_BASE ((uint8_t *)0x40048000/*0x40038000*/)
#define CY_U3P_MEM_HEAP_SIZE (0x8000)




_Gary_'s picture
14 posts

 Hi all,

Can you please kindly advise how to check the firmware size or the memory allocation?

Is there a report file?


rskv's picture
Cypress Employee
1134 posts


The physical size of the .img file itself give you the size of the image.

You can just look at the properties of the .img file.


sai krishna.

_Gary_'s picture
14 posts

Hi sai krishna,

Thanks a lot! 

AMi Entertainment's picture
2 posts

 Why did you have to change the heap size, could you just change the code size in the fx3.ld file and the script would recalculated the heap for you.

Log in to post new comments.