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.

MSPM0L1306: Interrupt handling inconsistent

Part Number: MSPM0L1306
Other Parts Discussed in Thread: SYSCONFIG

I am testing some UART Rx code based on the uart_echo_interrupts_standby example.

Frequently it works perfectly.  Then I will change some code in an unrelated section of the project, rebuild, reload the firmware and quit receiving characters.   I spend an hour or so trying things to fix it and at some point after a new build it begins working again.  A few changes / rebuilds later and I am back in the bad state.  I really do not believe the code changes I make break it or fix it.  I have been through this cycle 4-5 times now and cannot find a correlation for when it breaks or how it gets fixed.

I have a logic analyzer on the UART Rx pin, so I can see the characters on their way in.

I can set a breakpoint in the interrupt handler.  When this breakpoint gets hit, the system is in a good state and receives characters as expected.  When the system is in a bad state the breakpoint is never activated.

Can you offer any debugging advice for how I might isolate this problem?  All I know right now is the interrupt handler does not appear to get called in the broken builds.

 It seems to me something in the build process gets stuck in a bad state and delivers bad results for a while until it gets unstuck.  I try the "Build Project" "Clean Project" and "Rebuild Project" options without any consistent results.  Are there any other Theia options I should try to get a consistent build?

  • This is a No RTOS, TI Arm Clang Compiler project.

  • After writing this post, I went back to Theia without any code changes, cleaned the project, rebuilt it, ran it again, and it is working.  It really seems like I am missing something to make the build process more consistent.

  • Hi Barry,

    What are you using for compile optimization setting?

    If you are not getting into the ISR to handle the incoming bytes, then this would indicate either the CPU NVIC interrupt for the UART has been disabled, or the specific UART RXINT interrupt is disabled.  Do you disable/enable these anywhere in your code after the intial system configuration is performed?

    What sleep policy are you using?

  • I thought for most of this week that upgrading to Theia 1.20 fixed the issue.  Unfortunately the issue is back.

    I found an optimization setting in project properties -> Arm Compiler -> Optimization.  I tried settings 0, 1, and 2.  2 was the initial default I had been using None of the others appeared to help.

    After calling SYSCFG_DL_init();  I execute:

    NVIC_ClearPendingIRQ(UART_0_INST_INT_IRQN);
    NVIC_EnableIRQ(UART_0_INST_INT_IRQN);
     
    These were copied from the Resource LIbrary UART example I started with.  If I remove those statements, the TX UART channel freezes after sending the first string so apparently they are needed.
    I do not manually disable any interrupts anywhere.  My code base for this project is not very big, so I don't think anything is hiding in my code.
    I am uncertain of the current sleep policy.  I can't find a setting or any code references.  I do call:
    DL_SYSCTL_disableSleepOnExit();
    in a few places.
    I'm happy to tell you the sleep policy if you can point me toward it.
    I also keep getting this issue in the "Debug Output" panel when I launch the debugger using Theia 1.20:
    SEC_AP: DisAsmTPI: Failed to create TPI_DISASM. 
    I do not recall seeing this when using the older Theia.  I am unsure what it means.  Searching for those terms does not produce anything helpful.  The debugger and breakpoints now seem a little sketchy.  I wonder if this is the cause.
  • I found the Sleep mode settings in sysconfig.

    Run0

    Sleep0

    (defaults)

    I can try others if you think it would be helpful.

  • Hi Barry,

    By chance have you tried downloading and installing CCS on your PC?  I'm curious if you see same behavior.

  • That is a whole nother issue I am working on.  The user name on my PC has spaces in it and CCS Theia is apparently unable to deal with that.  So I have not given it a try yet.

    Meanwhile the builds started working again.  I really don't think I did anything to fix it, but I can't test the failure until it comes back.  We will see when that happens.

    During this latest failure period I did try polling the fifo and issuing the blocking call to retrieve incoming data.  Neither of them would fire even though I saw data on the pins.  This makes me suspect initialization of the peripheral over interrupt problems.

  • Hi Barry,

    These types of issues can be difficult.  Have you tried CCS (non Theia version)?

  • We have used the non-Theia version for years.

    I guess I thought the MSPM0 was not supported.

  • Hi Barry,

    Absolutely MSPM0 is supported in classic CCS.  It would seem silly to release a whole new line of products and not have support in CCS. ;)

    CCS -> https://www.ti.com/tool/CCSTUDIO

    MSPM0 SDK -> https://www.ti.com/tool/download/MSPM0-SDK/1.20.01.06

    Let me know if still having trouble in CCS.