Shop OBEX P1 Docs P2 Docs Learn Events
What is the proper usage of REBOOT in P2? — Parallax Forums

What is the proper usage of REBOOT in P2?

Hi folks. It looks like REBOOT doesn't work in P2 with Pnut42.

Here's my code:
PUB HPS_SendMem(p_hexval) | qlong, qbyte, qbit, ix, ch, rdr, dataIx
CASE p_hexval
...
82: '0x52, "R"
org
REBOOT
end
Fourrdrs.Str(K4RdrHost, string("Reboot FAILED."))

REBOOT failed as a SPIN command:

error:Expected an instruction or variable

So I framed it as inline assembly. When I run the command I get the "FAIL" message and my firmware version is still the one running in RAM, not the one in Flash (which would be 27Dec):

Q52!
Reboot FAILED.
V00!
ThreeReaderEncodeP2_28Dec2024 (c) 2024 GlueLogix Inc. All Rights reserved.

I looked in the docs. REBOOT is either not mentioned, or described loosely like it just works.

What am I missing?

Comments

  • REBOOT should be a Spin statement. Though if it errs, that probably means it was forgotten at some point...
    The correct way to reboot in PASM is hubset ##$10000000, so that should work in inline asm.

  • You can do it in straight Spin2 as well.

    pri reboot()
    
      hubset($1000_0000)
    
  • Thank you, that worked.

Sign In or Register to comment.