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.

Bit fields greater than 8 bits

Other Parts Discussed in Thread: TMS320C6678

Hello everyone,

Yesterday, I started experimenting with the TMS320C6678. The Hello World application loaded so I tried going a little further. Step by step it became a bigger project but now I have a problem. For your information: I'm a beginner.

I found something called bit fields on the internet with a sample code which contained this piece of code:

struct _ACQ_STATUS_T
{
	// MSB
	bool RESERVED1:14;
	bool analogInputOverflow:1;
	bool analogInputDataAvail:1;
	// LSB
};

It first looked like it worked until CCS(v5) complained about 

bool RESERVED1:14; 


It says: #106 invalid size for bit field.

My question for you guys, how to solve this?

Thanks in advance,

Lars Jansen
The Netherlands

  • Hi Lars,

    Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages (for processor issues). Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics (e2e.ti.com).

    This is keystone device forum so device/peripheral/MCSDK related queries and issues are addressed here.

    Please post your compiler related queries to Compiler forum and Code Composer Studio  related queries to CCS Forum.

    Please try with below struct. I think bool is not supported.

    struct _ACQ_STATUS_T
    {
    	// MSB
    	uint16_t RESERVED1:14;
    	uint16_t analogInputOverflow:1;
    	uint16_t analogInputDataAvail:1;
    	// LSB
    };

    Thank you.