Trouble programming Arm Cortex M0 (stuck in the reset_handler)

  • Context: C/C++ 
  • Thread starter Thread starter core7916
  • Start date Start date
  • Tags Tags
    Arm Programming
Click For Summary
SUMMARY

The discussion centers on troubleshooting a programming issue with the PGA970EVM module, which utilizes the ARM Cortex M0 core. The user experiences a halt in the reset handler, preventing access to breakpoints and the main function. Key suggestions include checking the RESET input pin for assertion and ensuring the watchdog timer is disabled during debugging. Additionally, consulting the ARM Cortex M0 User Manual for specific sections on the Program Counter and Reset Control Register is recommended for further insights.

PREREQUISITES
  • Understanding of ARM Cortex M0 architecture
  • Familiarity with debugging techniques for embedded systems
  • Knowledge of the PGA970EVM module and its programming environment
  • Experience with handling watchdog timers in microcontroller applications
NEXT STEPS
  • Review the ARM Cortex M0 User Manual, focusing on sections 2.2.1.3.4 and 2.4.2.4
  • Investigate the behavior of the RESET input pin and potential electrical noise issues
  • Experiment with stripping down the program to its basic functionality to identify issues
  • Search for community discussions or vendor documentation related to the PGA970EVM and debugging challenges
USEFUL FOR

Embedded systems developers, particularly those working with ARM Cortex M0 microcontrollers, and anyone troubleshooting programming issues with the PGA970EVM module.

core7916
Messages
71
Reaction score
3
TL;DR
programming arm m0
Hello,
i am programming pga970evm module and the core is of arm cortex m0. the program what i have is building succesfully , but while debugging it is stuck or halting in reset (reset_handler) and not coming out of it (startup code).
i will provide screen shot of debug page.

another thing is i cant access the breakpoints while debugging. while begugging i came to know that controller is not calling the main function since it is not coming out of reset state.
IMG-20230215-WA0005.jpg


as shown in image the reset is happening at resetisr() function(startup code). if i again resume the debug it will continuously stays in same state(reset). i cant share the full code. i have included all necessary files which is required to run.
1. please can you tell me what may cause the micro controller to halt in reset state.?
2. why i cant aces the breakpoints ?
3. in xPSR i am getting exception as 010000 . does this is the reason i am getting this?
Thank you.
 
Technology news on Phys.org
Does the code work when running normally? Perhaps debugging interferes with doing resets.

Have you searched the web for answers? A vendor forum specializing in this processor would be a better place to ask this question.
 
jedishrfu said:
Does the code work when running normally? Perhaps debugging interferes with doing resets.

Have you searched the web for answers? A vendor forum specializing in this processor would be a better place to ask this question.
hello i already searched in web for this problem and contacted vendors. Their ans were not usefull. I will atach one zip file in which it shows how controller behaves when i am debugging.Please suggest any solutions.
Thank you.
 
core7916 said:
I will atach one zip file
I'm not sure the PF software will let you upload a ZIP file. Even if it does, it would be bad practice for us to download and unzip it... PDF screenshots are safer.
 
Also I doubt we can help much here.

We are not experts with this particular device and to run your code, we'd have to install the tools, your code, your hardware and try to reproduce the error. This is why we ask developers to diagnose the problem themselves.
 
Last edited:
  • Like
Likes   Reactions: Vanadium 50 and berkeman
@core7916 -- What is your experience level so far programming this uP? Have you successfully run many projects in the past, and this is the first one giving you trouble? Or is this your first project on an Arm M0?

jedishrfu said:
Does the code work when running normally? Perhaps debugging interferes with doing resets.
Debuggers can often interfere with the main program -- I only run them if I have to in order to debug a problem. As jedi asks -- does your program run normally without the debugger overhead?

Alternatively, can you strip this program down to bare bones to see if that will run? If it runs, slowly build it back up to see what breaks it. If not, you must have something wrong with your build/run environment, IMO...
 
jedishrfu said:
Does the code work when running normally? Perhaps debugging interferes with doing resets.

Have you searched the web for answers? A vendor forum specializing in this processor would be

berkeman said:
@core7916 -- What is your experience level so far programming this uP? Have you successfully run many projects in the past, and this is the first one giving you trouble? Or is this your first project on an Arm M0?Debuggers can often interfere with the main program -- I only run them if I have to in order to debug a problem. As jedi asks -- does your program run normally without the debugger overhead?

Alternatively, can you strip this program down to bare bones to see if that will run? If it runs, slowly build it back up to see what breaks it. If not, you must have something wrong with your build/run environment, IMO...
this is the first project i am working with microcontroller . my coding level is not good. but i am not doubting the code since i got the code from vendors. i didnt made changes to code. i am just giving the breakpoints and trying to observe what is happening inside of controller, which i cant due to above problem(reset).
 
Do you have the watchdog enabled? The debugger often does not stop it so you have to disable before debugging or you get a reset soon after a breakpoint.

BoB
 
  • Like
Likes   Reactions: berkeman
rbelli1 said:
Do you have the watchdog enabled? The debugger often does not stop it so you have to disable before debugging or you get a reset soon after a breakpoint.

BoB
sir, i have already disabled the watchdog timer and tried to debug, still results are same.
 
  • #10
You mentioned using stock vendor code for this work. Try searching using a portion of the stock vendor code + using the debugger with this code maybe someone will have run into the same issue. So far, PF posters aren't coming up with anything helpful to your problem.
 
  • #11
jedishrfu said:
You mentioned using stock vendor code for this work. Try searching using a portion of the stock vendor code + using the debugger with this code maybe someone will have run into the same issue. So far, PF posters aren't coming up with anything helpful to your problem.
thank you for you reply , i already contacted venders about these issue but not useful with their answers.
 
  • #12
I have not used that processor but here are a few ideas:

First, check that the RESET input pin is not asserted! AND that there is not any electrical noise on it.

In the User Manual at:
https:\\www.renesas.com\document\man\idt-arm-cortex-m0-user-guide
See on:
pg 12, sec. 2.2.1.3.4 Program Counter (PC)
pg 94, sec. 2.4.2.4 Application Interrupt and Reset Control Register (AIRCR) and table references contained there-in.

(above user guide was the 4th listed by Google search: arm cortex m0 manual,
the PDF manual was then searched for: reset)

Hope this helps!

Cheers,
Tom
 
  • Like
Likes   Reactions: jedishrfu

Similar threads

  • · Replies 30 ·
2
Replies
30
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 19 ·
Replies
19
Views
2K
  • Sticky
  • · Replies 13 ·
Replies
13
Views
8K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
13
Views
3K
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
10
Views
5K
  • · Replies 8 ·
Replies
8
Views
2K