Hello,
I am developping an application that can run on multiple MCUs. I have tested my code on a nucleo G474 and I was flashing it using a 6-pin jlink on the gpios.
I received the final board which has a STM32G791, and after configuring my code to support this MCU I tried to flash the board and it failed when the script tried to flash the binary.
Attached are the scripts I used for both targets
Display All
Display All
I am not sure what I'm doing wrong here. What is sure though, is that I can write registers on the nucleo board but not on the target board, but I can read them on both MCUs
I tried to reset the options bytes as I've seen in an other post on this forum ([SOLVED] STM32L052 failed to erase sectors) using JLinkSTM32, but it failed with the message
Which is weird because this IDCODE is specified in the STM32G4 reference manual
What am I missing?
Regards,
Thomas
I am developping an application that can run on multiple MCUs. I have tested my code on a nucleo G474 and I was flashing it using a 6-pin jlink on the gpios.
I received the final board which has a STM32G791, and after configuring my code to support this MCU I tried to flash the board and it failed when the script tried to flash the binary.
****** Error: Failed to erase sectors 0 @ address 0x08000000 ((erase error))
Failed to erase sectors.
Unspecified error -1
Attached are the scripts I used for both targets
Source Code
- device stm32g474re
- speed 4000
- r
- #unlocking flash
- w4 0x08 0x45670123
- w4 0x08 0xCDEF89AB
- #read flash access control register
- mem32 0x0 1
- w4 0x0 0x00000602
- mem32 0x0 1
- mem32 0x20 1
- w4 0x20 0xF0000000
- mem32 0x20 1
- sleep 500
- # workaround to bypass flash verification
- exec SetSkipProgOnCRCMatch=0
- exec SetVerifyDownload=0
- loadfile path/to/app.bin 0x08000000
- r
- g
- q
Source Code
- device stm32g491re
- speed 4000
- r
- #unlocking flash
- w4 0x08 0x45670123
- w4 0x08 0xCDEF89AB
- #read flash access control register
- mem32 0x0 1
- w4 0x0 0x00000602
- mem32 0x0 1
- mem32 0x20 1
- w4 0x20 0xF0000000
- mem32 0x20 1
- sleep 500
- # workaround to bypass flash verification
- exec SetSkipProgOnCRCMatch=0
- exec SetVerifyDownload=0
- loadfile path/to/app.bin 0x08000000
- r
- g
- q
I tried to reset the options bytes as I've seen in an other post on this forum ([SOLVED] STM32L052 failed to erase sectors) using JLinkSTM32, but it failed with the message
Unexpected IDCODE DEV_ID 0x0479 found.
Which is weird because this IDCODE is specified in the STM32G4 reference manual
What am I missing?
Regards,
Thomas
The post was edited 1 time, last by Thomas Jeantet ().