Skip to content

Commit 995594b

Browse files
kevinong0108Cruz Monrreal II
authored andcommitted
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.
1 parent 603b8e6 commit 995594b

File tree

1 file changed

+17
-24
lines changed

1 file changed

+17
-24
lines changed

targets/TARGET_STM/mbed_crc_api.c

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ static uint32_t final_xor;
1010
static uint32_t crc_mask;
1111

1212
/* STM32 CRC preipheral features
13-
+-------------------------+-----------------------+---------------+---------------+
14-
| Feature | F1/L1/F2/F4 series | F0 series | L0/F3/L4/F7 |
15-
+-========================+=======================+===============+===============+
13+
+-------------------------+-----------------------+-------------------------------+
14+
| Feature | F1/L1/F2/F4 series | F0/L0/F3/L4/F7/H7 or newer |
15+
+-========================+=======================+===============================+
1616
| Reversibility option | NO | YES |
1717
| on I/O data | | |
18-
+-------------------------+-----------------------+---------------+---------------+
19-
| CRC initial Value | Fixed to 0xFFFFFFFF | Programmable | Programmable |
20-
| | | on 32 bits | on 8,16,32 |
21-
+-------------------------+-----------------------+---------------+---------------+
22-
| Handled data size in bit| 32 | 8,16,32 |
23-
+-------------------------+---------------------------------------+---------------+
24-
| Polynomial size in bit | 32 | 7,8,16,32 |
25-
+-------------------------+---------------------------------------+---------------+
26-
| Polynomial coefficients | Fixed to 0x4C11DB7 | Programmable |
27-
+-------------------------+---------------------------------------+---------------+
18+
+-------------------------+-----------------------+-------------------------------+
19+
| CRC initial Value | Fixed to 0xFFFFFFFF | Programmable on 8, 16, 32 |
20+
| | | bits |
21+
+-------------------------+-----------------------+-------------------------------+
22+
| Handled data size in bit| 32 | 8, 16, 32 |
23+
+-------------------------+-----------------------+-------------------------------+
24+
| Polynomial size in bit | 32 | 7, 8, 16, 32 |
25+
+-------------------------+-----------------------+-------------------------------+
26+
| Polynomial coefficients | Fixed to 0x4C11DB7 | Programmable |
27+
+-------------------------+-----------------------+-------------------------------+
2828
*/
2929
bool hal_crc_is_supported(const crc_mbed_config_t *config)
3030
{
@@ -33,22 +33,15 @@ bool hal_crc_is_supported(const crc_mbed_config_t *config)
3333
}
3434

3535
#if defined(TARGET_STM32F1) || defined(TARGET_STM32F2) || defined(TARGET_STM32F4) || defined(TARGET_STM32L1)
36-
if (config->width != 32 || config->polynomial != POLY_32BIT_ANSI ||
37-
config->initial_xor != 0xFFFFFFFF || config->reflect_in || config->reflect_out) {
38-
return false;
39-
}
40-
#elif defined(TARGET_STM32F0)
41-
if (config->width != 32 || config->polynomial != POLY_32BIT_ANSI) {
42-
return false;
43-
}
36+
/* Currently, mbed supported input data format fix on bytes,
37+
so those devices are not supported at default. */
38+
return false;
4439
#else
45-
/* Fully function support on L0, F3, L4, F7, H7 and newer series */
4640
if (config->width != 32 && config->width != 16 && config->width != 8 && config->width != 7) {
4741
return false;
4842
}
49-
#endif
50-
5143
return true;
44+
#endif
5245
}
5346

5447
static uint32_t get_crc_mask(int width)

0 commit comments

Comments
 (0)