Jump to content
 
  • 0
devin

PIC32MZ Random Software Reset

Question

I'm seeing some random resets with the PIC32MZ1024EFE100 running the Web Net Server project from Harmony 2.06. The RCON register is 0x00000040 which is the SWR (Software Reset Flag) bit.

I'm thinking there is a bug in my code but the SYS_RESET_SoftwareReset() function is not being called.

What else would cause the SWR bit to be set?

Has anyone experienced a simmilar problem?

-Devin

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I have not used harmony or web net server so I have not run into this directly.  But there may be a few other places to check that cause resets on other systems.

  1. Often the assert() functions will end in a software reset, so your code may not call the reset directly, but if you use assert in your error checks you will reset
  2. Some malloc libraries will fail with a reset if there is a heap failure.i.e. the stack runs into the heap.  This is often detected with a no-mans land between the stack and the heap.  The no-mans land is filled with a magic number.  If the magic number changed, the stack ran into the no-mans land and may have corrupted the heap.

 

  • Helpful 1

Share this post


Link to post
Share on other sites
  • 0

Provided nothing went wrong in your analysis that bit being set means that somewhere something did a software reset, you just have to figure out where this happened. N9WXU gave some possible causes of the RESET instruction being used, but it could really be anywhere. I have even seen this happen with a bad function pointer jumping to a location which contained const data.

As a last resort you can search through the program memory for the RESET instruction (you can do this in MPLAB using the memory views) and set a breakpoint at every location containing the reset instruction. That way you should be able to catch it in the debugger and figure out where the reset is coming from.

  • Helpful 1

Share this post


Link to post
Share on other sites
  • 0

I am glad to provide some ideas.  Let us know what you find.  Learning from others is generally cheaper and less painful than learning from my own mistakes.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


 


×
×
  • Create New...