Keil Logo

C51: Converting IAR Banked Code to Keil


Information in this article applies to:

  • C51 All Versions

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 µVision to specify which modules/functions reside in which banks.

SEE ALSO


Last Reviewed: Thursday, February 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.