Uploading tools: it should work

I’ve put my hands inside the “old” lejos nxj code: the source tree provides even two version of the uploading software runc (the same runc.exe that I mentioned in my previous post) and fwflash. As runc is “based on fwflash”, it’s supposed to be enhanced…

Actually by looking at the source code of runc I’ve noticed that the structure is much more simple than his precursor.

  • fwflash:
  1. Checking of the firmware file size (at most 256 Kib);
  2. Usb initialization (via usblib primitives) and structures allocation;
  3. Flash memory initialization:
    1. Unlocks the flash protection bits (according to the linked forum post this means erasing the whole memory, and it should be accounted as one of those frightful write/erase cycles);
    2. Uploads the firmware writing routine at address 0×202000.
  4. Writing of the whole firmware block by block (the flash memory is composed by 256 pages of 1024 bytes): for each block the program:
    1. Sets the block number into the block selection address;
    2. Sends the block;
    3. Runs the flash routine (previously stored at 0×202000).
  5. Firmware boot (jump to address 0×100000).
  • runc:
  1. Usb initialization;
  2. File loading;
  3. Reset mode checking (note that there’s no reset phase! Infact runc works only if the NXT has been previously reset by activating the apposite reset button);
  4. Sending of the firmware binary file, at address 0×2020000;
  5. Firmware boot (jump to address 0×2020000).

Both software seems to work properly, just following the instruction provided on the lejos osek webpage, although the firmware still doesn’t run on my NXT. I suspect that the absence of warnings at compile time gave me a false sense of security… :)

    Leave a Reply