cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0 External Loader for I2C eeprom

arekj
Associate II

Hi,

I try to make a external loader for STM32G030. 
I was implemented function MassErase(), Write(), Read(), Init()...
First I test function on "flash" version and everything work. But when I try using it in STM32CubeProgrammer the Write function not working.
Full chip erase work ok, and after this operation eeprom is cleared by 0xFF as default data. 
But when I try write to eeprom, it stuck on "Loader write range..."
Both function (MassErase and Write) use this same function to write data to eeprom.

What could be the reason that cube stop in this?

 

 

 

13:58:17:879 : Memory Programming ...
13:58:17:879 : Opening and parsing file: test13.hex
13:58:17:880 :   File          : test13.hex
13:58:17:881 :   Size          : 128.00 B 
13:58:17:882 :   Address       : 0x00000000 
13:58:17:882 : Erasing Segment <0> Address <0x00000000> Size <128>Bytes
13:58:17:882 : Erasing memory corresponding to segment 0:
13:58:17:883 : Memory erase...
13:58:17:883 : halt ap 0 
13:58:17:883 : w ap 0 reg 15 PC   (0x20000000)  
13:58:17:883 : w ap 0 reg 17 MSP  (0x20000500)  
13:58:17:883 : w ap 0 reg 16 xPSR (0x01000000)  
13:58:17:883 : w ap 0 @0x20001C40 0x00000200 bytes Data 0x00000000
13:58:17:892 : w ap 0 @0x20000000 0x00000004 bytes Data 0x0000BE00
13:58:17:906 : w ap 0 @0x20000004 0x00001804 bytes Data 0x00000000
13:58:17:906 : Erasing external memory sectors [0 7]
13:58:17:906 : Init flashloader...
13:58:17:907 : halt ap 0 
13:58:17:907 : w ap 0 reg 0 R0   0x00000001
13:58:17:907 : w ap 0 reg 1 R1   0x00000000
13:58:17:907 : w ap 0 reg 2 R2   0x00000000
13:58:17:907 : w ap 0 reg 3 R3   0x00000000
13:58:17:907 : w ap 0 reg 4 R4   0x00000000
13:58:17:907 : w ap 0 reg 5 R5   0x00000000
13:58:17:908 : w ap 0 reg 6 R6   0x00000000
13:58:17:908 : w ap 0 reg 7 R7   0x00000000
13:58:17:908 : w ap 0 reg 8 R8   0x00000000
13:58:17:908 : w ap 0 reg 9 R9   0x00000000
13:58:17:909 : w ap 0 reg 10 R10  0x00000000
13:58:17:909 : w ap 0 reg 11 R11  0x00000000
13:58:17:909 : w ap 0 reg 12 R12  0x00000000
13:58:17:909 : w ap 0 reg 13 SP   0x00000000
13:58:17:909 : w ap 0 reg 14 LR   0x20000001
13:58:17:916 : w ap 0 reg 15 PC   0x2000071D
13:58:17:918 : w ap 0 reg 16 xPSR 0x01000000
13:58:17:920 : w ap 0 reg 17 MSP  0x20001C04
13:58:17:920 : w ap 0 reg 18 PSP  0x00000000
13:58:17:920 : run ap 0 
13:58:17:920 : halt ap 0 
13:58:17:921 : r ap 0 reg 0 R0   0x00000001
13:58:17:921 : Loader sector erase...
13:58:17:921 : w ap 0 reg 0 R0   0x00000000
13:58:17:921 : w ap 0 reg 1 R1   0x00000070
13:58:17:921 : w ap 0 reg 2 R2   0x00000002
13:58:17:921 : w ap 0 reg 3 R3   0x00000000
13:58:17:921 : w ap 0 reg 4 R4   0x00000000
13:58:17:921 : w ap 0 reg 5 R5   0x00000000
13:58:17:921 : w ap 0 reg 6 R6   0x00000000
13:58:17:922 : w ap 0 reg 7 R7   0x00000000
13:58:17:922 : w ap 0 reg 8 R8   0x00000000
13:58:17:922 : w ap 0 reg 9 R9   0x00000000
13:58:17:922 : w ap 0 reg 10 R10  0x00000000
13:58:17:922 : w ap 0 reg 11 R11  0x00000000
13:58:17:922 : w ap 0 reg 12 R12  0x00000000
13:58:17:922 : w ap 0 reg 13 SP   0x00000000
13:58:17:922 : w ap 0 reg 14 LR   0x20000001
13:58:17:924 : w ap 0 reg 15 PC   0x20000791
13:58:17:924 : w ap 0 reg 16 xPSR 0x01000000
13:58:17:925 : w ap 0 reg 17 MSP  0x20001C04
13:58:17:926 : w ap 0 reg 18 PSP  0x00000000
13:58:17:927 : run ap 0 
13:58:18:082 : halt ap 0 
13:58:18:083 : r ap 0 reg 0 R0   0x00000001
13:58:18:083 : erase: 0205ms
13:58:18:083 : Download in Progress:
13:58:18:087 :   Size          : 128 Bytes
13:58:18:087 :   Address       : 0x00000000 
13:58:18:087 : Buffer program...
13:58:18:087 : halt ap 0 
13:58:18:087 : w ap 0 reg 15 PC   (0x20000000)  
13:58:18:088 : w ap 0 reg 17 MSP  (0x20000500)  
13:58:18:088 : w ap 0 reg 16 xPSR (0x01000000)  
13:58:18:088 : w ap 0 @0x20001C40 0x00000200 bytes Data 0x00000000
13:58:18:088 : w ap 0 @0x20000000 0x00000004 bytes Data 0x0000BE00
13:58:18:127 : w ap 0 @0x20000004 0x00001804 bytes Data 0x00000000
13:58:18:127 : Loader write range...

 

 

 

4 REPLIES 4

Address zero might be problematic, can you try some other faux address within the STM32G0's address space

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

I was try using different address, but I still get this same issue.

arekj
Associate II

Everything works, when memory size is set to max 0x50 or lower. When I try use bigger it's generate this problem. 

I try to find the cause of the problem, I create new project to make External loader, but this time I make small mistake, and this new version works correct.
When I was create new project I used exactly this processor: STM32G030K6Tx and the external loader works correct.

But, my old project use STM32G030K8Tx and the external loader works only when memory size is set to max 80 bytes.
Both project have this same source code, but compilation is for difference processor. 
So, the question is what causes the limit for external loader memory size?