Hi Brn,
This is a closer but it is still not enough to be able to help you. We
need a code /snippet/ - cut down the code to the minimal necessary so
that we can compile the code and see the problem. Your code below won't
compile because it is missing some defines, and it has lots more code
making it hard to see where the problem might lie. It could well be
that your code here (once you've included the missing defines) /is/ the
minimal code that shows the error, in which case adding the missing
parts should be easy enough.
You are also missing the compile flags and the compiler version.
Without these, we can't replicate the error or give useful advice (such
as alternative compiler flags to try).
mvh.,
David
Brn Gomes wrote:
Follow-up Comment #1, bug #28108 (project avr-libc):
If I want a CAN msg with ID=0xFDFFFFF0 on msg2
it sends
ID=0xFDFDFFF0....
#define TEST_CAN_MSG1_ID 0xFDFFFFE0L
#define TEST_CAN_MSG2_ID 0xFDFFFFD0L
#define TEST_CAN_MSG3_ID 0xFDFFFFC0L
#define TEST_CAN_TX_MSG0_ID TEST_CAN_MSG3_ID
#define TEST_CAN_TX_MSG1_ID TEST_CAN_MSG1_ID
#define TEST_CAN_TX_MSG2_ID TEST_CAN_MSG2_ID
typedef struct
{
uint32_t id;
uint32_t id_msk;
uint8_t *data_ptr;
uint8_t status;
uint8_t proc;
void *action_ptr;
uint8_t max_size;
uint8_t size;
uint8_t mob_num;
uint8_t wdlc;
uint8_t mob_assign;
} can_msg_t;
static volatile can_msg_t can_tx_msg0;
static volatile can_msg_t can_tx_msg1;
static volatile can_msg_t can_tx_msg2;
static volatile uint8_t can_buf_out_msg0[10];
static volatile uint8_t can_buf_out_msg1[10];
static volatile uint8_t can_buf_out_msg2[10];
funtion called in C code:
void InitCan(void){
/*
* Msg 0
*/
can_tx_msg0.id = TEST_CAN_TX_MSG0_ID;
can_tx_msg0.data_ptr = (uint8_t *) can_buf_out_msg0;
can_tx_msg0.max_size = 8;
can_tx_msg0.size = 8;
can_tx_msg0.status = NOT_SENT;
can_tx_msg0.mob_num = 0;
can_tx_msg0.mob_assign = FIXED_MOB;
/* send dummy data... */
can_buf_out_msg0[0] = 0;
can_buf_out_msg0[1] = 0;
can_buf_out_msg0[2] = 0;
can_buf_out_msg0[3] = 0;
can_buf_out_msg0[4] = 0xDE;
can_buf_out_msg0[5] = 0xAD;
can_buf_out_msg0[6] = 0xFA;
can_buf_out_msg0[7] = 0xCE;
/*
* Msg 1
*/
can_tx_msg1.id = TEST_CAN_TX_MSG1_ID;
can_tx_msg1.data_ptr = (uint8_t *) can_buf_out_msg1;
can_tx_msg1.max_size = 8;
can_tx_msg1.size = 8;
can_tx_msg1.status = NOT_SENT;
can_tx_msg1.mob_assign = FLOATING_MOB;
/* send dummy data... */
can_buf_out_msg1[0] = 0xDE;
can_buf_out_msg1[1] = 0xAD;
can_buf_out_msg1[2] = 0xFA;
can_buf_out_msg1[3] = 0xCE;
can_buf_out_msg1[4] = 0;
can_buf_out_msg1[5] = 0;
can_buf_out_msg1[6] = 0;
can_buf_out_msg1[7] = 0;
/*
* Msg 2
*/
can_tx_msg2.id = TEST_CAN_TX_MSG2_ID;
can_tx_msg2.data_ptr = (uint8_t *) can_buf_out_msg2;
can_tx_msg2.max_size = 8;
can_tx_msg2.size = 8;
can_tx_msg2.status = NOT_SENT;
can_tx_msg2.mob_assign = FLOATING_MOB;
/* send dummy data... */
can_buf_out_msg2[0] = 0xDE;
can_buf_out_msg2[1] = 0xAD;
can_buf_out_msg2[2] = 0xFA;
can_buf_out_msg2[3] = 0xCE;
can_buf_out_msg2[4] = 0;
can_buf_out_msg2[5] = 0;
can_buf_out_msg2[6] = 0;
can_buf_out_msg2[7] = 0;
......-----------......
the .lss file generated with the error at line 724:
can_tx_msg2.id = TEST_CAN_TX_MSG2_ID;
71a: 00 ed ldi r16, 0xD0 ; 208
71c: e0 2e mov r14, r16
71e: 0f ef ldi r16, 0xFF ; 255
720: f0 2e mov r15, r16
722: 0f ef ldi r16, 0xFF ; 255
724: 00 2f mov r16, r16
726: 0d ef ldi r16, 0xFD ; 253
728: 10 2f mov r17, r16
72a: e0 92 0f 02 sts 0x020F, r14
72e: f0 92 10 02 sts 0x0210, r15
732: 00 93 11 02 sts 0x0211, r16
736: 10 93 12 02 sts 0x0212, r17
can_tx_msg2.data_ptr = (uint8_t *) can_buf_out_msg2;
73a: 86 e3 ldi r24, 0x36 ; 54
73c: 92 e0 ldi r25, 0x02 ; 2
73e: 90 93 18 02 sts 0x0218, r25
742: 80 93 17 02 sts 0x0217, r24
can_tx_msg2.max_size = 8;
746: 60 93 1d 02 sts 0x021D, r22
can_tx_msg2.size = 8;
74a: 60 93 1e 02 sts 0x021E, r22
can_tx_msg2.status = NOT_SENT;
74e: 70 93 19 02 sts 0x0219, r23
_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev