3

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?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
  • 3
    If you can't use pointers, then you basically haven't got C ... ;) – Oliver Charlesworth Jan 19 '13 at 00:41
  • @OliCharlesworth Well, admittedly, the language this is programmed in is called `Not eXactly C (NXC)`. Unfortunately, at an assembly level, pointers aren't supported, so this is what I've got to deal with. –  Jan 19 '13 at 00:42
  • 1
    The NXT supports pointers, but NXC does not (at this time). You should check out [Robot C](http://robotc.net) - it's well worth the price. – shea Jan 20 '13 at 03:54
  • @bungeshea I'm already using RobotC for another project. I need to run a memory test - you don't have assembly level access or pointer access in RobotC. –  Jan 20 '13 at 05:07
  • 1
    Pointers in RobotC: http://www.robotc.net/wiki/Pointers and http://botbench.com/blog/2013/01/14/tutorial-pointers-in-robotc/ – shea Jan 20 '13 at 05:09
  • @bungshea Wow, that's new. Compiling on my version gives `Error: Pointers not supported!` Guess I'll have to update. –  Jan 20 '13 at 05:16

1 Answers1

0

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/

Hawken
  • 2,059
  • 19
  • 34