56F8345 compilation / Flash memory bean problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

56F8345 compilation / Flash memory bean problem

1,307 Views
TurboMan
Contributor IV

Hi,

   so I'm trying to compile a debug build of our code, the production build works fine, but debug doesn't build. Following error happens:

>FRun_and_wait_in_RAM(.RAW_RAM) in file FlashProgMemory_c.obj is referenced

>but has not been written.

>Check your linker command file.

In the C file, the function Run_and_wait_in_RAM is there, in it's own section. This section isn't declared in the linker file. I've tried changing it to ram that IS declared in the linker, and it still doesn't work.

So there's a pragma with the section define mapped to .RAW_RAM, and a pragma section end after the function. The functions are static ASM.

There are no processor expert beans for the flash, and I can't find any. It's a CW10.6 project.

Anyone with any ideas?

0 Kudos
3 Replies

1,041 Views
TurboMan
Contributor IV

Hi,

   I believe this was fixed a while back. Didn't know this post was outstanding, thanks for help / regard this as fixed,

best regards

0 Kudos

1,041 Views
TurboMan
Contributor IV

Here's the function code btw:

/*

** ===================================================================

** Method : Run_and_wait_in_RAM (bean IntFLASH)

**

** Description :

** This method runs programming or erasing process end waits

** until it ends. This routine is placed in RAM.

** This method is internal. It is used by Processor Expert only.

** ===================================================================

*/

#pragma define_section RAW_RAM_section ".RAW_RAM" RWX

#pragma section RAW_RAM_section begin

static asm void Run_and_wait_in_RAM(dword address, word data, word command)

{

move.l A10,R2; /* Move given address to pointer register */

move.w Y0,p:(R2)+; /* Write data to the address in program memory */

move.w Y1,FMCMD_ASM;

move.w #$80,FMUSTAT_ASM;

wait:

moveu.w #$f020,R0;

adda #$3f3,R0,R0;

move.w X:(R0),A;

bftstl #$40,A1;

bcs wait;

rts;

}

#pragma section RAW_RAM_section end

0 Kudos

1,041 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, TurboMan,

I think it is okay for you to debug if you run code in internal program RAM, as you know that the api function is saved in program flash Run_and_wait_in_RAM(). and it is copied to program RAM by the api function:

void IFsh2_Init(void)
{
/* Copy FLASH process routine to program RAM. All program or erase processes will be launched and wait for their end in this routine */
  mempcpy(((dword)&_LWIR_ROM_addr_high<<16)+(dword)&_LWIR_ROM_addr_low, ((dword)&_LWIR_RAM_addr_high<<16)+(dword)&_LWIR_RAM_addr_low, (word)(dword)&_LWIR_size);
}

after the code is copied into internal program RAM, I think you can debug.

Hope it can help you

BR

Xiangjun Rong

0 Kudos