- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would like to define constant at fixed location for FX3 so that when I analyze the image file, I can read its value at this known address.
From FX3 TRM, system address from 0x40000000 to 0x4007FFFF.
Something like this:
#define ID "0013" @ 0x40004000
How to code this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
You can initialize a section in the linker file (fx3.ld) in the FX3 SDK as below (path: <installation directory>\1.3\fw_build\fx3_fw), which is a part of the Data Section starting at 0x40030000.
fx3.ld:
Then define the variable in the created section
You can assign this variable any value.
It will be placed under the define section at the respective address:
map file:
Thanks,
Yatheesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
You can initialize a section in the linker file (fx3.ld) in the FX3 SDK as below (path: <installation directory>\1.3\fw_build\fx3_fw), which is a part of the Data Section starting at 0x40030000.
fx3.ld:
Then define the variable in the created section
You can assign this variable any value.
It will be placed under the define section at the respective address:
map file:
Thanks,
Yatheesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I modified the linker file and defined a variable in main.c file as
uint32_t __attribute__((section (".mySection"))) buff1 = 0xBB01;
When I checked .map file, I got this but buff1 is not there:
.mySectionBlock
0x40033000 0x0
0x40033000 . = ALIGN (0x4)
*(.mySection)
.data 0x40047000 0xdfc
0x40047000 _data = .
(.data)
.data.glI2cPageSize
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your linker file cannot be used for my project. BTW, my project has this memory definition in the linker file.
MEMORY
{
I-TCM : ORIGIN = 0x100 LENGTH = 0x3F00
SYS_MEM : ORIGIN = 0x40003000 LENGTH = 0x44000
DATA : ORIGIN = 0x40047000 LENGTH = 0x8000
}
I did try this but .map file is not OK.
.mySectionBlock 0x40048000 :
{
. = ALIGN(4);
KEEP(*(.mySection))
} > DATA
.mySectionBlock
0x40048000 0x0
0x40048000 . = ALIGN (0x4)
*(.mySection)
.data 0x40047000 0xdfc
0x40047000 _data = .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Looks like the variable is not declared properly in the project. That might be the reason the variable is not reflected in the map file.
Please declare the variable in the main .c file as a global variable.
uint32_t __attribute__((section (".mySection"))) buff_1 = 0x11223344;
Thanks,
Yatheesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The problem is the same as before.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please share your project here.
Thanks,
Yatheesh