ARM Technical Support Knowledge Articles

CONVERTING IAR BANKED CODE TO KEIL

Applies to: C51 C Compiler

Answer


Information in this article applies to:


SYMPTOM

We have a legacy application written for the IAR 8051 Compiler and are converting it to work with the Keil tools. We started by compiling with the Keil compiler but we get the following warning:

Warning 245: unknown #pragma, line ignored

for the following pragmas:

#pragma function=non_banked

void func1(char *);
void func2(char *);
void func3(char *);

#pragma function=default

CAUSE

These pragmas are used by the IAR compiler to specify that the functions listed are or are not code banking functions. The Keil tools use a completely different method of specifying functions that are code banked. Therefore, the function pragma is not supported by the Keil tools.

RESOLUTION

In Keil, a non_banked function is a function located in the common area. Functions that are banked are located in a code bank (bank 0, bank 1, bank2, ...). You may specify the code bank (or common area) for your programs on a module-by-module basis or on a function-by-function basis or both.

To resolve the issue you have, remove the #pragma function statements from your program. Then, use either the linker command-line options or the project options in uVision to specify which modules/functions reside in which banks.

SEE ALSO

Article last edited on: 2004-04-24 14:49:24

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential