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.

Syntax Error by HWREG() with CCS5.5

Other Parts Discussed in Thread: SYSBIOS

Hey there,

i'm having some trouble with coding the pinmux.

using the macro HWREG() i'm getting an syntax error. (it is declared)

for further information see screenshot.

kind regards!

  • Hendrik,

    Is it giving you an actually build error or just the "?" marker in the editor?  If it is just the ? market that is the static source code analysis checker.  It does not recognize the macro HWREG and is reporting it as a potential issue.

    It is possible to turn this off.  If you go to Windows -> Preferences.  Type analysis in the filter box.  You can then disable the various analysis features.

    The tooltip for the marker should indicate which rule is triggering it.

    Regards,

    John

  • Hey John,

    thanks for your reply!

    after building i'm getting further erros. see the screenshot.

    i included the hw_types.h.

    for your information: im trying to enable the UART4 to send messages.

    du you have any suggestions?

  • I am not sure on the usage of the HWREG macro.  

    #define HWREG(x) \

    (*((volatile unsigned int *)(x)))

    I don't think what you have evaluates to a valid statement

    HWREG( SOC_CONTROL_REGS + CONTROL_PADCONF_UART0_RTSN ) = 0x2 

    That would end up with 

    (*((volatile unsigned int *)(SOC_CONTROL_REGS + CONTROL_PADCONF_UART0_RTSN))) = 0x2

    The Sitara team may better know how that StarterWar macro is meant to be used.

    john

  • In looking through some examples in StarterWare what you have doesn't seem wrong.

        /* Put the PLL in bypass mode */
        regVal = HWREG(SOC_CM_WKUP_REGS + CM_WKUP_CM_CLKMODE_DPLL_CORE) &
                    ~CM_WKUP_CM_CLKMODE_DPLL_CORE_DPLL_EN;
    
        regVal |= CM_WKUP_CM_CLKMODE_DPLL_CORE_DPLL_EN_DPLL_MN_BYP_MODE;
    
        HWREG(SOC_CM_WKUP_REGS + CM_WKUP_CM_CLKMODE_DPLL_CORE) = regVal;

    I would suggest posting in the Sitara forum.  They should be able to quickly figure it out.

  • Make sure you are using the correct identifier within HWREG. For AM335x, in the file hw_control_AM335x.h, I see defines for CONTROL_CONF_UART_CTSN(n) and CONTROL_CONF_UART_RTSN(n).

    But you are using CONTROL_PADCONF_UART0_RTSN which I don't see defined in any of the header files in AM335x Starterware. Double check that and make sure you are using the correct identifier. If you still need help after checking on that, I would suggest posting to the Sitara forum as John suggested.

  • Hey AartiG,

    the idetifier is from the mux.h from the pin mux utility. do you know the tool?

    maybe i'm going to check the starterware application to get the right way.

    kind regards

  • Do you get the same error if you put the HWREG() statement inside a function rather than at file scope?

  • i'm sorry i did a mistake like that.

    of course i should put it into a function.

    HWREG(SOC_CONTROL_REGS + CONTROL_CONF_UART_CTSN(0)) = 0x2;
    

    now i'm getting an error like this..

    [CortxA8] in handle: 0x0.
    Main stack base: 0x800161ac.
    Main stack size: 0x2000.
    R0 = 0x44e10968  R8  = 0x4030cdcc
    R1 = 0x00000000  R9  = 0x4030cdf4
    R2 = 0x80006f90  R10 = 0x402f7935
    R3 = 0x00000000  R11 = 0x00029940
    R4 = 0x4030d008  R12 = 0x00000002
    R5 = 0x00028bf4  SP(R13) = 0x80018170
    R6 = 0x00000001  LR(R14) = 0x8000a874
    R7 = 0x4030cb7c  PC(R15) = 0x80007778
    PSR = 0x6000019f
    ti.sysbios.family.arm.exc.Exception: line 176: E_dataAbort: pc = 0x80007778, lr = 0x8000a874.
    xdc.runtime.Error.raise: terminating execution
    

  • Hendrik Klasen said:

    ti.sysbios.family.arm.exc.Exception: line 176: E_dataAbort: pc = 0x80007778, lr = 0x8000a874. xdc.runtime.Error.raise: terminating execution

    So this is a SYS/BIOS application? What you are getting is a dataAbort which occurs due to illegal data access. This could be happening due to several reasons and you would need to debug your code to determine why it is happening.

    If you search the TI-RTOS forum you will find a few other instances where this has come up before. Here are a couple of threads with similar errors, however note that the root cause of your error may be different:

    http://e2e.ti.com/support/embedded/tirtos/f/355/t/348347.aspx
    http://e2e.ti.com/support/embedded/tirtos/f/355/t/260936.aspx

    Since you are past the build error, if you need further help with this runtime exception I would suggest starting a new post in the TI-RTOS forum or Sitara forum.