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.

CCS/MSP432P401R: Problem with variables space

Part Number: MSP432P401R

Tool/software: Code Composer Studio

Hello,

I have this problem, a buffer (with adress 0x20000200) with 128 spaces and it goes and inglobe a struct which adress is 0x20000280, now in my program the struct is a must and I need it to run my hardware but when I reset the buffer, it resets my structur too. I already tryed to optimize the global variables, but it doesn't change. Do you have a suggestion?

Thanks

  • Andrea,
    Can you describe or send code for exactly what you are doing when you "reset the the buffer?".
    -Bob L
  • The code is realy massive, but ok, I link what I think is essential.

    typedef struct  {
    	EPD_SIZE_t	  	Size_ID;
    	uint8_t   		channel_select[8]; /**< the SPI register data of Channel Select */
        union{
    	uint8_t   		voltage_level;     /**< the SPI register data of Voltage Level */
        uint8_t   		Dummy_line_offset;     /**<dummy line offset length*/
        };
    	uint16_t  		horizontal_size;   /**< the bytes of width of EPD */
    	uint16_t  		vertical_size;     /**< the bytes of height of EPD */
    	uint8_t   		data_line_size;    /**< Data + Scan + Dummy bytes */
    	uint16_t  		frame_time_offset; /**< the rest of frame time in a stage */
    	uint16_t  		stage_time;        /**< defined stage time */
    } COG_parameters_t;        //Struct of the variable at adress 0x2000280
    
    typedef union {
    	union {
            //eTC_G2_Aurora_Mb
            struct eTC_G2Mb_144_line_data_t eTC_G2Mb_144_line_data; /**< line data structure of 1.44" EPD */
    		struct eTC_G2Mb_200_line_data_t eTC_G2Mb_200_line_data; /**< line data structure of 2" EPD */
    		struct eTC_G2Mb_270_line_data_t eTC_G2Mb_270_line_data; /**< line data structure of 2.7" EPD */
    		struct eTC_G2Mb_190_line_data_t eTC_G2Mb_190_line_data; /**< line data structure of 1.9" EPD */
    		struct eTC_G2Mb_260_line_data_t eTC_G2Mb_260_line_data; /**< line data structure of 2.6" EPD */
    
        } line_data_by_size; /**< the line data of specific EPD size */
    	uint8_t uint8[LINE_BUFFER_DATA_SIZE]; /**< the maximum line buffer data size as length */ //LINE_BUFFER_DATA_SIZE=128
    } eTC_G2Mb_line_data_t;     //Struct of the variable at adress 0x2000200
    
    uint8_t eTC_G2Mb_initialize_driver (OperationMode_t operationmode) {
    		uint16_t i;
    	// Empty the Line buffer
    	for (i = 0; i <= LINE_BUFFER_DATA_SIZE; i ++) {             //THE ERROR IS HERE LINE_BUFFER_DATA_SIZE = 128
    		COG_Line.uint8[i] = 0x00;                           //COG_Line is of type eTC_G2Mb_line_data_t
    	}
    	// Determine the EPD size for driving COG
    	eTC_G2Mb_RegAssign_Select();
    	
    	i = 0;
    
    	while (EPD_IsBusy()) {
    		if((i++) >= 0x0FFF) return ERROR_BUSY;
    	}
    
    	//Check COG ID
    	if((EPD_Gx_spi_rid() & 0x0F) !=0x02) return ERROR_COG_ID;
    	//Disable OE
    	EPD_Gx_spi_send_byte(0x02,0x40);
    	//Check Breakage
    	if((EPD_Gx_spi_r(0x0F,0x00) & 0x80) != 0x80) return ERROR_BREAKAGE;
    	//Power Saving Mode
     	EPD_Gx_spi_send_byte(0x0B, 0x02);
    	//Channel Select
    	EPD_Gx_spi_send (0x01, (uint8_t *)&cur_cog_param->channel_select, 8);
    	//High Power Mode Osc Setting
    	EPD_Gx_spi_send_byte(0x07,0xD1);
    	//Power Setting
    	EPD_Gx_spi_send_byte(0x08,0x02);
    	//Set Vcom level
    	EPD_Gx_spi_send_byte(0x09,0xC2);
    	//Power Setting
    	EPD_Gx_spi_send_byte(0x04,0x03);
    	//Driver latch on
    	EPD_Gx_spi_send_byte(0x03,0x01);
    	//Driver latch off
    	EPD_Gx_spi_send_byte(0x03,0x00);
    	EPD_delay_ms(5);
    	//Chargepump Start
    	i=0;
    	do {
    		//Start chargepump positive V
    		//VGH & VDH on
    		EPD_Gx_spi_send_byte(0x05,0x01);
    		EPD_delay_ms(240);
    		//Start chargepump neg voltage
    		//VGL & VDL on
    		EPD_Gx_spi_send_byte(0x05,0x03);
    		EPD_delay_ms(40);
    		//Set chargepump
    		//Vcom_Driver to ON
    		//Vcom_Driver on
    		EPD_Gx_spi_send_byte(0x05,0x0F);
    		EPD_delay_ms(40);
    		//Check DC/DC
    		if((EPD_Gx_spi_r(0x0F,0x00) & 0x40) == 0x40)
    		{
    			//Output enable to disable
    			EPD_Gx_spi_send_byte(0x02,0x06);
    			break;
    		}
    	}while((i++) != 4);
    
    	if(i>=4) return ERROR_CHARGEPUMP;
    	else return RES_OK;
    }
    

    I hope it would help you, tell me if you want other parts.

  • Thanks Andrea. This helps. I'll have a look at it and get back to you.
    -Bob
  • I resolved it, I did wrong the optimization of the memory. Now it works.

**Attention** This is a public forum