2

I have designed custom-made PCB with STM32L071C8 MCU. I'm using OpenOCD 'master' branch and SWD interface via FT2232H to debug the MCU.

I successfully did some RAM reading and Flash writing, erasing on the MCU via the OpenOCD so the OpenOCD ->FT2232H-> SWD on MCU works.

But, I have a weird problem with writing to Flash more than 192 bytes or in other words 128 bytes (page) + 64 (half page). the OpenOCD prints an error message about failing to write the data to the desired flash address

error writing to flash at address 0x08000000 at offset 0x00000000

I have executed OpenOCD with debug prints and came up with these logs.

Log of successfully writing 100 bytes to flash.

Log of failure to write 192 bytes to flash - the problem described above.

as you can see in the logs I'm using 'fillb' OpenOCD command to write bytes to flash.

Before each 'fillb' command I take care to erase the desired flash page. I didn't mention the erasing in log.

Have you any advice about how can I investigate this problem? or maybe any solution?

Mercury Avangburg
  • 119
  • 1
  • 1
  • 10
  • Pragmatically, *why* do you need to do this? Loading files works for you, right? So what do you need this process to accomplish? Is using 'fillb' (vs 'fillw') even allowed on a flash that *must* be written in full words, and unlike some other types (including STM32F's) does not allow overwriting yet unwritten bits further away from the erased state? – Chris Stratton May 06 '19 at 21:40
  • @ChrisStratton When I'm using 'flash write_image erase' command I see the same error as I get from 'fillb' command. it seems it doesn't matter. – Mercury Avangburg May 06 '19 at 21:54
  • Hmm, that's odd, I program STM32L072's all the time. Granted my OpenOCD is maybe two years stale before they did some sweeping changes to the config files that I'm yet to update our custom stuff to match. – Chris Stratton May 06 '19 at 22:28
  • @personal_cloud that would be *serious misunderstanding* of the comment you are referencing. I said the configuration files changed, which invalidates my personal setups. It *does not* mean the functionality changed. Hopefully this unproductive tangent gets cleaned up so it does not distract future readers. – Chris Stratton Jun 28 '20 at 04:25
  • @personal_cloud - no, this question has utterly nothing to do with yours. You have a target specific issue, and this is about a **completely different target**. – Chris Stratton Jun 28 '20 at 05:04

0 Answers0