Not applicable
Mar 24, 2016
10:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 24, 2016
10:24 AM
Hi all,
I have an XMC4400 evaluation board. At some point in my program I declare an array that is big enough to occupy memory space on either side of the PSRAM and DSRAM1 boundary (see image below).
Below is a snippet from the ".map" file that shows that indeed the array has one of its members on the border.
The linker script defines the following region that crosses the boundary between the regions; this is where the ".bss" data is placed, too, as per linker script.
However, when the array is allocated memory space during the startup, upon crossing the boundary between memory regions (unaligned, too, as the offending address shown in BFAR register is 0x1FFF FFFD), the program generates a Bus Fault. Could you please help me figure out a way to go about this issue?
Thank you!
Regards,
Andrey
I have an XMC4400 evaluation board. At some point in my program I declare an array that is big enough to occupy memory space on either side of the PSRAM and DSRAM1 boundary (see image below).
Below is a snippet from the ".map" file that shows that indeed the array has one of its members on the border.
/* Map file snippet */
.bss 0x1fffc898 0x4009 load address 0x0c001eb4
0x1fffc898 . = ALIGN (0x4)
0x1fffc898 __bss_start = .
*(.bss)
*(.bss*)
.bss.resultsArray
0x1fffc898 0x4000 ./main.o
0x1fffc898 resultsArray
.bss.resultsArrayIndex
0x20000898 0x2 ./main.o
0x20000898 resultsArrayIndex
*fill* 0x2000089a 0x2
The linker script defines the following region that crosses the boundary between the regions; this is where the ".bss" data is placed, too, as per linker script.
/* Linker script snippet */
SRAM_combined(!RX) : ORIGIN = 0x1FFFC000, LENGTH = 0x14000
/* Some linker script code here */
/* BSS section */
.bss (NOLOAD) :
{
. = ALIGN(4);
__bss_start = .;
* (.bss);
* (.bss*);
* (COMMON);
*(.gnu.linkonce.b*)
__bss_end = .;
} > SRAM_combined
__bss_size = __bss_end - __bss_start;
However, when the array is allocated memory space during the startup, upon crossing the boundary between memory regions (unaligned, too, as the offending address shown in BFAR register is 0x1FFF FFFD), the program generates a Bus Fault. Could you please help me figure out a way to go about this issue?
Thank you!
Regards,
Andrey
2 Replies
Mar 26, 2016
03:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 26, 2016
03:39 PM
Hi Andrey,
Please add an alignment statement just before the _bss_end symbol definition as shown below.
Regards,
Jesus
Please add an alignment statement just before the _bss_end symbol definition as shown below.
/* BSS section */
.bss (NOLOAD) :
{
. = ALIGN(4);
__bss_start = .;
* (.bss);
* (.bss*);
* (COMMON);
*(.gnu.linkonce.b*)
. = ALIGN(4);
__bss_end = .;
} > SRAM_combined
__bss_size = __bss_end - __bss_start;
Regards,
Jesus
Not applicable
Mar 28, 2016
09:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 28, 2016
09:07 AM
Jesus,
Thank you so much - this has fixed the issue!
Regards,
Andrey
Thank you so much - this has fixed the issue!
Regards,
Andrey