cmrx icon indicating copy to clipboard operation
cmrx copied to clipboard

genlink_cmsis.py fails when linker script is missing CR or LF at end of file

Open rhempel opened this issue 8 months ago • 0 comments

The vendor supplied linker scripts do not always include a LF or CR at the end of the file:

https://github.com/STMicroelectronics/cmsis-device-h5/blob/5273b8f134ba65f5b8174c4141b711b5c0d295b2/Source/Templates/gcc/linker/STM32H533xx_FLASH.ld

In this case the genlink_cmsis.py fails in

def sub_range(self, begin : int, end : int):

because

if (end >= len(self)):

Adding a CR or LF is enough to fix the problem, or maybe just change the conditional to

if (end > len(self)):

rhempel avatar Apr 06 '25 20:04 rhempel