Hello,
I'm trying to debug code linked in RAM. The code was built with IAR compiler.
The code generally works as intennded, but debugging is problematic, because only disassembly view is available for RAM linked code.
The parts of code being linked in flash on the other hand shows C file content in editor.
Also function names in call stack, are visible for functions in flash. only
Example of the sections placed in linker script (only one of many code sections in RAM shown as example):
define symbol _RAMCODE_START = 0x08002800;
define symbol _RAMCODE_END = 0x080127FF;
define region RAMCODE = mem:[from _RAMCODE_START to _RAMCODE_END]; /* 64 KiB */
define root section RamCodeCanSection_START_SEC
{
public _RamCodeCanSection_START:
};
define root section RamCodeCanSection_LIMIT_SEC with alignment = 4
{
public _RamCodeCanSection_LIMIT:
};
define block RamCodeCanSection with fixed order, alignment = 4
{
section RamCodeCanSection_START_SEC,
block RamCodeCanSection_BLOCK { section .RamCodeCanSection },
section RamCodeCanSection_LIMIT_SEC
};
"RAMCODE__RamCodeCanSection": place in RAMCODE
{
block RamCodeCanSection
};
On the code stack I can see only the RAM addresses, no information about function names.
Source files are visible in source file list, so definitely paths in elf are correct and code can be opened in editor with double click.
![](https://forum.segger.com/index.php/Attachment/4869-call-stack-png/?s=29d9cd32465672a6a3913ec27c4e4bee3b91a3d3)
The image is linked using --debug option so symbolic debugging information should be available.
I'm pretty sure that I was able to debug similar code (with parts linked in RAM) built using GCC compiler. The debugging would work seamlessly.
Ozone version used is 3.10j. The core is Cortex M4F.
Could you give me some piece of advise, on what could be checked?
Regards
Jacek
I'm trying to debug code linked in RAM. The code was built with IAR compiler.
The code generally works as intennded, but debugging is problematic, because only disassembly view is available for RAM linked code.
The parts of code being linked in flash on the other hand shows C file content in editor.
Also function names in call stack, are visible for functions in flash. only
Example of the sections placed in linker script (only one of many code sections in RAM shown as example):
define symbol _RAMCODE_START = 0x08002800;
define symbol _RAMCODE_END = 0x080127FF;
define region RAMCODE = mem:[from _RAMCODE_START to _RAMCODE_END]; /* 64 KiB */
define root section RamCodeCanSection_START_SEC
{
public _RamCodeCanSection_START:
};
define root section RamCodeCanSection_LIMIT_SEC with alignment = 4
{
public _RamCodeCanSection_LIMIT:
};
define block RamCodeCanSection with fixed order, alignment = 4
{
section RamCodeCanSection_START_SEC,
block RamCodeCanSection_BLOCK { section .RamCodeCanSection },
section RamCodeCanSection_LIMIT_SEC
};
"RAMCODE__RamCodeCanSection": place in RAMCODE
{
block RamCodeCanSection
};
On the code stack I can see only the RAM addresses, no information about function names.
Source files are visible in source file list, so definitely paths in elf are correct and code can be opened in editor with double click.
The image is linked using --debug option so symbolic debugging information should be available.
I'm pretty sure that I was able to debug similar code (with parts linked in RAM) built using GCC compiler. The debugging would work seamlessly.
Ozone version used is 3.10j. The core is Cortex M4F.
Could you give me some piece of advise, on what could be checked?
Regards
Jacek
The post was edited 2 times, last by Renegad ().