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.

Error in running SYSbios gpioLEDBlink.c on BeagleBone-AM3358 using CCS5.3

Other Parts Discussed in Thread: SYSBIOS

Hi All

I am using BeagleBone-AM3358 board and started with SYSbios programming in CCSv5.3 and  flashing the code using on-board JTAG Emulator XDS100v2.

I wanted use GPIO of Cortex-A8 to blink LED on BeagleBone and for that i have downloaded  AM335x_SYSBIOS_IND_SDK and i am able to build gpioLEDBlink.c.

But after loading the code on BeagleBone ,it seems the code is executing and enter into main function but end-up  with exception error here is the error i am posting.

[CortxA8] in handle: 0x0.
Main stack base: 0x80010000.
Main stack size: 0x2000.
R0 = 0x44e000ac  R8  = 0x000a0000
R1 = 0x00000000  R9  = 0x00000000
R2 = 0x80004550  R10 = 0x000298d0
R3 = 0x00000000  R11 = 0x000298d0
R4 = 0x4030cfd8  R12 = 0xffffffff
R5 = 0x000d5e52  SP(R13) = 0x80011ff0
R6 = 0x48040000  LR(R14) = 0x80006df8
R7 = 0x4030fca0  PC(R15) = 0x80003ee4
PSR = 0x6000019f
ti.sysbios.family.arm.exc.Exception: line 176: E_dataAbort: pc = 0x80003ee4, lr = 0x80006df8.
xdc.runtime.Error.raise: terminating execution


It seems the code is failing at gpio.c

 Please come with some suggestion .

Thanks

  • Hi Satyaprakash,

    The exception you are seeing is occurring due to an illegal data access. This could be due to several reasons. You will need to debug a little more to find out the root cause. Can you try adding a breakpoint at 0x80006df8 instruction ? This is the LR register value as shown in the exception dump and is the address of the instruction that caused the exception.

    Once the breakpoint is hit, please note what address is being accessed. You should also be able to determine the equivalent C code.

    Best,

    Ashish

  • Hello Ashish

    Thanks for your Cooperation.

    I tried the same as you suggested  after adding Breakpoints in gpio.c and i am able to locate where it is failing.

    And it is hitting LR register having  0x80006de0 and execution stops at exact location,  but in Disassemble explorer i found little deviation ..here is the deviation-->

              main:
    80006dd8:   E92D4008 STMFD           R13!, {R3, R14}
     68           GPIO1ModuleClkConfig();
    80006ddc:   EBFFF583 BL              GPIO1ModuleClkConfig

    ....................................................................................................................

    164           HWREG(SOC_CM_PER_REGS + CM_PER_GPIO1_CLKCTRL) |=
              GPIO1ModuleClkConfig:
    800043f0:   E59F00C0 LDR             R0, $C$CON8
    800043f4:   E590C000 LDR             R12, [R0]
    800043f8:   E38CC002 ORR             R12, R12, #2
    800043fc:   E580C000 STR             R12, [R0]
    168           while(CM_PER_GPIO1_CLKCTRL_MODULEMODE_ENABLE !=
              $C$DW$L$GPIO1ModuleClkConfig$2$B, $C$L10:
    80004400:   E59FC0B0 LDR             R12, $C$CON8

    ............................................................................................................................................................

    At line 164 & 168 i put the breakpoints and at  Line-164 execution fails but how-come line 164 is above GPIO1ModuleClkConfig: in assembly as given above!! ?

    but in my code line 164 is inside GPIO1ModuleClkConfig: where the execution fails...i am confused looking at assembly format .

    Question :

    Is that i need to include any BSL library package to run  SYSbios application which is interacting with registers and all for example like LCD / LED / Audio application.In TI Training videos the  Eric and Scott is referring Logic_PD BSL library ?

    I am really confused with this...can u show me some light ...!?

    Thanks

  • Hi Satyaprakash,

    I checked the Exception Module code again and it seems the address in the PC register (not LR register) in the exception dump is that of the offending assembly instruction. Please put a breakpoint at the address indicated in the exception dump's PC register.

    Satyaprakash Mishra said:

    At line 164 & 168 i put the breakpoints and at  Line-164 execution fails but how-come line 164 is above GPIO1ModuleClkConfig: in assembly as given above!! ?

    but in my code line 164 is inside GPIO1ModuleClkConfig: where the execution fails...i am confused looking at assembly format .

    The ordering of the embedded C instructions in the disassembler is sometimes wrong. I have seen that before. Are you building with a debug or release profile ? If you are building with release profile then it is possible that the disassembler is a bit confused.

    Satyaprakash Mishra said:

    Question :

    Is that i need to include any BSL library package to run  SYSbios application which is interacting with registers and all for example like LCD / LED / Audio application.In TI Training videos the  Eric and Scott is referring Logic_PD BSL library ?

    I am really confused with this...can u show me some light ...!?

    I dont know much about the Logic_PL BSL library so cannot comment on that (Sorry). My guess is that your application is trying to access a memory mapped register that is located at an address that is not mapped in the MMU. If you know the GPIO addresses being used in your app, you can look at the MMU module's ROV view and make sure the address is mapped.

    If you are able to break at the instruction that is performing the illegal data access (using PC as mentioned above), you can read the load/store address from the register view and then look at the MMU table in ROV.

    Best,
    Ashish