Keil Logo


Information in this article applies to:

  • RTX51 Version 7
  • RTX51 Tiny Version 2


I am using the RTX51 Full RTOS and I need to implement a RAM memory check that writes and verifies every memory cell by writing a pattern (for example 0xAA and 0x55) on every RAM cell. The problem is that I have other tasks (fast and standard) and interrupts during this memory verification. Can you suggest a way to implement this memory check?


You may temporarily disable all interrupts even in a RTX51 application. This is allowed unless you disable the interrupt system for more than 10.000 cycles. If the interrupt disable time is longer than this (or if it exceeds the system timer tick value), you will lose interrupts in your system, which may yield to unpredictable behavior.

Therefore, the following function allows you to perform the memory test required in your system. You may call this function from a low priority task.

#include <absacc.h>

unsigned char TestLoc (unsigned int adr)  {
  unsigned char XRAMerr = 0;

  EA = 0;  // disable interrupts -> lock task (critical section)
  SaveVal = XBYTE[adr];
  XBYTE[adr] = 0x55;
  if (XBYTE[adr] != 0x55)  XRAMerr = 1;
  XBYTE[adr] = 0xAA;
  if (XBYTE[adr] != 0xAA)  XRAMerr = 1;
  EA = 1;  // enable interrupts -> unlock task (critical section)
  return (XRAMerr);


Last Reviewed: Thursday, January 18, 2007

Did this article provide the answer you needed?
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.