Stephen Noonan

56F8367 Internal PRAM: Linking and Programming Issues

Discussion created by Stephen Noonan on Jan 20, 2017
Latest reply on Feb 7, 2017 by xiangjun.rong

Hello,

 

Target: DSC 56F8367, LDM

IDE: CodeWarrior for MCU 10.6.4

 

I am looking to create a project wich has code in both P ROM and internal P RAM. The program entry point as well as most of the code would be in PROM, with some additional code placed and linked to PRAM. I am having some issues achieving this and I am not sure if it possible.

 

Relevant linker sections look like this:

 

.p_Interrupts (RWX) : ORIGIN = 0x00000000, LENGTH = 0x000000AC
.p_Code (RWX) : ORIGIN = 0x000000AC, LENGTH = 0x0003FF54
.p_CodeInternalRAM (RWX) : ORIGIN = 0x0004F800, LENGTH = 0x0800

.ApplicationCodeInternalRAM
{
F_PcodeInternalRAM_start_addr = .;
OBJECT (FPRAMFunc1, PRAMFuncs_c.obj)
OBJECT (FPRAMFunc2, PRAMFuncs_c.obj)
F_PcodeInternalRAM_end_addr = .;
} > .p_CodeInternalRAM

.ApplicationCode :
{

F_Pcode_start_addr = .;

# .text sections
OBJECT (F_EntryPoint, Cpu_c.obj)
* (.text)
* (rtlib.text)
* (startup.text)
* (fp_engine.text)
* (user.text)
* (.data.pmem)

F_Pcode_end_addr = .;

# save address where the data starts in pROM
. = ALIGN(2);
__pROM_data_start = .;

} > .p_Code

 

My code compiles and links without error - I have PROM code calling the PRAM functions. The memory map shows everything as I want it to be, and the .elf.s file has lines targeted for 0x0004F800 (PRAM). But, when I debug and step through it I can see the PROM JSRs to the PRAM functions are jumping to 0x0000. It is as if the linker has a placeholder for the PRAM jsrs but never actually linked to it.

 

Is it possible to have PROM and PRAM code linked to each other in a single ELF?

 

Second issue is that the debugger is not downloading the PRAM section. That section is all zeros. Is there an option somewhere I need to select to program the PRAM?

Outcomes