最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

stm32 - Write Memory Error from CubeProgrammer API when flashing FW to device over STLink V3 SET and I2C but no error using USB

programmeradmin6浏览0评论

I have a device with an MCU in DFU-mode, and I want to flash new firmware to it. To do that I have the software we have developed at my company to interact with the device, mainly a Wpf-application written in C# and Xaml, which in turn uses the KSociety SharpCubeProgrammer library to make calls to the STM32 CubeProgrammer_API.

If I use the STLink V3 SET hardware over I2C I get a CubeprogrammerErrorWriteMem error (return value -10), i.e. a memory write error, but using the same firmware file but instead directly over USB, i.e. not using the STLink, I get no error and the firmware is updated. In either way the calling code is almost identical, and I have checked that the data and address is the same when calling the API over both I2C and USB. The method called from the API is in either way WriteMemoryAndVerify(...).

I found some information saying that it's the STM32_Programmer_CLI.exe that does the actual reflashing. If that's the case I have a vague idea that I must use the parameter --skiperase which will not erase flash blocks before rewriting them, or when my code grows into the next block. But because the SharpCubeProgrammer wrapper for the STM32 CubeProgrammer_Api I use doesn't include an option for setting that parameter I guess I'll have to do a PInvoke in my code to call the method in the STM32 CubeProgrammer_Api directly.

Any help or just pointing me in the right direction would be highly appreciated. Thanks!

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论