File tree Expand file tree Collapse file tree 5 files changed +15
-1
lines changed Expand file tree Collapse file tree 5 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -393,6 +393,13 @@ void stm32_main(uint32_t reset_mode) {
393
393
MICROPY_BOARD_EARLY_INIT ();
394
394
395
395
// basic sub-system init
396
+ #if defined(STM32H5 )
397
+ volatile uint32_t * src = (volatile uint32_t * )UID_BASE ;
398
+ uint32_t * dest = (uint32_t * )& mp_hal_unique_id_address [0 ];
399
+ dest [0 ] = src [0 ];
400
+ dest [1 ] = src [1 ];
401
+ dest [2 ] = src [2 ];
402
+ #endif
396
403
#if defined(STM32WB )
397
404
rfcore_init ();
398
405
#endif
Original file line number Diff line number Diff line change 342
342
// Configuration for STM32H5 series
343
343
#elif defined(STM32H5 )
344
344
345
- #define MP_HAL_UNIQUE_ID_ADDRESS (0x20000000) // TODO
345
+ #define MP_HAL_UNIQUE_ID_ADDRESS (mp_hal_unique_id_address)
346
346
#define PYB_EXTI_NUM_VECTORS (58)
347
347
#define MICROPY_HW_MAX_I2C (2) // TODO check
348
348
#define MICROPY_HW_MAX_TIMER (17)
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ const byte mp_hal_status_to_errno_table[4] = {
16
16
[HAL_TIMEOUT ] = MP_ETIMEDOUT ,
17
17
};
18
18
19
+ #if defined(STM32H5 )
20
+ uint8_t mp_hal_unique_id_address [12 ];
21
+ #endif
22
+
19
23
NORETURN void mp_hal_raise (HAL_StatusTypeDef status ) {
20
24
mp_raise_OSError (mp_hal_status_to_errno_table [status ]);
21
25
}
Original file line number Diff line number Diff line change 2
2
#include STM32_HAL_H
3
3
#include "pin.h"
4
4
5
+ extern uint8_t mp_hal_unique_id_address [12 ];
6
+
5
7
// F0-1.9.0+F4-1.16.0+F7-1.7.0+G0-1.5.1+G4-1.3.0+H7-1.6.0+L0-1.11.2+L4-1.17.0+WB-1.10.0+WL-1.1.0
6
8
#if defined(STM32F0 )
7
9
#define MICROPY_PLATFORM_VERSION "HAL1.9.0"
Original file line number Diff line number Diff line change 24
24
* THE SOFTWARE.
25
25
*/
26
26
27
+ #include "py/mphal.h"
27
28
#include "rtc.h"
28
29
#include "rng.h"
29
30
You can’t perform that action at this time.
0 commit comments