From: Jānis Š. <jan...@gm...> - 2015-12-26 00:27:00
|
Hello, I'm trying to define an alias to CAN buffers of a PIC18F25K80 chips somewhat like: typedef struct { union { struct { unsigned CON_FLTHIT : 5; unsigned CON_RTRRO : 1; unsigned CON_RXM1 : 1; unsigned CON_RXFUL : 1; }; uint8_t CON; }; uint8_t SIDH; uint8_t SIDL; uint8_t EIDH; uint8_t EIDL; uint8_t DLC; uint8_t D[8]; } can_buffer_t; volatile __at(0xF60) can_buffer_t RXB0; volatile __at(0xF30) can_buffer_t RXB1; volatile __at(0xE80) can_buffer_t B0; volatile __at(0xE90) can_buffer_t B1; volatile __at(0xEA0) can_buffer_t B2; volatile __at(0xEB0) can_buffer_t B3; volatile __at(0xEC0) can_buffer_t B4; volatile __at(0xED0) can_buffer_t B5; but this ends up giving me errors: error: More absolute sections use same address: 0xe80 -- "ustat_can_00/_B0", "ustat_pic18f25k80_00/_B0CONbits" error: More absolute sections use same address: 0xf60 -- "ustat_can_07/_RXB0", "ustat_pic18f25k80_01/_RXB0CONbits" however if I make the variables extern, I get: error: Missing definition for symbol "_RXB0", required by "can_left.o". error: Missing definition for symbol "_RXB1", required by "can_left.o". error: Missing definition for symbol "_B5", required by "can_left.o". error: Missing definition for symbol "_B4", required by "can_left.o". error: Missing definition for symbol "_B3", required by "can_left.o". error: Missing definition for symbol "_B2", required by "can_left.o". error: Missing definition for symbol "_B1", required by "can_left.o". error: Missing definition for symbol "_B0", required by "can_left.o". I get that the variables are assigned ustat section which collides with the section emitted by pic18f15k80.c, but it does have multiple variables with same address in itself. Am I doing something wrong? Can I have the code to emit only symbols but not a memory section (if it makes sense)? With thanks, Jānis |