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.

Graphic lcd with ti.sysbios.family.arm.m3.Hwi

Other Parts Discussed in Thread: SYSBIOS

Hi , 

I'm facing a problem with the grlibdemo_TivaTM4C123GH6PGE sample. When I use the ti.sysbios.family.arm.m3.Hwi module by adding this line to the .cfg file 

var ti_sysbios_family_arm_m3_Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');

The code crashes at the line

GrImageDraw(&context, pucCurImage, 0, 0); 

when i stop using ti.sysbios.family.arm.m3.Hwi it works fine.

I'm using CCSv 6, TI-RTOS for TivaC 2.10.1.38 , xdctools_3_30_04_52_core 

could anyone help plz.

Thanks

  • Hi Mostafa,

    Can you share the crash dump/log ?

    Best,
    Ashish
  • Hi Ashish ,

    Thanks for your reply . This is the line where the code crashed.
    /* Draw image at (0,0) */
    GrImageDraw(&context, pucCurImage, 0, 0);

    and here are the crash log

    ti.sysbios.family.arm.m3.Hwi: line 1036: E_hardFault: FORCED
    ti.sysbios.family.arm.m3.Hwi: line 1148: E_usageFault: UNALIGNED: Unaligned memory access
    Exception occurred in background thread at PC = 0x0000046a.
    Core 0: Exception occurred in ThreadType_Task.
    Task name: {unknown-instance-name}, handle: 0x20000a20.
    Task stack base: 0x20000a70.
    Task stack size: 0x320.
    R0 = 0x20003430 R8 = 0x0000ff61
    R1 = 0x0000ff60 R9 = 0xffffffff
    R2 = 0x00000000 R10 = 0xffffffff
    R3 = 0x00000000 R11 = 0xffffffff
    R4 = 0x00000084 R12 = 0x00000000
    R5 = 0xffffffff SP(R13) = 0x20000c78
    R6 = 0xffffffff LR(R14) = 0x0000dd59
    R7 = 0xffffffff PC(R15) = 0x0000046a
    PSR = 0x61000200
    ICSR = 0x00423803
    MMFSR = 0x00
    BFSR = 0x00
    UFSR = 0x0100
    HFSR = 0x40000000
    DFSR = 0x0000000b
    MMAR = 0xe000ed34
    BFAR = 0xe000ed38
    AFSR = 0x00000000
    Terminating execution...

    Thanks.
  • Hi Mostafa,

    From the crash dump, it looks like an unaligned memory access triggered the fault. I am suspecting that either one of the buffers being used is not properly aligned or the buffer pointer somehow got corrupted causing it to point at some random address. The exact address at which the fault occurred is 0x46a (PC/R15 in crash log). I would suggest putting a breakpoint a few instruction before this address and once the break point is hit, stepping through the code to figure out what is happening.

    Since you mentioned the exception occurred within the GrImageDraw(&context, pucCurImage, 0, 0) function, I would also suggest checking the pointers passed to this function are not corrupted.

    Best,
    Ashish
  • Hi Ashish ,

    The issue is that the sample works fine when ti_sysbios_family_arm_m3_Hwi module is disabled. Which means that the code has no problems.

    Best,
    Mostafa
  • Hi Mostafa,

    Removing the useModule for m3.Hwi does not actually disable it. The Hwi module is still enabled. I dont see why doing a useModule on m3.Hwi would cause the app to crash. Let me try to find a board and see if I can repro the problem on my end.

    Best,
    Ashish
  • Hi Mostafa,

    I imported the graphics lib example and added a useModule to pull in m3.Hwi module. I dont see the application crash. Are there other changes that you are making to the example ?

    Best,
    Ashish
  • Hi Ashish,

    Did you try to push the buttons ? It crashes when I push the button.

    Thanks,
    Mostafa
  • Hi Mostafa,

    I did push the buttons and did not see any crash. I dont expect a useModule on m3.Hwi to cause any problems either. Can you start with a fresh project ? If you still see a problem, I would recommend adding breakpoints in the GrImageDraw() function and single stepping to find the offending line of code. Doing so should help figure out what exactly is going wrong.

    I also wanted to know that do you always get the exact same crash log ? Basically I want to know if the crash always occurs in the same function or not.

    Best,
    Ashish