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.

TM4C123GH6PM: Using interrupts with CMSIS

Part Number: TM4C123GH6PM

Hello,

When using CMSIS you have to use their startup file, startup_ARMCM4.s, which has rather few defined vectors, so you add yours. I have tried doing that by following their tutorial (for uVision). The tutorials says to just extend vector table with desired handlers, which I have done, but then the time comes for my ADC0SS0_Handler handler to execute the program stops. 

My disassembly tells me it stops at  "B       ." line of Default_Handler. I am sure that Handler doesn't exectue because its first line is incrementation which doesn't happen.

Is there something else that needs to be added for handlers to work?

EDIT: I'm using TivaWare library for ADC and uDMA, and CMSIS for its DSP functions.

SOLUTION: I used my standard startup file, with included interrupts, I only had to modify the stack and heap sizes (as given in the startup_armcm4.s) for it to work.

startup_ARMCM4.s

6646.startup_ARMCM4_updated.s

  • Hello Savo,

    I have no real experience with CMSIS interrupt handlers or the startup_ARMCM4.s file, but at first glance I don't see a ADC0SS0_Handler in the file you posted.

    Does the startup_ARMCM4.s file replace the startup_ccs.c file for such a project?
  • Savo Pejovic said:
    EDIT: I'm using TivaWare library for ADC and uDMA, and CMSIS for its DSP functions.

    Are you sure you need the CMSIS interrupt handlers in that case? That doesn't sound right and I don't see why that would be required. Maybe  knows?

     

    Robert

  • Hello,
    I've added the updated file (at least how it's described in the tutorial). But, come to think of it, how should I know what's the correct name of the handler? Maybe it's not "ADC0SS0_IRQHandler".

    I suppose it does? CMSIS examples which run perfectly well have that startup file, and it is what I've seen in CMSIS tutorials. But on my code, when I use my normal startup, I get a HardFault.

  • Savo Pejovic said:
    But, come to think of it, how should I know what's the correct name of the handler?

    It's the name you give it. There is nothing magic about the name, you can use whatever you want. It's the position in the table that determines what it is used for.

    Robert

  • Hey,
    I have two projects, one is implementing ADC with uDMA, and the other is the main one with DSP functions. Separately they work, when I use them together on a normal startup file it just HardFaults when it starts executing CMSIS functions (not before). Can these functions demand different interrupts?
  • I did not know that. I will look into it. Thanks
  • Savo Pejovic said:
    Hey,
    I have two projects, one is implementing ADC with uDMA, and the other is the main one with DSP functions. Separately they work, when I use them together on a normal startup file it just HardFaults when it starts executing CMSIS functions (not before). Can these functions demand different interrupts?

    It's unlikely that the DSP code requires any interrupts.
    Your first task should be to run the DSP code with the normal TIVAWare startup. If that gives you a fault then you can track down the source.
    Robert
  • I had to change the heap and stack sizes. Not the most newbie-friendly bug.
  • Savo Pejovic said:
    Not the most newbie-friendly bug.

    Hardly a, "bug" ...  and "CMSIS along w/µDMA" might extend - just maybe - beyond, "newbie."