0

During my debugging of code, facing one issue regarding Reset. In debug mode, whenever I am putting breakpoint, after getting hit and clicking on Run (Command), getting Software Reset. This is not occurring, when I am not putting any breakpoint in the code, software runs normally. Also after breakpoint got hit, if I execute software via Step command, then also I am not getting Reset. As the code Size is very Huge, exactly not getting, where is the problem. I want to know which line of code getting executed, before reset function is called ? Is any one knows the answer, they can help me. Using below environments:

Microcontroller: NXP

Debugger: J-Link

Debugging Software: Ozone Debugger

Frant
  • 5,382
  • 1
  • 16
  • 22
  • 2
    What's the core of your MCU (Cortex-Mx, etc.)? Did you implement the `HardFault` exception? AFAIK, It's impossible to get reset the MCU without a watchdog (or other reset commands from core registers). Except for corrupting stack memory, it's possible that you used more than the defined stack size or, mistakenly, your program wrote to the stack region that your program lost the return address of a function. – HamidReza Dec 25 '21 at 16:49
  • Core of the MCU - Cortex M4. It is not a watchdog reset, I have confirmed by disabling watchdog. – Hitesh Kumar Tiwari Dec 27 '21 at 05:30
  • I suggest you use Log Breakpoint (In the IAR or similar utile in the Ozone debugging software) during your debug to trace your code by printing text and logging your code status. – HamidReza Dec 29 '21 at 16:55
  • define reset? the logic reads (not executes) the vector table, then the first fetch, first instruction executed is the first instruction in the reset handler, there is no code before that. Now if you have not properly built the vector table then you may get a hardfault, and if your vector table is built wrong then likely that handler address is wrong too and that will not execute either. First thing you always do after building the first binary is check the vector tables (before programming them onto the chip as some are harder to unbrick than others). – old_timer Dec 30 '21 at 01:24
  • this is also tool specific as well as whatever features the cores has (can read arms documentation). So far this is way too broad to answer, you need to do some more work. – old_timer Dec 30 '21 at 01:25
  • for starters define what you mean by reset. – old_timer Dec 30 '21 at 01:26
  • please provide a minimal repeatable example (no need for more than a handful of lines of code to demonstrate this I would expect)(including disassembly of the linked binary). – old_timer Dec 30 '21 at 01:27

0 Answers0