cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429 / STM32G491 What is the difference in external loader?

LehuW
Associate II

Hi,

I can't get the external loader to work in STM32G491.
For the test, I replaced the bodies of the Init()/Erase()/Write() function with LED blinking. I did this to check if the functions are called correctly. For debugging, I used STM32_Programmer_CLI to check the writing of single bytes.

If I try to write the STM32F429 I get this log.

19:50:54:384       -------------------------------------------------------------------
19:50:54:384                        STM32CubeProgrammer v2.9.0                  
19:50:54:384       -------------------------------------------------------------------

19:50:54:384 

19:50:54:388 Log output file:   !log.txt
19:50:54:390 Command line:  -log !log.txt
19:50:54:390 
19:50:54:395 
Operation [2]: -vb 3 

19:50:54:406 
Operation [3]: -c  port=swd freq=500 reset=HWrst 

19:50:54:447 ST-LINK SN  : 55FF67065065565040110987
19:50:54:450 ST-LINK FW  : V2J45S0
19:50:54:453 Board       : --
19:50:54:455 Voltage     : 2.92V
19:50:54:481 SWD freq    : 480 KHz
19:50:54:484 Connect mode: Under Reset
19:50:54:486 Reset mode  : Hardware reset
19:50:54:491 Device ID   : 0x419
19:50:54:495 Revision ID : Rev Y
19:50:54:530 Reading data...
19:50:54:536 r ap 0 @0x40023C14 0x00000004 bytes Data 0x0FFFAAED
19:50:54:539 Reading data...
19:50:54:542 r ap 0 @0x1FFF7A22 0x00000004 bytes Data 0xFFFF0800
19:50:54:545 Database: Config 0 is active.
19:50:54:547 flash loader C:/STM32CubeProgrammer/bin/FlashLoader/0x419.stldr is loaded
19:50:54:552 Reading data...
19:50:54:557 r ap 0 @0x40023C14 0x00000004 bytes Data 0x0FFFAAED
19:50:54:559 Reading data...
19:50:54:563 r ap 0 @0x1FFF7A22 0x00000004 bytes Data 0xFFFF0800
19:50:54:565 Database: Config 0 is active.
19:50:54:567 Device name : STM32F42xxx/F43xxx
19:50:54:572 Reading data...
19:50:54:574 r ap 0 @0x1FFF7A22 0x00000004 bytes Data 0xFFFF0800
19:50:54:577 Flash size  : 2 MBytes
19:50:54:579 Device type : MCU
19:50:54:582 Device CPU  : Cortex-M4
19:50:54:585 BL Version  : 0x70
19:50:54:590 
19:50:54:591 
Operation [4]: -el "c:\STM32CubeProgrammer\bin\ExternalLoader\F429_EXL.stldr" 

19:50:54:603 external loader c:\STM32CubeProgrammer\bin\ExternalLoader\F429_EXL.stldr is loaded
19:50:54:614 
Operation [5]: -w8 0x90000000 0xAA 0xBB 0x55 0xCC 0x11 0x22 0x33 

19:50:54:627 
Downloading 8-bit data...

19:50:54:631 Buffer program...
19:50:54:637 halt ap 0 
19:50:54:637 w ap 0 reg 15 PC   (0x20000000)  
19:50:54:642 w ap 0 reg 17 MSP  (0x20000500)  
19:50:54:647 w ap 0 reg 16 xPSR (0x01000000)  
19:50:54:669 w ap 0 @0x20008360 : 0x00000200 bytes, Data 0x00000000...
19:50:54:674 w ap 0 @0x20000000 : 0x00000004 bytes, Data 0x0000BE00...
19:50:55:684 w ap 0 @0x20000004 : 0x00007F28 bytes, Data 0x00000000...
19:50:55:698 Loader write range...
19:50:55:700 w ap 0 @0x20008360 : 0x00000008 bytes, Data 0xCC55BBAA...
19:50:55:705 W B1 in RAM @0x20008360 size 0x00000008 : 0005ms
19:50:55:708 Init flashloader...
19:50:55:711 halt ap 0 
19:50:55:714 w ap 0 reg 0 R0   0x00000001
19:50:55:722 w ap 0 reg 1 R1   0x00000000
19:50:55:743 w ap 0 reg 2 R2   0x00000000
19:50:55:751 w ap 0 reg 3 R3   0x00000000
19:50:55:757 w ap 0 reg 4 R4   0x00000000
19:50:55:760 w ap 0 reg 5 R5   0x00000000
19:50:55:765 w ap 0 reg 6 R6   0x00000000
19:50:55:770 w ap 0 reg 7 R7   0x00000000
19:50:55:774 w ap 0 reg 8 R8   0x00000000
19:50:55:777 w ap 0 reg 9 R9   0x00000000
19:50:55:781 w ap 0 reg 10 R10  0x00000000
19:50:55:785 w ap 0 reg 11 R11  0x00000000
19:50:55:789 w ap 0 reg 12 R12  0x00000000
19:50:55:793 w ap 0 reg 13 SP   0x00000000
19:50:55:796 w ap 0 reg 14 LR   0x20000001
19:50:55:801 w ap 0 reg 15 PC   0x20000985
19:50:55:805 w ap 0 reg 16 xPSR 0x01000000
19:50:55:808 w ap 0 reg 17 MSP  0x20008328
19:50:55:813 w ap 0 reg 18 PSP  0x00000000
19:50:55:817 run ap 0 
19:50:57:748 halt ap 0 
19:50:57:754 r ap 0 reg 0 R0   0x00000001
19:50:57:760 w ap 0 reg 0 R0   0x90000000
19:50:57:765 w ap 0 reg 1 R1   0x00000008
19:50:57:770 w ap 0 reg 2 R2   0x20008360
19:50:57:774 w ap 0 reg 3 R3   0x00000002
19:50:57:779 w ap 0 reg 4 R4   0x00000000
19:50:57:784 w ap 0 reg 5 R5   0x00000000
19:50:57:788 w ap 0 reg 6 R6   0x00000000
19:50:57:792 w ap 0 reg 7 R7   0x00000000
19:50:57:796 w ap 0 reg 8 R8   0x00000000
19:50:57:804 w ap 0 reg 9 R9   0x00000000
19:50:57:809 w ap 0 reg 10 R10  0x00000000
19:50:57:814 w ap 0 reg 11 R11  0x00000000
19:50:57:819 w ap 0 reg 12 R12  0x00000000
19:50:57:823 w ap 0 reg 13 SP   0x00000000
19:50:57:827 w ap 0 reg 14 LR   0x20000001
19:50:57:831 w ap 0 reg 15 PC   0x20000A25
19:50:57:837 w ap 0 reg 16 xPSR 0x01000000
19:50:57:841 w ap 0 reg 17 MSP  0x20008328
19:50:57:845 w ap 0 reg 18 PSP  0x00000000
19:50:57:848 run ap 0 
19:50:58:966 r ap 0 reg 0 R0   0x00000001
19:50:58:970 Write elapsed time: 3270ms
19:50:58:971 Reading data...

If I try to write the STM32G491 I get this log.

19:54:29:059       -------------------------------------------------------------------
19:54:29:059                        STM32CubeProgrammer v2.9.0                  
19:54:29:059       -------------------------------------------------------------------

19:54:29:060 

19:54:29:062 Log output file:   !log.txt
19:54:29:065 Command line:  -log !log.txt
19:54:29:065 
19:54:29:070 
Operation [2]: -vb 3 

19:54:29:082 
Operation [3]: -c  port=swd freq=500 reset=HWrst 

19:54:29:176 ST-LINK SN  : 50FF71064977535538100587
19:54:29:181 ST-LINK FW  : V2J45S7
19:54:29:184 Board       : --
19:54:29:186 Voltage     : 3.22V
19:54:29:213 SWD freq    : 480 KHz
19:54:29:216 Connect mode: Under Reset
19:54:29:217 Reset mode  : Hardware reset
19:54:29:222 Device ID   : 0x479
19:54:29:228 Revision ID : Rev Z
19:54:29:246 Reading data...
19:54:29:249 r ap 0 @0x1FFF75E0 0x00000004 bytes Data 0xFFFF0200
19:54:29:251 Database: Config 0 is active.
19:54:29:255 flash loader C:/STM32CubeProgrammer/bin/FlashLoader/0x479.stldr is loaded
19:54:29:262 Reading data...
19:54:29:265 r ap 0 @0x1FFF75E0 0x00000004 bytes Data 0xFFFF0200
19:54:29:267 Database: Config 0 is active.
19:54:29:270 Device name : STM32G491xx
19:54:29:271 Reading data...
19:54:29:273 r ap 0 @0x1FFF75E0 0x00000004 bytes Data 0xFFFF0200
19:54:29:277 Flash size  : 512 KBytes
19:54:29:279 Device type : MCU
19:54:29:280 Device CPU  : Cortex-M4
19:54:29:283 BL Version  : 0xD2
19:54:29:287 
19:54:29:288 
Operation [4]: -el "c:\STM32CubeProgrammer\bin\ExternalLoader\F429_EXL.stldr" 

19:54:29:299 external loader c:\STM32CubeProgrammer\bin\ExternalLoader\F429_EXL.stldr is loaded
19:54:29:312 
Operation [5]: -w8 0x90000000 0xAA 0xBB 0x55 0xCC 0x11 0x22 0x33 

19:54:29:322 
Downloading 8-bit data...

19:54:29:326 Buffer program...
19:54:29:333 halt ap 0 
19:54:29:334 w ap 0 reg 15 PC   (0x20000000)  
19:54:29:339 w ap 0 reg 17 MSP  (0x20000500)  
19:54:29:346 w ap 0 reg 16 xPSR (0x01000000)  
19:54:29:351 Loader write range...


What does this mean?
Does STM32_Programmer not loading the external loader into RAM?
Does the processor not executing the run command?
Does the processor have interrupts disabled ?


I am using STM32CubeIDE Version: 1.17.0

I need external loader for TouchGfx in configuration W25Q128VS (QSPI mode) + STM32G491RE

 

4 REPLIES 4

Does it load MT25QL512ABB_STM32G474E-EVAL.stldr ?

https://community.st.com/t5/stm32-mcus-embedded-software/stm32g491-does-not-start-from-ram-in-debug-mode-external-loader/td-p/755895

Your configuration

PA3:AF10 CLK

PA2:AF10 NCS

PB1:AF10 IO0

PB0:AF10 IO1

PA7:AF10 IO2

PA6:AF10 IO3

Do you have a serial port?

PD2 GPIO LED ?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you for the reply.

>> Does it load MT25QL512ABB_STM32G474E-EVAL.stldr ?
Yes. Log attached below.

 

QSPI config exactly as you wrote.

 

>> Do you have a serial port?

I have UART3 PB10:TX, PB11:RX  (and RS485 USART1; PC4:TX; PC5:RX, PA12:DE).

 

>> PD2 GPIO LED ?

Yes.

 

Below log from loading MT25QL512ABB_STM32G474E-EVAL.stldr

22:01:39:919       -------------------------------------------------------------------
22:01:39:919                        STM32CubeProgrammer v2.9.0                  
22:01:39:919       -------------------------------------------------------------------

22:01:39:919 

22:01:39:924 Log output file:   !log.txt
22:01:39:929 Command line:  -log !log.txt
22:01:39:929 
22:01:39:934 
Operation [2]: -vb 3 

22:01:39:947 
Operation [3]: -c  port=swd freq=500 reset=HWrst 

22:01:39:990 ST-LINK SN  : 50FF71064977535538100587
22:01:39:994 ST-LINK FW  : V2J45S7
22:01:39:998 Board       : --
22:01:40:000 Voltage     : 3.22V
22:01:40:027 SWD freq    : 480 KHz
22:01:40:033 Connect mode: Under Reset
22:01:40:035 Reset mode  : Hardware reset
22:01:40:040 Device ID   : 0x479
22:01:40:044 Revision ID : Rev Z
22:01:40:059 Reading data...
22:01:40:067 r ap 0 @0x1FFF75E0 0x00000004 bytes Data 0xFFFF0200
22:01:40:071 Database: Config 0 is active.
22:01:40:076 flash loader C:/STM32CubeProgrammer/bin/FlashLoader/0x479.stldr is loaded
22:01:40:083 Reading data...
22:01:40:084 r ap 0 @0x1FFF75E0 0x00000004 bytes Data 0xFFFF0200
22:01:40:089 Database: Config 0 is active.
22:01:40:094 Device name : STM32G491xx
22:01:40:098 Reading data...
22:01:40:103 r ap 0 @0x1FFF75E0 0x00000004 bytes Data 0xFFFF0200
22:01:40:108 Flash size  : 512 KBytes
22:01:40:109 Device type : MCU
22:01:40:116 Device CPU  : Cortex-M4
22:01:40:123 BL Version  : 0xD2
22:01:40:129 
22:01:40:133 
Operation [4]: -el "c:\STM32CubeProgrammer\bin\ExternalLoader\MT25QL512ABB_STM32G474E-EVAL.stldr" 

22:01:40:144 external loader c:\STM32CubeProgrammer\bin\ExternalLoader\MT25QL512ABB_STM32G474E-EVAL.stldr is loaded
22:01:40:156 
Operation [5]: -w8 0x90000000 0xAA 0xBB 0x55 0xCC 0x11 0x22 0x33 

22:01:40:167 
Downloading 8-bit data...

22:01:40:173 Buffer program...
22:01:40:184 halt ap 0 
22:01:40:185 w ap 0 reg 15 PC   (0x20000000)  
22:01:40:193 w ap 0 reg 17 MSP  (0x20000500)  
22:01:40:199 w ap 0 reg 16 xPSR (0x01000000)  
22:01:40:221 w ap 0 @0x200036A0 : 0x00000200 bytes, Data 0x00000000...
22:01:40:225 w ap 0 @0x20000000 : 0x00000004 bytes, Data 0x0000BE00...
22:01:40:640 w ap 0 @0x20000004 : 0x00003274 bytes, Data 0x20000001...
22:01:40:658 Loader write range...
22:01:40:661 w ap 0 @0x200036A0 : 0x00000008 bytes, Data 0xCC55BBAA...
22:01:40:665 W B1 in RAM @0x200036A0 size 0x00000008 : 0005ms
22:01:40:670 Init flashloader...
22:01:40:672 halt ap 0 
22:01:40:676 w ap 0 reg 0 R0   0x00000001
22:01:40:683 w ap 0 reg 1 R1   0x00000000
22:01:40:687 w ap 0 reg 2 R2   0x00000000
22:01:40:691 w ap 0 reg 3 R3   0x00000000
22:01:40:696 w ap 0 reg 4 R4   0x00000000
22:01:40:701 w ap 0 reg 5 R5   0x00000000
22:01:40:706 w ap 0 reg 6 R6   0x00000000
22:01:40:710 w ap 0 reg 7 R7   0x00000000
22:01:40:715 w ap 0 reg 8 R8   0x00000000
22:01:40:719 w ap 0 reg 9 R9   0x00000000
22:01:40:723 w ap 0 reg 10 R10  0x00000000
22:01:40:726 w ap 0 reg 11 R11  0x00000000
22:01:40:731 w ap 0 reg 12 R12  0x00000000
22:01:40:734 w ap 0 reg 13 SP   0x00000000
22:01:40:738 w ap 0 reg 14 LR   0x20000001
22:01:40:742 w ap 0 reg 15 PC   0x2000000F
22:01:40:750 w ap 0 reg 16 xPSR 0x01000000
22:01:40:768 w ap 0 reg 17 MSP  0x20003674
22:01:40:774 w ap 0 reg 18 PSP  0x00000000
22:01:40:776 run ap 0 
22:01:40:785 halt ap 0 
22:01:40:788 r ap 0 reg 0 R0   0x00000001
22:01:40:795 w ap 0 reg 0 R0   0x90000000
22:01:40:799 w ap 0 reg 1 R1   0x00000008
22:01:40:803 w ap 0 reg 2 R2   0x200036A0
22:01:40:807 w ap 0 reg 3 R3   0x00000002
22:01:40:812 w ap 0 reg 4 R4   0x00000000
22:01:40:817 w ap 0 reg 5 R5   0x00000000
22:01:40:822 w ap 0 reg 6 R6   0x00000000
22:01:40:827 w ap 0 reg 7 R7   0x00000000
22:01:40:834 w ap 0 reg 8 R8   0x00000000
22:01:40:839 w ap 0 reg 9 R9   0x00000000
22:01:40:843 w ap 0 reg 10 R10  0x00000000
22:01:40:848 w ap 0 reg 11 R11  0x00000000
22:01:40:851 w ap 0 reg 12 R12  0x00000000
22:01:40:856 w ap 0 reg 13 SP   0x00000000
22:01:40:861 w ap 0 reg 14 LR   0x20000001
22:01:40:866 w ap 0 reg 15 PC   0x20000065
22:01:40:870 w ap 0 reg 16 xPSR 0x01000000
22:01:40:874 w ap 0 reg 17 MSP  0x20003674
22:01:40:881 w ap 0 reg 18 PSP  0x00000000
22:01:40:883 run ap 0 
22:01:40:893 r ap 0 reg 0 R0   0x00000001
22:01:40:897 Write elapsed time: 0236ms
22:01:40:899 Reading data...
22:01:40:910 halt ap 0 
22:01:40:914 w ap 0 reg 15 PC   (0x20000000)  
22:01:40:919 w ap 0 reg 17 MSP  (0x20000500)  
22:01:40:922 w ap 0 reg 16 xPSR (0x01000000)  
22:01:40:944 w ap 0 @0x200036A0 : 0x00000200 bytes, Data 0x00000000...
22:01:40:950 w ap 0 @0x20000000 : 0x00000004 bytes, Data 0x0000BE00...
22:01:41:359 w ap 0 @0x20000004 : 0x00003274 bytes, Data 0x20000001...
22:01:41:380 halt ap 0 
22:01:41:381 w ap 0 reg 15 PC   (0x20000000)  
22:01:41:387 w ap 0 reg 17 MSP  (0x20000500)  
22:01:41:393 w ap 0 reg 16 xPSR (0x01000000)  
22:01:41:415 w ap 0 @0x200036A0 : 0x00000200 bytes, Data 0x00000000...
22:01:41:421 w ap 0 @0x20000000 : 0x00000004 bytes, Data 0x0000BE00...
22:01:41:830 w ap 0 @0x20000004 : 0x00003274 bytes, Data 0x20000001...
22:01:41:844 Init flashloader...
22:01:41:847 halt ap 0 
22:01:41:851 w ap 0 reg 0 R0   0x00000000
22:01:41:855 w ap 0 reg 1 R1   0x00000000
22:01:41:860 w ap 0 reg 2 R2   0x00000000
22:01:41:865 w ap 0 reg 3 R3   0x00000000
22:01:41:868 w ap 0 reg 4 R4   0x00000000
22:01:41:873 w ap 0 reg 5 R5   0x00000000
22:01:41:876 w ap 0 reg 6 R6   0x00000000
22:01:41:881 w ap 0 reg 7 R7   0x00000000
22:01:41:885 w ap 0 reg 8 R8   0x00000000
22:01:41:888 w ap 0 reg 9 R9   0x00000000
22:01:41:898 w ap 0 reg 10 R10  0x00000000
22:01:41:904 w ap 0 reg 11 R11  0x00000000
22:01:41:908 w ap 0 reg 12 R12  0x00000000
22:01:41:914 w ap 0 reg 13 SP   0x00000000
22:01:41:919 w ap 0 reg 14 LR   0x20000001
22:01:41:923 w ap 0 reg 15 PC   0x2000000F
22:01:41:930 w ap 0 reg 16 xPSR 0x01000000
22:01:41:934 w ap 0 reg 17 MSP  0x20003674
22:01:41:938 w ap 0 reg 18 PSP  0x00000000
22:01:41:940 run ap 0 
22:01:41:954 halt ap 0 
22:01:41:958 r ap 0 reg 0 R0   0x00000001
22:01:41:965 r ap 0 @0x90000000 0x00000001 bytes Data 0x00000000
22:01:41:973 halt ap 0 
22:01:41:979 w ap 0 reg 15 PC   (0x20000000)  
22:01:41:983 w ap 0 reg 17 MSP  (0x20000500)  
22:01:41:987 w ap 0 reg 16 xPSR (0x01000000)  
22:01:41:992 

22:01:41:994 Error: failed to read memory
22:01:42:001 Error: 
Downloading 8-bit data failed...
If it's a Flash memory, it may be not erased or protected

 

Looks to be an older version of STM32 Cube Programmer, but interesting that it loads the .STLDR to RAM

@Aziz BRIGUI any thoughts to why the stock STLDR for the G474 EVAL might load whilst others don't

Any sanity or size checks on the .STLDR, alignment? Any diagnostic output that Cube Programmer could provide about an issue or inability to load?

 

 

The NUCLEO-G491RE might be a workable proxy, but not a board I have to hand. Some of your pins also don't map to the header, but PB10/PB11 might be workable, or I might have to remap ARD_D0/ARD_D1

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I have done the test on the NUCLEO-G491RE. The result is the same.