Open csamrn opened 1 year ago
I don't know if you can specify which version to install, but you can still call pyOCD specifying the .pack file to use with the --pack option, something like this:
pyocd <other options> --pack /path/to/pack/folder/Keil.STM32L4xx_DFP.2.6.1.pack
PS: I'm just a user like you.
ST has updated the Keil.STM32L4xx_DFP package to 2.6.2 in June 2023. They have introduced a second flash algorithm for the STM32L4R5 family in the Keil.STM32L4xx_DFP.pdsc file:
The pervious one (2.6.1) looked like this:
The issue with this is that now the STM32L4Rx_2048_Single.FLM algorithm gets picked instead of STM32L4Rx_2048_Dual.FLM as it is the second one in the list overwriting the first one: https://github.com/pyocd/pyOCD/blob/fba00fb7d7ab84f04478c0c5d57a9b25d82bb9e4/pyocd/target/pack/cmsis_pack.py#L500C16-L500C16
This leads to the following issue: The sector size is set to 0x2000 instead of 0x1000 (board.target.memory_map._regions[0]._flm.flash_info.sector_info_list). When erasing using -e sector this erases memory from other "original sized" pages than the ones intended. E.g. when using different hex files with subsequent address ranges aligned to 0x1000 page size, parts of the other hex file tend to get erased when the absolutely shouldn't.
Is there a way to specify which algorithm to choose without modifying the .pack file? Is there a way to choose which .pack file version to install via
pyocd pack install
?