Menu

#175 Add STM32u5 record into dev_tree

none
New
nobody
None
Medium
Patch
2025-11-07
2025-11-07
Mikhail
No
diff -r stm32flash-0.7/dev_table.c stm32flash-0.7_mod/dev_table.c
26a27
> #define SZ_8K 0x00002000
42a44
> static uint32_t p_8k[]   = { SZ_8K,   0 };
145a148,152
>     /* U5 */
>     {0x455, "STM32U535 / 545"                 , 0x20002000, 0x20030000, 0x08000000, 0x08080000,  1, p_8k  , 0x40022040, 0x40022064, 0x0BF90000, 0x0BF98000, 0}, //not sure about option bytes and PPS field
>     {0x482, "STM32U575 / 585"                 , 0x20002000, 0x20030000, 0x08000000, 0x08200000,  1, p_8k  , 0x40022040, 0x40022064, 0x0BF90000, 0x0BF98000, 0}, //not sure about option bytes and PPS field
>     {0x481, "STM32U59x / 5Ax"                 , 0x20002000, 0x20030000, 0x08000000, 0x08400000,  1, p_8k  , 0x40022040, 0x40022064, 0x0BF90000, 0x0BF98000, 0}, //not sure about option bytes and PPS field
>     {0x476, "STM32U5Fx / 5Gx"                 , 0x20002000, 0x20030000, 0x08000000, 0x08400000,  1, p_8k  , 0x40022040, 0x40022064, 0x0BF90000, 0x0BF98000, 0}, //not sure about option bytes and PPS field

(reading / writing tested on stm32u585ciu6)

Discussion

  • Tormod Volden

    Tormod Volden - 2025-11-07

    Thank so much! Can you please also tell where you have the information from (datasheet revision, other document references) so that it can be double-checked? The option bytes and sectors can be tricky for some systems but it helps to know what your assumptions are based on.

     
  • Tormod Volden

    Tormod Volden - 2025-11-07

    If you look at the latest git version you can see that I already put in placeholders for these chips, with some values filled in. It even has a complete and active (but not verified) entry for the 585xx chips. Some values differ from yours. So we should try to find out which values are best.

     
  • Mikhail

    Mikhail - 2025-11-07

    Sorry, I posted the patch first and only saw the lastest version.
    "Some values differ from yours.":
    ram_start: I don't see much of a difference, your value is a little better
    ram_end: memory is divided into blocks (refman, 2.3.3, Embedded SRAMs). There may be spaces between them. It's probably safer to use only SRAM1. So for 535/545/575/585 -> 0x2000 0000 + 192k = 0x2003 0000. For 59x/5Ax/5Fx/5Gx -> 0x2000 0000 + 768k = 0x200C 0000.
    Anyway, as far as I understand, these addresses are only used for the "secondary bootloader" and the exact values are not too important.
    flash_end. My values are wrong: I only looked at 575. More accurate: 535: 0x08080000 (512k) ; 575: 0x08200000 (2M) ; other: 0x08400000 (4M) (refman, 7.3.1 Flash memory organization)
    Option bytes: incorrect value. I'll try to search better. They say it's loaded from Flash somewhere.
    System memory: same as flash. For example 575. 0x0BF9 0000 - 0x0BF9 7FFF (bootloader) then 0x0BF9 8000 - 0x0BF9 FFFF (empty space?) 0x0BFA 0000 - 0x0BFA 01FF (OTP)

        {0x455, "STM32U535 / 545"                 , 0x20004000, 0x20030000, 0x08000000, 0x08080000,  1, p_8k  , 0         , 0         , 0x0BF90000, 0x0BF98000, 0},
        {0x482, "STM32U575 / 585"                 , 0x20004000, 0x20030000, 0x08000000, 0x08200000,  1, p_8k  , 0         , 0         , 0x0BF90000, 0x0BF98000, 0},
        {0x481, "STM32U59x / 5Ax"                 , 0x20004000, 0x200C0000, 0x08000000, 0x08400000,  1, p_8k  , 0         , 0         , 0x0BF90000, 0x0BF98000, 0},
        {0x476, "STM32U5Fx / 5Gx"                 , 0x20004000, 0x200C0000, 0x08000000, 0x08400000,  1, p_8k  , 0         , 0         , 0x0BF90000, 0x0BF98000, 0},
    
     
  • Mikhail

    Mikhail - 2025-11-07

    The disassembler says that address 0x0bf90000 jumps to 0x0bf99231—into the OTP. So, the OTP is also included in system memory

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB