CAN2 using problem on stm32f107

General discussion on mikroPascal PRO for ARM.
Post Reply
Author
Message
HastyHarry
Posts: 7
Joined: 14 Jan 2015 12:04

CAN2 using problem on stm32f107

#1 Post by HastyHarry » 11 Mar 2015 15:48

Hello. I have a problem with second CAN on STM32F107.
This is the initialisation code:
CAN2_Init_Flags = 0;
CAN2_Send_Flags = 0;
CAN2_Rcv_Flags = 0;

CAN2_Send_Flags = _CAN_TX_XTD_FRAME &
_CAN_TX_NO_RTR_FRAME;

CAN2_Init_Flags = _CAN_CONFIG_AUTOMATIC_RETRANSMISSION &
_CAN_CONFIG_RX_FIFO_NOT_LOCKED_ON_OVERRUN &
_CAN_CONFIG_TIME_TRIGGERED_MODE_DISABLED &
_CAN_CONFIG_TX_FIFO_PRIORITY_BY_IDINTIFIER &
_CAN_CONFIG_WAKE_UP;

CAN2InitializeAdvanced(1,16,7,2,8,CAN2_Init_Flags, &_GPIO_MODULE_CAN2_PB12_13); // Initialize CAN module
CAN2SetOperationMode(_CAN_OperatingMode_Initialization); // set CONFIGURATION mode
CANSetFilterScale32(14, _CAN_FILTER_ENABLED & _CAN_FILTER_ID_MASK_MODE & _CAN_FILTER_XTD_MSG & _CAN_FILTER_USE_FIFO1, ID_2, 0x1F000000 );
CAN2SetOperationMode(_CAN_OperatingMode_Normal);



and I'm using this to send can command:
CAN2Write(TCV_ID[1], CAN2_TCV, 8, CAN2_Send_Flags);

It doesn't work totally. When I use CAN1 - everything works good. Is there any ideas what is the reason of it?

User avatar
petar.timotijevic
mikroElektronika team
Posts: 1739
Joined: 19 Feb 2014 13:46
Location: Serbia
Contact:

Re: CAN2 using problem on stm32f107

#2 Post by petar.timotijevic » 13 Mar 2015 09:31

Hi,

Please can you tell me which version of compiler you have?


Best regards,
Peter

HastyHarry
Posts: 7
Joined: 14 Jan 2015 12:04

Re: CAN2 using problem on stm32f107

#3 Post by HastyHarry » 13 Mar 2015 10:36

I'm using mikroc pro for arm v4.5.0

User avatar
petar.timotijevic
mikroElektronika team
Posts: 1739
Joined: 19 Feb 2014 13:46
Location: Serbia
Contact:

Re: CAN2 using problem on stm32f107

#4 Post by petar.timotijevic » 17 Mar 2015 12:53

Hi HastyHarry,

We will continue a conversation in your ticket at Support Desk.


Best regards,
Peter

HardWareMan
Posts: 57
Joined: 09 Oct 2014 17:39

Re: CAN2 using problem on stm32f107

#5 Post by HardWareMan » 18 Mar 2015 05:25

HastyHarry wrote:I'm using mikroc pro for arm v4.5.0
So why you posting here, in pascal section?

Post Reply

Return to “mikroPascal PRO for ARM General”