2024-07-02 03:27 AM
Hello everyone,
i am trying to read the device unique id of my stm32h7b3 mcu, but get a bus fault on line 2:
uint8_t* uid_base = (uint8_t*) 0x08FFF800;
uint8_t i = uid_base[0];
Do you know what could be the problem ?
Solved! Go to Solution.
2024-11-18 05:41 AM
Hello,
Getting back with analysis of the behavior.
In fact the behavior is expected with STM32H7B/A devices (not the case of STM32H74x/5x/2x/3x), and this is described in the RM0455 / "Single read sequence" section:
Since the UID is located at the address 0x08FFF800 accessed by the CPU over AHB, it could not be accessed with byte but with half-word or word.
From RM0455:
And in your example you're accessing the UID with bytes:
uint8_t* uid_base = (uint8_t*) 0x08FFF800;
uint8_t i = uid_base[0];
2024-07-02 05:10 AM
If i change the pointer to uint16_t* i can read without hardfault. But The reference manual says bytewise reading is possible. What do i wrong? On the stm32h743 i can read it bytewise.
@STOne-32 , @Peter BENSCH
Best regards
2024-07-02 09:03 AM
Hello @aco990 ,
I reproduced the behavior on stm32h7b3 and not on STM32H743.
Question: did you enable the data cache? in that case are you facing the same behavior?
2024-07-02 01:09 PM
The issue is only on the stm32h7b3. The stm32h743 is working fine
No the data cache is not enabled on both mcu
2024-07-03 01:11 AM
Hello,
My comment was to test with Dcache enabled. Do you have the same behavior or not?
2024-08-12 02:37 AM
Hello @SofLit ,
why should i enable the data cache? On the stm32h743 it is working without data cache enabled.
Best regards
2024-08-20 02:05 AM
why should i enable the data cache? On the stm32h743 it is working without data cache enabled.
The idea was just to run a test.
Sorry if you are not cooperative we cannot help you efficiently.
2024-11-18 05:41 AM
Hello,
Getting back with analysis of the behavior.
In fact the behavior is expected with STM32H7B/A devices (not the case of STM32H74x/5x/2x/3x), and this is described in the RM0455 / "Single read sequence" section:
Since the UID is located at the address 0x08FFF800 accessed by the CPU over AHB, it could not be accessed with byte but with half-word or word.
From RM0455:
And in your example you're accessing the UID with bytes:
uint8_t* uid_base = (uint8_t*) 0x08FFF800;
uint8_t i = uid_base[0];