ARM Technical Support Knowledge Articles

BANK SWITCH MODE 1 CAUSES SPORADIC RUN-TIME ERRORS

Applies to: RTX51 Real-time Kernel

Answer


Information in this article applies to:


SYMPTOM

A application that is using code banking in banking mode 1 or banking mode 4 might cause sporadic problems with RTX51 Full when the system interrupt is triggered within the bank switching code.

CAUSE

The RTXCONF.A51 file contains a restore bank function that compares the current bank with the new bank. Since the bank switching code of banking mode 1 and mode 4 no longer disables the interrupt system, a potential run-time error might cause crashes of the application. This occurs when the RTX51 system interrupt is called exactly on the update of the B_CURRENTBANK value but before external hardware I/O lines are updated.

RESOLUTION

Change the code for ?RTX_SWITCHBANK in the file RTXCONF.A51 to:

            ?RTX_SWITCHBANK:
EXTRN CODE (?B_RESTORE_BANK)
JMP  ?B_RESTORE_BANK   ; new entry in L51_BANK that restores an old bank
;; -- the old code is no longer required
;;                         ; Check if bank switching required
;;                         CJNE A, ?B_CURRENTBANK, SWITCH
;;                         RET
;;                         ; Extract the Banknumber
;;SWITCH:                  ANL  A, #?B_MASK
;;                         MOV  B, #?B_FACTOR
;;                         DIV  AB
;;                         MOV  R7, A
;;                         JMP  _SWITCHBANK    ; Switchbank-Routine in L51_BANK

STATUS

The problem only exists in combination with L51_BANK.A51 configuration file version 2 and will be solved in future RTX51 revisions.

If you are using the L51_BANK.A51 Version 1.4 (which was part of the C51 Version 5) the run-time error does not occur, since this code disables the interrupt system during bank switching.

MORE INFORMATION

SEE ALSO

Article last edited on: 2004-09-14 07:36:18

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