Skip to content
Discussion options

You must be logged in to vote

Did you check if the MCU is still running? In case you are using the STM32 UniqueID for serial number - reading with enabled ICACHE results in hard fault. For that you need to configure the MPU & read the UID before enabling ICACHE, STM32H5 is special in that regard. https://community.st.com/t5/stm32-mcus/how-to-obtain-and-use-the-stm32-96-bit-uid/ta-p/621443

Follwing will trigger a hard fault:

size_t board_get_unique_id(uint8_t id[], size_t max_len) {
	(void) max_len;
	volatile uint32_t * stm32_uuid = (volatile uint32_t *) UID_BASE;
	uint32_t *id32 = (uint32_t *) (uintptr_t) id;
	uint8_t const len = 12;

	id32[0] = stm32_uuid[0];
	id32[1] = stm32_uuid[1];
	id32[2] = stm32_uuid[2];

	ret…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@1MAFF
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@HiFiPhile
Comment options

@LtBrain
Comment options

Answer selected by LtBrain
@hathach
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants