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.

Creating HWI object in runtime on cc2538

Other Parts Discussed in Thread: CC2538, SYSBIOS

Hi!

I am exploring SYS/BIOS on CC2538. I've got some help in an earlier post from Mark Grosen where he sent me an example project for CCS which got me up and running.

Now I'm trying to configure a HWI in runtime. So I am basically configuring a button as input and calling

Hwi_create(16, lightLED, NULL, NULL);

Where 16 is the vector number for GPIO port A (I'm using the CC2538 together with the SmartRF06EB where the select button is placed on GPIO port A). When compiling and pushing the button, console shows

[Cortex_M3_0] 206c44 LR(R14) = 0x0020519f
R7 = 0x00000000 PC(R15) = 0x00204750
PSR = 0x21000000
ICSR = 0x0400f810
MMFSR = 0x00
BFSR = 0x00
UFSR = 0x0000
HFSR = 0x00000000
DFSR = 0x00000000
MMAR = 0xe000ed34
BFAR = 0xe000ed38
AFSR = 0x00000000
Terminating execution...

Under the Exception tab in ROV's Hwi section, i see

Exception core 0
Decoded: Undefined Hwi: 16

And a record in the LoggerBuffer says

ERROR: "(unknown file)", line 1120: E_noIsr: id = 16, pc = 00204750

The E_noIsr is an "Error raised when an uninitialized interrupt occurs" which does not give me anything...

If I configure the HWI statically in my .cfg, It works like a charm:

Program.global.hwi0 = M3Hwi.create(16, "&lightLED");

But this is not what i want to do. Does anybody see what's wrong?

Best regards,

Anders

  • Anders,

    The sample configuration placed the interrupt vector table in Flash. This was done to save on RAM usage since most users preferred to setup Hwi's statically and save on RAM usage. Your usage tried to plug a Hwi into Flash at run-time which will not work. Fragment from the .cfg file:

    /* put reset/interrupt vectors at start of Flash - can be changed so RAM is used */
    var M3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
    M3Hwi.resetVectorAddress  = 0x200000;
    M3Hwi.vectorTableAddress  = 0x200000;

    I would recommend leaving in Flash since there is limited RAM on the CC2538.

    Mark

  • Mark,

    You are totally right. After setting the vector table address to 0x20000000(start of SRAM) it worked.

    Thanks for the tip about leaving it in flash, it will be considered.

    Best regards

    Anders