Subject:
|
RE: How do I delete firmware from firmware?
|
Newsgroups:
|
lugnet.robotics.rcx.pbforth
|
Date:
|
Tue, 23 May 2000 15:24:58 GMT
|
Viewed:
|
1804 times
|
| |
| |
> Looking at forth code it looks like "HEX 3ae EXECUTE"
> might end up doing what we are talking about. I tried this
> with out getting what I expected. I will fiddle more but does
> the approach seems right?
>
> M_CODE(7,``"EXECUTE"'',EXECUTE,_FLINK)
> MOV.W rTOS,rA
> MOV.W @rDSP+,rTOS
> JMP @rA ;jump to code address
Here's a copy of what Kekoa replied with...
This sounds correct. In C, this is how I do it:
/* Delete the firmware */
*(char *)0xffcc = 1;
(*(void (**)(void))0)();
Indeed, *(void (**)(void))0) is the reset vector, whose value is 0x03ae.
0xffcc is timer 0. I forget what effect setting it to 1 has, but I seem to
remember that setting it to 1 gave nicer results than not doing that. The
Lego firmware that came with the original RIS did this (but I don't know
about later firmware versions).
End of Kekoa's comments....
So I think if you do a
HEX 1 FFCC ! 3AE EXECUTE
Things should work better.
> BTW: I like the direct threaded approach of pbforth.
> It is clean and easy to understand. The last forth
> I knew something about used token threading which
> required an extra level of indirection.
This is a really fast Forth - the H8 architecture makes it easy
to implement without a lot of dinking around with the stack or
keeping machine state in memory - everything is in the registers.
Cheers,
Ralph Hempel - P.Eng
--------------------------------------------------------
Check out pbFORTH for LEGO Mindstorms at:
<http://www.hempeldesigngroup.com/lego/pbFORTH>
--------------------------------------------------------
Reply to: rhempel at bmts dot com
--------------------------------------------------------
|
|
Message is in Reply To:
| | Re: How do I delete firmware from firmware?
|
| (...) Looking at forth code it looks like "HEX 3ae EXECUTE" might end up doing what we are talking about. I tried this with out getting what I expected. I will fiddle more but does the approach seems right? M_CODE(7,``"EXECUTE"...TE,_FLINK) MOV.W (...) (25 years ago, 23-May-00, to lugnet.robotics.rcx.pbforth)
|
5 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|