Memory test operation without pointers in NXC on NXT?

622 Views Asked by At

I'm trying to write a memory test program for the NXT, since I have several with burned memory cells and would like to identify which NXTs are unusable. This program is intended to test each byte in memory for integrity by:

  1. Allocating 64 bits to an Linear Feedback Shift Register randomizer
  2. Adding another byte to a memory pointer
  3. Writing random data to the selected memory cell
  4. Verifying the data is read back correctly

However, I then discovered through these attempts that the NXT doesn't actually support pointer operations. Thus, I can't simply iterate the pointer byte and read its location to test.

How do I go about iterating over indexes in memory without pointers?

1

There are 1 best solutions below

0
On

I think the problem is that you don't really get direct memory access in either NBC/NXC or RobotC.

From what I know, both run on an NXT firmware emulator; so the bad memory address[es] might change from your program's point of view (assuming the emulator does virtual memory).

To actual run bare metal, I would suggest using the NXTBINARY function of John Hansen's modified firmware as described here:
http://www.tau.ac.il/~stoledo/lego/nxt-native/

The enhanced fimware can be found at:
http://bricxcc.sourceforge.net/test_releases/