This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MCU-PLUS-SDK-AM243X: DMTimer configured by Sysconfig causing hard fault

Part Number: MCU-PLUS-SDK-AM243X
Other Parts Discussed in Thread: SYSCONFIG

Hi,

I'm using DMTIMER0, but when it starts I (usually) get a hard fault. When I don't have startTimer checked in sysconofig and call TimerP_start(gTimerBaseAddr[CONFIG_TIMER0]); it will usually either explicitly hard fault at that point of execution, or it will run the timer but the task that started the timer will be blocked indefinitely.

When I check startTimer in Sysconfig and remove the TimerP_start calls, the core will 50/50 either:

  • hard fault after I continue execution at the main() breakpoint and it won't show a CIO console
  • it will run without a problem with the global counter in the callback function incrementing as expected.

I've tried to change the interrupt priority, but it makes no difference to the reliability of starting successfully.

This seems to be replicated across any core I try to configure with any DM timer, also. Any help is greatly appreciated.

R50_1 is missing due to the hard fault at boot:

Here's the Sysconfig. There's not much to get wrong.

  • Hi ,

    Thanks for your query.

    Which SDK example did you use for above testing ?

    Regards

    Ashwani

  • Hi Ashwani. No example. This is a part of a larger project. 

  • Hi ,

    Looks like you are working on R5F_0_1. correct ?

    I am assuming you are following Description of Timer module

    Can you please help me to reproduce on my setup with latest MCUSDK example ?

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/09_01_00_41/exports/docs/api_guide_am243x/EXAMPLES.html

    What I have quickly done is added a timer module in empty project for R5F_0_1 and build it successfully.

    Regards

    Ashwani

  • Thanks Ashwani. Sorry, I wasn't clear earlier. The DM timer was working fine in our project until recently, so I'm looking for advice on what may be conflicting with the timer configuration such that it's breaking the execution sometimes now.

    I can get DM timers to work fine in an empty project, both using the Sysconfig configuration without arguments, and using the SW configuration with arguments as detailed in the description. In fact, before I integrated the DM timer into our main project, I created a demo project to confirm the functionality first. This works fine.

    Using DM timer also worked fine for some time as a part of our main project, but recently has stopped working. Given there's not much to configure with enabling a DM timer, I assume something else in our large project is causing a conflict, but I haven't been able to identify what that is.

    Looks like you are working on R5F_0_1. correct ?

    Yes, but the same issue will occur on any other core I also enable a DM timer on.

    I am assuming you are following Description of Timer module

    Yes, I have. I'm not passing arguments currently - I've stripped back the code to a simple DM timer to a callback to increment a counter, but I have had code that passes arguments and used that structure successfully.

    Can you please help me to reproduce on my setup with latest MCUSDK example ?

    I'd love to, but it's the wrong way to go about it. The timer configuration was working for some time as a part of our larger project and it works fine in our empty example project. At some point in developing our main project the glitch stated happening, and I've traced it to the DM timer initialisation - when I remove the TimerP_start() call, execution works fine.

    However, I'm unsure what could cause this given there is essentially nothing to configure in setting up a DM timer, so it must be something else conflicting with the DM timer initialisation. Maybe an interrupt router conflict?

  • I can get DM timers to work fine in an empty project, both using the Sysconfig configuration without arguments, and using the SW configuration with arguments as detailed in the description

    Happy to know that DMTimer is working fine.

    Can we clos this thread and raise another thread for other issue?

    Regards

    Ashwani

  • Ashwani, I appreciate your help, but you're not reading what I'm writing.

    The DM timer is NOT working fine. There is no 'other' issue. There is only one issue and I'd like some actual advice.

  • Hello Tron,

    The DM timer is NOT working fine. There is no 'other' issue

    I am requesting you to send your (application/specific part of the larger code) to me so that I can reproduce this on my setup on AM243-LP.

    Regards,

    Vaibhav

  • I can't send you any specific part, because I don't know what part could cause it. I can't send you the whole application because it's commercial IP.

    That's why I'm asking for advice on what could possibly cause it, or any indication on where I could look.

    All I know is that in my large project using DM Timer at all - which used to work fine and works fine in a project on its own - causes a hard fault most times I build the project, unless I remove any call to TimerP_start on that core - whether set by Sysconfig or in my code.

  • Hi Tron,

    Thanks for your valuable response.

    I will then run a DM Timer code for several times and test this out to see if I am able to reproduce this issue.

    Do you want me to do a warm reset or a cold reset every time I run the DM Timer application ?

    Looking forward to your response.

    Regards,

    Vaibhav

  • Hi Tron,

    Apologies in delayed responses.

    I am running this setup today and I will keep you updated with failure reproduction.

    Regards,

    Vaibhav

  • Hi Tron,

    I applied your SysConfig settings and ran a sample timer application as per your code from github.

    It works fine for almost 800+ cycles as of now and it is not causing any problems as such.

    I understand that your standalone timer example does not causes problems, its the whole application as such which causes problems and halts.

    On this note, I want to understand your application. I am not asking for the code as such, but it would be great to have the following:

    1. Entire SysConfig file for your project.
    2. Are you:
      • Using timer to profile the time taken for the execution of a specific function?
      • Or using it as a means to generate an interrupt after every X ms for a certain functionality?
    3. The flow of your application would be highly appreciated
      • Some functionality A
      • Timer profiling/Timer interrupt generation for X ms(Based of Question 2 you can consider one of these)
      • Some functionality B
      • I would need your explanation on what is happening in both A and B.

    Regards,

    Vaibhav