STM32F103C8T6 "0x00200000U" HAL_CAN_ERROR_PARAM

I am trying to create a can-bus communication network between F103C8T6 and F334F8 with MCP2551 but I cannot send messages. After 3 times of calling HAL_CAN_AddTxMessage communication fails. I debugged the code and I get an error which is HAL_CAN_ERROR_PARAM caused by HAL_CAN_AddTxMessage.

My Schematic is as follows

https://i.stack.imgur.com/UBxsB.jpg

I use a button interrupt to start a timer which has also an interrupt every 1 second, I do my CAN_Tx there.

Both of my boards run at 72Mhz, quantas are configured carefully.

These are my CAN Configurations for F334R8:

void CAN_Tx(void){


    CAN_TxHeaderTypeDef TxHeader;

        uint32_t TxMailbox;

        uint8_t message;

        TxHeader.DLC = 1;
        TxHeader.StdId = 0x65D;
        TxHeader.IDE   = CAN_ID_STD;
        TxHeader.RTR = CAN_RTR_DATA;


        message = ++led_no;

        if(led_no == 4)
        {
            led_no = 0;
        }

        HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_5);

        if( HAL_CAN_AddTxMessage(&hcan,&TxHeader,&message,&TxMailbox) != HAL_OK)
        {
            Error_handler();
        }
}



void CAN_Rx(void){

}

void CAN_Filter_Config(void)
{
    CAN_FilterTypeDef can1_filter_init;

        can1_filter_init.FilterActivation = ENABLE;
        can1_filter_init.FilterBank  = 2;
        can1_filter_init.FilterFIFOAssignment = CAN_RX_FIFO0;
        can1_filter_init.FilterIdHigh = 0x0000;
        can1_filter_init.FilterIdLow = 0x0000;
        can1_filter_init.FilterMaskIdHigh = 0X01C0;
        can1_filter_init.FilterMaskIdLow = 0x0000;
        can1_filter_init.FilterMode = CAN_FILTERMODE_IDMASK;
        can1_filter_init.FilterScale = CAN_FILTERSCALE_32BIT;

        if( HAL_CAN_ConfigFilter(&hcan,&can1_filter_init) != HAL_OK)
        {
            Error_handler();
        }
}

void CAN_Init(void){

        hcan.Instance = CAN;
        hcan.Init.Mode = CAN_MODE_NORMAL;
        hcan.Init.AutoBusOff = ENABLE;
        hcan.Init.AutoRetransmission = ENABLE;
        hcan.Init.AutoWakeUp = DISABLE;
        hcan.Init.ReceiveFifoLocked = DISABLE;
        hcan.Init.TimeTriggeredMode = DISABLE;
        hcan.Init.TransmitFifoPriority = DISABLE;

        //Setting up the bit timing
        hcan.Init.Prescaler = 9;
        hcan.Init.TimeSeg1 = CAN_BS1_13TQ;
        hcan.Init.TimeSeg2 = CAN_BS2_2TQ;
        hcan.Init.SyncJumpWidth = CAN_SJW_2TQ;

    if(HAL_CAN_Init(&hcan) != HAL_OK){
        Error_handler();
    }

}


void GPIO_Init(void)
{

    //Enabling the clocks
    __HAL_RCC_GPIOA_CLK_ENABLE();
    __HAL_RCC_GPIOC_CLK_ENABLE();

    //LED ON N1 BOARD PA5
    GPIO_InitTypeDef gpioinit;
    gpioinit.Pin = GPIO_PIN_5;
    gpioinit.Mode = GPIO_MODE_OUTPUT_PP;
    gpioinit.Pull = GPIO_NOPULL;
    HAL_GPIO_Init(GPIOA,&gpioinit);


    //Node 1, blue button on the board
    /*
     * PC13 = BUTTON
     *
     * */
    gpioinit.Pin = GPIO_PIN_13;
    gpioinit.Mode = GPIO_MODE_IT_FALLING;
    gpioinit.Pull = GPIO_NOPULL;
    HAL_GPIO_Init(GPIOC,&gpioinit);

    HAL_NVIC_EnableIRQ(EXTI15_10_IRQn); // Enable the interrupt request for the button.

}


void CAN_TX_IRQHandler(void)
{
    HAL_CAN_IRQHandler(&hcan);
}

void CAN_RX0_IRQHandler(void)
{
    HAL_CAN_IRQHandler(&hcan);

}

void CAN_SCE_IRQHandler(void)
{
    HAL_CAN_IRQHandler(&hcan);
}


void HAL_CAN_MspInit(CAN_HandleTypeDef *hcan)
 {


     GPIO_InitTypeDef GPIO_InitStruct;

        __HAL_RCC_CAN1_CLK_ENABLE();

        /**CAN1 GPIO Configuration
        PA11     ------> CAN1_RX
        PA12     ------> CAN1_TX
        */
        GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12;
        GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
        GPIO_InitStruct.Pull = GPIO_NOPULL;
        GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
        GPIO_InitStruct.Alternate = GPIO_AF9_CAN;
        HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

        HAL_NVIC_SetPriority(CAN_TX_IRQn,15,0);
        HAL_NVIC_SetPriority(CAN_RX0_IRQn,15,0);
        HAL_NVIC_SetPriority(CAN_RX1_IRQn,15,0);
        HAL_NVIC_SetPriority(CAN_SCE_IRQn,15,0);

        HAL_NVIC_EnableIRQ(CAN_TX_IRQn);
        HAL_NVIC_EnableIRQ(CAN_RX0_IRQn);
        HAL_NVIC_EnableIRQ(CAN_RX1_IRQn);
        HAL_NVIC_EnableIRQ(CAN_SCE_IRQn);


 }


int main(void)
{

        HAL_Init();

        SystemClock_Config(SYS_CLOCK_FREQ_72MHZ);

        GPIO_Init();

        UART2_Init();

        TIMER6_Init();

        CAN_Init();

        CAN_Filter_Config();

        if(HAL_CAN_ActivateNotification(&hcan,CAN_IT_TX_MAILBOX_EMPTY|CAN_IT_RX_FIFO0_MSG_PENDING|CAN_IT_BUSOFF)!= HAL_OK)
        {
                Error_handler();
        }


        if( HAL_CAN_Start(&hcan) != HAL_OK)
        {
            Error_handler();
        }


        newline();

        while(1);

        return 0;
}


void HAL_CAN_TxMailbox0CompleteCallback(CAN_HandleTypeDef *hcan)
{
        char msg[50];
        sprintf(msg,"Message Transmitted:M0\r\n");
        HAL_UART_Transmit(&huart2,(uint8_t*)msg,strlen(msg),HAL_MAX_DELAY);


}

void HAL_CAN_TxMailbox1CompleteCallback(CAN_HandleTypeDef *hcan)
{
        char msg[50];
        sprintf(msg,"Message Transmitted:M1\r\n");
        HAL_UART_Transmit(&huart2,(uint8_t*)msg,strlen(msg),HAL_MAX_DELAY);

}

void HAL_CAN_TxMailbox2CompleteCallback(CAN_HandleTypeDef *hcan)

{
        char msg[50];
        sprintf(msg,"Message Transmitted:M2\r\n");
        HAL_UART_Transmit(&huart2,(uint8_t*)msg,strlen(msg),HAL_MAX_DELAY);
}

void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan)
{

    uint8_t rcvd_msg[8];

        char msg[50];

        if(HAL_CAN_GetRxMessage(hcan,CAN_RX_FIFO0,&RxHeader,rcvd_msg) != HAL_OK)
        {
            Error_handler();
        }

        if( RxHeader.StdId == 0x651 && RxHeader.RTR == 0)
        {
            //its a reply ( data frame) by n2 to n1
            sprintf(msg,"Reply Received : %#X\r\n",rcvd_msg[0] << 8 | rcvd_msg[1]);
        }

         HAL_UART_Transmit(&huart2,(uint8_t*)msg,strlen(msg),HAL_MAX_DELAY);

}

void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan)
{
    print("Can Error Detected.");

}

This issue occurs on my other board, F103C8T6, too.

Thanks for your help.