STM32F407VGT6 programming issues
Posted: Tue Mar 12, 2024 7:15 pm
I have a problem programming the MCU from the title.
I tried to find a solution here (https://github.com/orgs/stm32duino/discussions/2302), but no luck.
The thing is, I can not upload a sketch using Arduino IDE.
UART adapter
While using the UART adapter I can not upload a sketch as it says it is not in a bootloader mode. The same goes when I try to connect to the MCU over the STM32CubeProgrammer.
SWD adapter
While using the SWD, I can not upload. I get this error:
Erasing memory corresponding to segment 0:
Erasing internal memory sector 0
Error: failed to erase memory
Error: failed to erase memory
Error: failed to erase memory
I can connect MCU to the STM32CubeProgrammer using SWD. RDP option byte is set to AA. I tried to erase the chip and got the message that the flash was protected. The core is locked up.
However, while using MikroElektronika's CodeGrip and Necto Studio I can upload whatever I want. I can use CodeGrip Suite to detect the chip, erase the flash, and upload the HEX file. Moreover, I can upload a HEX file compiled by the Arduino IDE.
Weird.
So the question is, what can I do to unlock the MCU, so I can use it with ArduinoIDE? I am all ears.
I tried to find a solution here (https://github.com/orgs/stm32duino/discussions/2302), but no luck.
The thing is, I can not upload a sketch using Arduino IDE.
UART adapter
While using the UART adapter I can not upload a sketch as it says it is not in a bootloader mode. The same goes when I try to connect to the MCU over the STM32CubeProgrammer.
SWD adapter
While using the SWD, I can not upload. I get this error:
Erasing memory corresponding to segment 0:
Erasing internal memory sector 0
Error: failed to erase memory
Error: failed to erase memory
Error: failed to erase memory
I can connect MCU to the STM32CubeProgrammer using SWD. RDP option byte is set to AA. I tried to erase the chip and got the message that the flash was protected. The core is locked up.
However, while using MikroElektronika's CodeGrip and Necto Studio I can upload whatever I want. I can use CodeGrip Suite to detect the chip, erase the flash, and upload the HEX file. Moreover, I can upload a HEX file compiled by the Arduino IDE.
Weird.
So the question is, what can I do to unlock the MCU, so I can use it with ArduinoIDE? I am all ears.