To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.nxt.nxthackingOpen lugnet.robotics.nxt.nxthacking in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / NXT / NXT Firmware Hacking / 66
65  |  67
Subject: 
Re: Custom firmware crashing on boot
Newsgroups: 
lugnet.robotics.nxt.nxthacking
Date: 
Thu, 28 Jun 2007 21:45:29 GMT
Viewed: 
15507 times
  
In lugnet.robotics.nxt.nxthacking, <dickswan@sbcglobal.net> wrote:

Here's two things to try since you've only swapped out the VM hich I
assume is a replacement for the "c_cmd.c" file.
The modifications are slightly more complex than simply replacing
c_cmd.c, but that's basically the only NXTGCC file that I've modified.
The new VM is copied mostly verbatim from another program, and is
contained in a new file, pcodesim.c.  c_cmd.c has been hacked (in a
quite amateurish way) to map the NXTGCC c_cmd functions to pcodesim.c
functions (e.g. cCmdInitPool, cCmdActivateProgram, and cCmdCtrl call
the appropriate functions in pcodesim.c).  The only other modifications
are that the makefile has pcodesim.c added to the project, and that
m_sched.c has the following line added: #include "c_cmd.iom" .  (Can't
remember why I added that, but I think it was required to compile for
some reason.)

2. Next patch out all calls to your replacement VM. The easiest way to
do this is simply with a "return" inserted at the beginning of the
"cInit", 'cCtrl" and "cExit" functions in the "cCmd" extern structure.
This will completely disable your code and remove it from being
called. If you do this, and the compiler has a decent code optimizer,
your object file will be at least 10K (more like 20K) and you won't
have to figure out (1) to at least try this.
Ok, I just tried this, and it now crashes with garbage on the screen
(randomly placed pixels) instead of a blank screen (still as soon as I
boot the firmware with SAM-BA).  cInit, cCtrl, and cExit all now have
return; at the beginning.  Just to see what happened, I disabled binsert
in the makefile, and it then went back to crashing with a blank screen.
I have no clue what would be wrong here.

If you get really stumped after trying above, and you've really only
changed "c_cmd'c", then send me your version of that fileand I'll
compile and load it with my IAR JTAG tools and I can tell you where
it's failing.
Based on what I've said in this post, if you still want to take a look at
my c_cmd.c (and other modified files), let me know and I'll check with my
employer whether I'm allowed to share it.  I think they'll be fine with
it, but I can't make guarantees.  :-)

Thanks,
Jeremy Rand



Message is in Reply To:
  RE: Custom firmware crashing on boot
 
Here's two things to try since you've only swapped out the VM hich I assume is a replacement for the "c_cmd.c" file. 1. First there is a "#define" that specifies the start address of the file system. If you're 10K larger you're going to need to (...) (17 years ago, 27-Jun-07, to lugnet.robotics.nxt.nxthacking)

5 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR