stm32: F1/F2/F4/L1 set to not supported HW CRC

Currently, mbed supported input data format fix on bytes, so those
devices are not supported at default.
pull/9507/head
kevin.ong 2019-01-12 01:50:06 +08:00 committed by adbridge
parent 38e1152eea
commit 56e488a2fd
1 changed files with 17 additions and 24 deletions

View File

@ -10,21 +10,21 @@ static uint32_t final_xor;
static uint32_t crc_mask; static uint32_t crc_mask;
/* STM32 CRC preipheral features /* STM32 CRC preipheral features
+-------------------------+-----------------------+---------------+---------------+ +-------------------------+-----------------------+-------------------------------+
| Feature | F1/L1/F2/F4 series | F0 series | L0/F3/L4/F7 | | Feature | F1/L1/F2/F4 series | F0/L0/F3/L4/F7/H7 or newer |
+-========================+=======================+===============+===============+ +-========================+=======================+===============================+
| Reversibility option | NO | YES | | Reversibility option | NO | YES |
| on I/O data | | | | on I/O data | | |
+-------------------------+-----------------------+---------------+---------------+ +-------------------------+-----------------------+-------------------------------+
| CRC initial Value | Fixed to 0xFFFFFFFF | Programmable | Programmable | | CRC initial Value | Fixed to 0xFFFFFFFF | Programmable on 8, 16, 32 |
| | | on 32 bits | on 8,16,32 | | | | bits |
+-------------------------+-----------------------+---------------+---------------+ +-------------------------+-----------------------+-------------------------------+
| Handled data size in bit| 32 | 8,16,32 | | Handled data size in bit| 32 | 8, 16, 32 |
+-------------------------+---------------------------------------+---------------+ +-------------------------+-----------------------+-------------------------------+
| Polynomial size in bit | 32 | 7,8,16,32 | | Polynomial size in bit | 32 | 7, 8, 16, 32 |
+-------------------------+---------------------------------------+---------------+ +-------------------------+-----------------------+-------------------------------+
| Polynomial coefficients | Fixed to 0x4C11DB7 | Programmable | | Polynomial coefficients | Fixed to 0x4C11DB7 | Programmable |
+-------------------------+---------------------------------------+---------------+ +-------------------------+-----------------------+-------------------------------+
*/ */
bool hal_crc_is_supported(const crc_mbed_config_t *config) bool hal_crc_is_supported(const crc_mbed_config_t *config)
{ {
@ -33,22 +33,15 @@ bool hal_crc_is_supported(const crc_mbed_config_t *config)
} }
#if defined(TARGET_STM32F1) || defined(TARGET_STM32F2) || defined(TARGET_STM32F4) || defined(TARGET_STM32L1) #if defined(TARGET_STM32F1) || defined(TARGET_STM32F2) || defined(TARGET_STM32F4) || defined(TARGET_STM32L1)
if (config->width != 32 || config->polynomial != POLY_32BIT_ANSI || /* Currently, mbed supported input data format fix on bytes,
config->initial_xor != 0xFFFFFFFF || config->reflect_in || config->reflect_out) { so those devices are not supported at default. */
return false; return false;
}
#elif defined(TARGET_STM32F0)
if (config->width != 32 || config->polynomial != POLY_32BIT_ANSI) {
return false;
}
#else #else
/* Fully function support on L0, F3, L4, F7, H7 and newer series */
if (config->width != 32 && config->width != 16 && config->width != 8 && config->width != 7) { if (config->width != 32 && config->width != 16 && config->width != 8 && config->width != 7) {
return false; return false;
} }
#endif
return true; return true;
#endif
} }
static uint32_t get_crc_mask(int width) static uint32_t get_crc_mask(int width)