2023-05-01 03:54 PM
When I try to read unique device ID register (96 bits) byte by byte I get a hardfault. I can however read it in word by word.
In the reference manual is specified :
"The 96-bit unique device identifier can also be read in single bytes/half-words/words in
different ways and then be concatenated using a custom algorithm."
Does anyone know the reason why it can't be read in single bytes?
I am using STM32H7A3 chip.
Sample code :
uint8_t first_byte = (*((uint8_t*) UID_BASE)); // UID_BASE is 0x08FFF800. This cause a hardfault
uint32_t first_word = (*((uint32_t*) UID_BASE)); // This works fine
Thanks
2023-05-01 04:18 PM
Can't say I've noticed on the H7, on the U5 thing were faulting.
Had issues in the past with DBGMCU area reading the DEVID values, something that breaks the library when checking Step Y vs V functionality.
If you need to process byte-wise, perhaps move to a holding buffer in RAM.
2023-05-01 05:02 PM
Thanks, I tried copying to RAM (word by word) and that works fine. I was just wondering why it can't be read byte by byte when in reference manual is specified that it can.