Author Topic: $0.11 PY32F002A: Cortex-M0+ MCU, actually a PY32F030! 32/4KB, 48MHz, PLL, DMA...  (Read 67175 times)

0 Members and 2 Guests are viewing this topic.

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11694
  • Country: us
    • Personal site
When the device is in a hanged state, attach the debugger without reprogramming or resetting  and see where it is stuck. The way to do this depends on the software you are using.
Alex
 

Offline Pixie dust

  • Contributor
  • Posts: 10
  • Country: nl
I was thinking about that as well. But I use uvision and it does not look that it allows you to do that without either resetting it or going through a program cycle.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11694
  • Country: us
    • Personal site
Of course it can do this. Any IDE that is worth using should be able to do this, and ARM's own can do that for sure. https://developer.arm.com/documentation/ka003020/latest/
Alex
 
The following users thanked this post: Pixie dust

Offline Pixie dust

  • Contributor
  • Posts: 10
  • Country: nl
Thank you for this advice. Was not aware of this. Super
 

Offline Pixie dust

  • Contributor
  • Posts: 10
  • Country: nl
Whatever I tried the moment I disconnect the debugger the same code on the same hardware seems to work differently. It has to do with the stop mode and the LSI clock which seems to cause some synchronization problem. Then I found out that you can enable the debugger in software without it being connected. This solved my problem as I got the same behavior with or without debugger connected. Here the 2 lines of code which made it work:
   // simulate as if debugger is ON by applying clock and enable stop mode   
   RCC->APBENR1 |=0x08000000;          // apply clock to debugger
        LL_DBGMCU_EnableDBGStopMode();

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf