Not applicable
May 11, 2016
02:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 11, 2016
02:12 AM
Is there any simple solution, (XMC, DaveApp,...) to generate call of IRQ-Function from Source Code?
(I guess, I can use HW-Pheripheral... and set IRQ-Request Bits... but may, there is a more simple solution without pheripherals?)
Backround... I need an additional IRQ/Level-Priority-task, between my SYSTIMER(IRQ)-task and Backround task.
Best Thanks for help.
(I guess, I can use HW-Pheripheral... and set IRQ-Request Bits... but may, there is a more simple solution without pheripherals?)
Backround... I need an additional IRQ/Level-Priority-task, between my SYSTIMER(IRQ)-task and Backround task.
Best Thanks for help.
12 Replies
May 11, 2016
07:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 11, 2016
07:28 PM
Hello,
You can use directly the CMSIS set IRQn pending function to trigger the interrupt.
For example to trigger SCU.SR0:
Hope this helps.
Regards,
Min Wei
You can use directly the CMSIS set IRQn pending function to trigger the interrupt.
For example to trigger SCU.SR0:
/* CMSIS function void NVIC_SetPendingIRQ (IRQn_t IRQn) */
NVIC_SetPendingIRQ(SCU_0_IRQn);
Hope this helps.
Regards,
Min Wei
Not applicable
May 12, 2016
07:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 12, 2016
07:09 AM
Thanks...
But,where and how I have to declare the IRQ(callback) function? And set IRQ priorities... ? Over DAVE App?
Thanks for help...
But,where and how I have to declare the IRQ(callback) function? And set IRQ priorities... ? Over DAVE App?
Thanks for help...
May 12, 2016
11:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 12, 2016
11:33 PM
I think the easiest is to simply add the NVIC node initialization codes and handler function directly to your existing program, without going through DAVE.
For example:
And as mentioned previously, the CMSIS set IRQn function can be used to trigger the interrupt.
Or if this is not needed, the handler function can be also called directly in the program.
Regards,
Min Wei
For example:
/* Handler function */
void SCU_0_IRQHandler(void)
{
/* Code */
}
int main(void)
{
DAVE_STATUS_t status;
...
/* Initialize NVIC */
NVIC_SetPriority(SCU_0_IRQn, 3U);
NVIC_EnableIRQ(SCU_0_IRQn);
...
while(1U)
{
}
return 1;
}
And as mentioned previously, the CMSIS set IRQn function can be used to trigger the interrupt.
Or if this is not needed, the handler function can be also called directly in the program.
Regards,
Min Wei
Not applicable
May 13, 2016
02:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 13, 2016
02:00 AM
Hi,
In your solution... How I can Register the callback IRQ-function ???
----
In the meantime...
I try to use DAVE App INTERRUPT (4.0.8)
Define, "Enable", Prio. and Interrupt handler in DAVE-APP...
Use Method "SetEnable + SetPending" by SW...
With Debugger, I can set a BP inside IRQ-Handle... it's called... OK...
But after leaving IRQ-Handler, CPU/Debugger jumps to anyway??? And Stops ? Not back...
What I am doing wrong?
In your solution... How I can Register the callback IRQ-function ???
----
In the meantime...
I try to use DAVE App INTERRUPT (4.0.8)
Define, "Enable", Prio. and Interrupt handler in DAVE-APP...
Use Method "SetEnable + SetPending" by SW...
With Debugger, I can set a BP inside IRQ-Handle... it's called... OK...
But after leaving IRQ-Handler, CPU/Debugger jumps to anyway??? And Stops ? Not back...
What I am doing wrong?
Not applicable
May 13, 2016
02:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 13, 2016
02:12 AM
Here a screenshoot...
May 16, 2016
02:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 16, 2016
02:04 AM
Hello,
Sorry, what do you mean by "register the callback IRQ-function"?
The non-DAVE App code is doing the same thing as the DAVE app, i.e.:
- enable and configure priority for interrupt node
- define interrupt handler or call back function
- trigger the interrupt
In either case, the interrupt handler would exit to the point of the code execution before the interrupt occurrence.
In your project, you are always getting the breakpoint trap as shown in your attached screenshot?
Regards,
Min Wei
Sorry, what do you mean by "register the callback IRQ-function"?
The non-DAVE App code is doing the same thing as the DAVE app, i.e.:
- enable and configure priority for interrupt node
- define interrupt handler or call back function
- trigger the interrupt
In either case, the interrupt handler would exit to the point of the code execution before the interrupt occurrence.
In your project, you are always getting the breakpoint trap as shown in your attached screenshot?
Regards,
Min Wei
Not applicable
May 16, 2016
11:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 16, 2016
11:34 PM
"register the callback IRQ-function" means for me, to tell the Compiler the IRQ-function for a specific IRQ.
But OK, that's made with the DAVe App...
Yes, Debugger/CPU is always lost after exiting IRQ function...
A BPoint inside IRQ function is working OK. IRQ fucnction is called...
But OK, that's made with the DAVe App...
Yes, Debugger/CPU is always lost after exiting IRQ function...
A BPoint inside IRQ function is working OK. IRQ fucnction is called...
Not applicable
May 16, 2016
11:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 16, 2016
11:35 PM
How can I go on with Analyzing/Debugging that Problem?
Attachments are accessible only for community members.
May 17, 2016
03:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 17, 2016
03:22 AM
Hello,
For the non-APP case, the IRQ function "SCU_0_IRQHandler" is defined in the startup file and hence, the compiler will take care that when the IRQ is triggered, the function will be called.
I am not sure what is causing the breakpoint trap.
I have created a simple pin-toggling example with the XMC2GO kit where:
- P1.0 is toggling always in the while loop of main function
- In the while loop, IRQ0 is being triggered by SW
- IRQ0 function toggles P1.1
Can you try with this simple example to see if it works for you?
Regards,
Min Wei
For the non-APP case, the IRQ function "SCU_0_IRQHandler" is defined in the startup file and hence, the compiler will take care that when the IRQ is triggered, the function will be called.
I am not sure what is causing the breakpoint trap.
I have created a simple pin-toggling example with the XMC2GO kit where:
- P1.0 is toggling always in the while loop of main function
- In the while loop, IRQ0 is being triggered by SW
- IRQ0 function toggles P1.1
Can you try with this simple example to see if it works for you?
Regards,
Min Wei
Not applicable
May 18, 2016
03:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 18, 2016
03:25 AM
Hello,
Thanks for Support, but I have no SKit2Go here...
BUT, In the meantime, I find out, that my DAVE-APP solution is working...
IF:
I define in "Manual Ressource Assignment / INTERRUPT / NVIC-Node: XXX"
Otherwise I get a Hard-Fault.
I can define the node numbers betwwen 2 and 31...
Some are working, some results in Hard-Fault...
e.g. Number 10 is working, I am using that now...
Please, May somebody can give me more backround Information, why and which Node-Numbers I can use, or use for best case ???
Best Thanks.
Thanks for Support, but I have no SKit2Go here...
BUT, In the meantime, I find out, that my DAVE-APP solution is working...
IF:
I define in "Manual Ressource Assignment / INTERRUPT / NVIC-Node: XXX"
Otherwise I get a Hard-Fault.
I can define the node numbers betwwen 2 and 31...
Some are working, some results in Hard-Fault...
e.g. Number 10 is working, I am using that now...
Please, May somebody can give me more backround Information, why and which Node-Numbers I can use, or use for best case ???
Best Thanks.
May 18, 2016
10:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 18, 2016
10:10 PM
Hello,
So the previous problem is due to unassigned NVIC node?
In the XMC1100, most of the NVIC nodes are assigned to specific service request lines of the peripherals:
The interrupt handler is not implemented in DAVE for the NC (not connected) lines, though an exception is IRQ2.
These are the ones causing the default handler (from startup file) to be entered.
For your purpose, I would suggest to use IRQ2 or whichever nodes (IRQ10 is USIC0.SR1) that are not used in your application, for the SW interrupt.
Hope this helps.
By the way, the code that I provided can also be used for XMC1100 boot kit but probably you don't need it anymore.
Regards,
Min Wei
So the previous problem is due to unassigned NVIC node?
In the XMC1100, most of the NVIC nodes are assigned to specific service request lines of the peripherals:
The interrupt handler is not implemented in DAVE for the NC (not connected) lines, though an exception is IRQ2.
These are the ones causing the default handler (from startup file) to be entered.
For your purpose, I would suggest to use IRQ2 or whichever nodes (IRQ10 is USIC0.SR1) that are not used in your application, for the SW interrupt.
Hope this helps.
By the way, the code that I provided can also be used for XMC1100 boot kit but probably you don't need it anymore.
Regards,
Min Wei
Not applicable
May 18, 2016
11:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 18, 2016
11:49 PM
OK, I understood.
2 is already used...
So I am using 6, and it's working fine.
Best Thanks for help!
2 is already used...
So I am using 6, and it's working fine.
Best Thanks for help!