Hi all,

I've been seeing an issue programming an STM32 device I'm working with here.

Googling around it seems quite prevalent and a lot of people have added an stm32l4x mass_erase call to the OpenOCD .cfg file to work around the problem.

For various reasons I'd like to be able to reprogram without erasing the entire part and so had a look into this today.

I found that if I try to erase sectors on my 512kB part it only successfully erases the first half.

Looking at the datasheet this appears to be because my configuration is dual bank.

Investigating src/flash/nor/stm32l4x.c I think there's a problem where the OPT_DUALBANK bit is being checked as it should be a bitwise comparison.

I've committed a patch here:

https://github.com/DynamicDevices/openocd/commit/da02a8908303c62a3f1750c21d82e345af1469c0

I think the bank_b_start value should be valid for the relevant two cases in the datasheet (512kB and 256kB dual bank) but would appreciate a review.

With this change I can now program the device repeatedly without needing the mass_erase configuration line.

Cheers,

Alex Lennon
Dynamic Devices Ltd




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to