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.

TMS320F28374S: registers cannot be write in .cla file

Part Number: TMS320F28374S
Other Parts Discussed in Thread: SYSBIOS

Tool/software:

cla1forcetask7 in .cla flie is used, and cla1Task7 is working for i32count is changing.

but GPIO48 and EPWM7.CMPB is not set , and cnt does not have the value as in .c flie ,

why these registers cannot  be read and write in the .cla file?

  • please note most of the team is OOO due to the US holiday.  Please expect a response next week.

  • Hi Jane,

    CLA code in a .cla file cannot perform bitfield accesses which is what you have shown here. You should instead access the register bitfields using a HWREG line, like the below example:

    This HWREG access is possible because the functionality is defined in the hw_types.h file, which can be compiled for the CLA (if the project is specified as a CLA project in the project settings). If you started with a example CLA project, this is already configured.

    Best Regards,

    Delaney

  • Hi, Delaney,

    THANKS for help.

    it does not seems to work. 

    we want to set EPWM7Regs.AQCSFRC.all = 5 in share.cla file.

    first , we set 

    int32 *tt = 0X004649; is defined in .c file.

    as you said,  in the cal1task1()    in share.cla file, 

    HWREG(tt )=5;

     cal1task1()   is running. but AQCSFRC is still = 0 , it also dose not work.

    can you point out what is wrong?

    by the way , we use SYS/BIOS, will that effect the .cla to read/write the register?

  • Hi Jane,

    Since the AQCSFRC is a 16-bit register, you should instead use HWREGH. Can you try using the following line in the .cla file:

    HWREGH(EPWM7_BASE + EPWM_O_AQCSFRC) = 5;

    You should also be able to directly call any inline driverlib functions from the epwm.h file, if that would be easier.

    by the way , we use SYS/BIOS, will that effect the .cla to read/write the register?

    I don't believe so but let me loop in the SYSBIOS expert to comment.

    Best Regards,

    Delaney