WARNING C3801: Segment already used with different attributes

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

WARNING C3801: Segment already used with different attributes

2,289 Views
MusikA
Contributor I
Hi,

I got this warning "WARNING C3801: Segment already used with different attributes" when I allocated constants to the paged flash.

The PRM File:

PLACEMENT
DEFAULT_ROM,
DTC_SECTION INTO PAGE_DF, PAGE_DE, PAGE_DD, PAGE_DC, PAGE_DB, PAGE_DA,
PAGE_D9, PAGE_D8, PAGE_D7, PAGE_D6, PAGE_D5, PAGE_D4,
PAGE_D3, PAGE_D2, PAGE_D1, PAGE_D0, PAGE_FC, PAGE_FB,
PAGE_FA, PAGE_F9, PAGE_F8, PAGE_F7, PAGE_F6, PAGE_F5,
PAGE_F4, PAGE_F3, PAGE_F2, PAGE_F1, PAGE_F0, PAGE_EF,
PAGE_EE, PAGE_ED, PAGE_EC, PAGE_EB, PAGE_EA;
END

The code:

#pragma CONST_SEG DTC_SECTION
const T_u16 BLD_CRC16_CCITT_Table[ 256 ] = {0x0000U, 0x1021U, 0x2042U, 0x3063U,....};
#pragma CONST_SEG DEFAULT

Although it builds successfully but this warning bothers me. We still have a lot of space in our paged flash. Why is this happening?

Thanks.
Labels (1)
0 Kudos
4 Replies

561 Views
CrasyCat
Specialist III

Hello

 

Is the message popping up on the line

#pragma CONST_SEG DTC_SECTION

If this is the case can you search for all occurrence of DTC_SECTION in your project?

Are you using that section in another pragma?

How does it look like?

 

CrasyCat

0 Kudos

561 Views
MusikA
Contributor I

Yeah, the message is popping on the line with #pragma CONST_SEG DTC_SECTION.

 

These are the occurrence of DTC_SECTION:

BLD_CRC16_CCITT_Table F5BCE7 200 512 10 DTC_SECTION 

DTC_SECTION 512 R 0xF5BCE7 0xF5BEE6 PAGE_F5

 

Yeah, someone is using that in another pragma.

 

#pragma CONST_SEG __GPAGE_SEG DTC_SECTION

const DTC_attributes stDTCattributes[MAX_DTCS] = { { 0xE100u, 0x00, 127, 255, 100, PROTECTED | CLEAR_IMME | WARN_IND | TPMS_DTC }, /* DTC_E10000 *//* FAULT_ECU_NOT_CONFIGURED */ { 0x9182u, 0x55, 127, 255, 100, PROTECTED | CLEAR_IMME | WARN_IND | TPMS_DTC }, /* DTC_918255 *//* FAULT_ECU_IN_MANUFACTURE_MODE */ { 0xE200u, 0x55, 64, 255, 100, PROTECTED | CLEAR_IMME } };

#pragma CONST_SEG DEFAULT 

0 Kudos

561 Views
CrasyCat
Specialist III

Hello

 

So to get rid of the warning use a consistent notation to define DTC_SECTION.

Either define it a __GPAGE_SEG or without __GPAGE_SEG.

 

Or use another section name.

 

CrasyCat

0 Kudos

561 Views
MusikA
Contributor I

Thank you so much CrasyCat...

 

The warning is already gone. 

 

I'm just so dumb not to notice that "__GPAGE_SEG"..hehehe.... 

 

Good day... 

0 Kudos