Hi,
i'm using the following platform:
- tirtos_tivac_2.10.01.38
- CCS 6.0.1.00040
- xdctools_3_30_06_67_core
and i don't know how the " Hwi_excFillContext" can be invoked using from the cfg file, so please advice.
Thanks,
Mohamed Fawzy
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.
Hi,
i'm using the following platform:
- tirtos_tivac_2.10.01.38
- CCS 6.0.1.00040
- xdctools_3_30_06_67_core
and i don't know how the " Hwi_excFillContext" can be invoked using from the cfg file, so please advice.
Thanks,
Mohamed Fawzy
Hwi_execFillContext is not an API that can be invoked though the .cfg file. It's an internal API that is called by the Hwi module when a hardware exception was detected. By default, the M3 implmentation of the Hwi module has a 'excHandlerFunc' function pointer which points to 'Hwi_excHandlerMax' who in turn calls Hwi_excFillContext.
Are you trying to plug in your own execption function?
Actually, i'm trying to create my own exception handler using
var M3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
M3Hwi.excHandlerFunc = "&myExceptionHandler";
but, i'm wondering why the default function "Hwi_excHandlerMax"isn't invoked when exception is accrued, if i commented the second line which invoke my custom handler, so this is why i'm asking. Any idea?
One more thing, as i mentioned that i'm trying to build my custom handler, and i have more question regarding this point:
1- if i tried to duplicate the dump register function "Hwi_excDumpRegs" to make my custom function, i can't find Hwi_module definition, so how can i use it within my custom dump function?
2- if i tried to use "Hwi_ExcContext", i have to include <ti/sysbios/family/arm/m3/Hwi.h> which is causing compilation error dude to duplicate definition in <ti/sysbios/hal/hwi.h> which i needed it also, any advice?
anyway, if you have a sample that have a custom exception handler function, this will be very very helpful.
Thanks,
Mohamed Fawzy
Mohamed Fawzy said:M3Hwi.excHandlerFunc = "&myExceptionHandler";
This line overrides the default "Hwi_excHandlerMax" function to use "myExceptionHandler". It's one or the other.
I think what you are looking for is to keep the default exception handler (either excHandlerMax or excHandlerMin) and then add your own exception hook function that is called within the default handler.
M3Hwi.excHandlerFunc = M3Hwi.excHandlerMax; //or just remove this line altogether.
M3Hwi.excHookFunc = "&myExceptionHookFunction";
Your myExceptionHookFunction would look something like this:
#include <ti/sysbios/family/arm/m3/Hwi.h> Void myExecHookFunction(Hwi_ExcContext *context) { System_printf("My Exec: %d\n", context->threadType); }
The *context pointer then contains all the registers + other stuff that you're looking for.
Remove the #include <ti/sysbios/hal/Hwi.h> in your .c file and var Hwi = xdc.useModule('ti.sysbios.hal.Hwi') from your .cfg file. You should be using only the family (arm/m3) specific Hwi module:
.cfg: var HwiM3 = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
.c: #include <ti/sysbios/family/arm/m3/Hwi.h>
I'm not too familiar with the RTSC tools so I'm not sure that I understand your question. There is an API "Error_getMsg()" that will return the string of an error. The documentation for the Error module can be found here.