mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #15472 from jtmyz9/jmcloud/STM32-use-more-than-one-fifo
Don't overlap STM32 FDCAN RAM sectionspull/15485/head
commit
61ab4f7f76
|
@ -183,8 +183,11 @@ static void _can_init_freq_direct(can_t *obj, const can_pinmap_t *pinmap, int hz
|
||||||
obj->CanHandle.Init.DataTimeSeg1 = 0x1; // Not used - only in FDCAN
|
obj->CanHandle.Init.DataTimeSeg1 = 0x1; // Not used - only in FDCAN
|
||||||
obj->CanHandle.Init.DataTimeSeg2 = 0x1; // Not used - only in FDCAN
|
obj->CanHandle.Init.DataTimeSeg2 = 0x1; // Not used - only in FDCAN
|
||||||
#ifdef TARGET_STM32H7
|
#ifdef TARGET_STM32H7
|
||||||
/* Message RAM offset is only supported in STM32H7 platforms of supported FDCAN platforms */
|
/* Message RAM offset is only supported in STM32H7 platforms of supported FDCAN platforms
|
||||||
obj->CanHandle.Init.MessageRAMOffset = 0;
|
* Total RAM size is 2560 words, each FDCAN object allocates approx 300 words, so offset each by
|
||||||
|
* 512 to make sure RAM sections don't overlap if using multiple FDCAN instances on one chip
|
||||||
|
*/
|
||||||
|
obj->CanHandle.Init.MessageRAMOffset = obj->index * 512;
|
||||||
|
|
||||||
/* The number of Standard and Extended ID filters are initialized to the maximum possile extent
|
/* The number of Standard and Extended ID filters are initialized to the maximum possile extent
|
||||||
* for STM32H7 platforms
|
* for STM32H7 platforms
|
||||||
|
@ -1222,7 +1225,6 @@ static void can_irq(CANName name, int id)
|
||||||
// rx interrupts will be unamsked in read operation. reads must be deffered to thread context.
|
// rx interrupts will be unamsked in read operation. reads must be deffered to thread context.
|
||||||
// refer to the CAN receive interrupt problem due to mutex and resolution section of README doc.
|
// refer to the CAN receive interrupt problem due to mutex and resolution section of README doc.
|
||||||
__HAL_CAN_DISABLE_IT(&CanHandle, CAN_IT_FMP0);
|
__HAL_CAN_DISABLE_IT(&CanHandle, CAN_IT_FMP0);
|
||||||
|
|
||||||
irq_handler(can_irq_contexts[id], IRQ_RX);
|
irq_handler(can_irq_contexts[id], IRQ_RX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue