This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Execute Code in RAM

Hi!

I want to make a program which receives code from the PC and stores the code in the flash-memory. So, i have to copy the UpdaterCode from the flash in the RAM and then start updating the flash. But the linker crashes. There is no error message only a warning: UNRESOLVED EXTERNAL(s). There is a message box from Windows: An Error occured, do you want to send a problem report?

Here is a piece of TinyUpdater.h:

#pragma HLARGE
#pragma RENAMECLASS (FCODE=FLASH_CODE)

#define SROM_PS(n)                                                  \ 
extern unsigned char huge _PR_##n##_s_;  /* section source start */ \ 
extern unsigned char huge _PR_##n##_l_;  /* section len          */ \ 
extern unsigned char huge _PR_##n##_t_;  /* target address       */

#define SROM_PS_TRG(n) ((void *)       &_PR_##n##_t_)
#define SROM_PS_SRC(n) ((void *)       &_PR_##n##_s_)
#define SROM_PS_LEN(n) ((unsigned int) &_PR_##n##_l_)

My main module:

SROM_PS(PFLASH)

...

PSW_IEN = 0;    // Global Interrupt disable
_nop_();
_nop_();
hmemcpy (SROM_PS_TRG(PFLASH), SROM_PS_SRC(PFLASH), SROM_PS_LEN(PFLASH)); // Kopiert TinyUpdater in PSRAM
TinyUpdater();  // Tiny Updater, Rücksprung in diese

Commands for linker, in the L166 Locate menu, User Sections:

?PR?PFLASH%FCODE (0xE00000)[]

Versions:

IDE-Version:
µVision3 V3.05e
Copyright (c) Keil Elektronik GmbH / Keil Software, Inc. 1995 - 2004

Tool Version Numbers:
Toolchain Path:    C:\Keil\C166\BIN\ 
EC++ Compiler:      EC166.Exe       V1.06
C Compiler:         C166.Exe       V5.05
Assembler:          A166.Exe       V5.04
Linker/Locator:     L166.Exe       V5.07
Librarian:          LIB166.Exe       V4.25
Hex Converter:      OH166.Exe       V4.7
CPU DLL:            S166.DLL       V2.44a
Dialog DLL:         D167.DLL       V2.43a
Target DLL:         BIN\UL2OCDS.DLL       V1.00
Dialog DLL:         T167.DLL       V2.43

Thanks
Stefan Zimmermann

0