Skip to main content
Super User
August 20, 2022
Solved

AN2606 pattern 14 ('G4 Cat.3) clarification

  • August 20, 2022
  • 4 replies
  • 1266 views

0693W00000QO7xCQAT.pngAlso, please add the details of bootloader entry through empty FLASH for Cat3. into RM0440.

Thanks,

JW

    This topic has been closed for replies.
    Best answer by KDJEM.1

    Hi @Community member​,

    This typo is fixed in AN2606 Rev 56.

    Thank you.

    Kaouthar

    4 replies

    Technical Moderator
    August 22, 2022

    Hi @Community member​ ,

    I confirm this issue in the Application note AN2606, table 2, pattern 14 the nBoot0(bit) should be 1.

    Internal ticket number: 133433 (This is an internal tracking number and is not accessible or usable by customers).

     

    Could you please tell us what you expect as "details of bootloader entry through empty FLASH for Cat3. into RM0440�?.

    Thanks for your contribution.

    Kaouthar

    KDJEM.1Answer
    Technical Moderator
    December 22, 2022

    Hi @Community member​,

    This typo is fixed in AN2606 Rev 56.

    Thank you.

    Kaouthar

    Super User
    December 22, 2022

    Hi Kaouthar,

    Thanks for letting me know.

    Please forward my thanks to the crew who maintain AN2606.

    Jan

    Super User
    August 22, 2022

    Hi Kaouthar,

    > Could you please tell us what you expect as "details of bootloader entry through empty FLASH for Cat3. into RM0440�?.

    0693W00000QOE7SQAX.png 

    0693W00000QOE8QQAX.png 

    JW

    @KDJEM.1​ 

    ST Employee
    August 23, 2022

    Hi @waclawek.jan (Community Member)​ ,

    There is no empty check mechanism in STM32G4 devices.

    But if option bit BFB2 = 1 (boot from Bank2 is requested) then embedded bootloader always started and before jumping to Bank 2 it checks if code in Bank2 is valid. If not then it check Bank 1 code - and if not valid then code stays in the bootloader. But this is valid only for BFB2 = 1 : the valid code in Banks is checked by bootloader code.

    Regards

    Igor

    Super User
    August 23, 2022

    Ahoj Igor,

    Thanks for the explanation.

    Your description appears to imply, that if BLB2=1, hardware maps the System memory to address 0. The bootloader might've remapped it when it detects "valid code" in either bank, but it apparently does not do it, as witnessed by footnote to SYSCFG_MEMRMP.MEM_MODE description:

    1.When BFB2 bit is set, the system memory remains aliased at @0x0000 0000

    IMO, this should be added - maybe also as a footnote - to Table 5. Boot modes.

    The reason is, that the combination of default VTOR=0 and System memory mapped at 0 causes the users to complain of "my code crashes at 0x1fffxxxx", which we see here quite often.

    ---

    Also, RM0440 for the Cat.3 'G4 says:

    Supports dual boot mode thanks to the BFB2 option bit (only in dual bank mode)

    (emphasis mine). So, for the process you've described to work, is it necessary to program also to have DBANK=1, or will it work also when BFB=1 and DBANK=0?

    ---

    It would be also nice, if AN2606 would be clear about what does "valid code" (and "Flash memory empty" in case of Patterns 6, 11, 13) exactly mean. I know the information is out there, if one searches well, but it would be nice to see it at the description of the Patterns, maybe as a footnote; or alternatively in the individual devices' chapters.

    Thanks,

    Jan