S32DS的s32k146 can程序500K的速率不通问题

坑啊,我把速率调到250K,然后调回500K时,在canCom.c文件中时不会反应的,需要手动改

const flexcan_user_config_t canCom2_InitConfig0 = {
    .fd_enable = false,
    .pe_clock = FLEXCAN_CLK_SOURCE_SOSCDIV2,
    .max_num_mb = 16,
    .num_id_filters = FLEXCAN_RX_FIFO_ID_FILTERS_8,
    .is_rx_fifo_needed = false,
    .flexcanMode = FLEXCAN_NORMAL_MODE,
    .payload = FLEXCAN_PAYLOAD_SIZE_8,
    .bitrate = {
        .propSeg = 7,
        .phaseSeg1 = 4,
        .phaseSeg2 = 1,
        .preDivider = 0,
        .rJumpwidth = 1
    },
    .bitrate_cbt = {
//        .propSeg = 7,
//        .phaseSeg1 = 4,
//        .phaseSeg2 = 1,
//        .preDivider = 0,
//        .rJumpwidth = 1

            .propSeg = 11,
            .phaseSeg1 = 1,
            .phaseSeg2 = 1,
            .preDivider = 0,
            .rJumpwidth = 1
    },
    .transfer_type = FLEXCAN_RXFIFO_USING_INTERRUPTS,
    .rxFifoDMAChannel = 0U
};

注释掉的时自动生成的,

你可能感兴趣的:(踩坑)