damogranlabs / VS-Code-STM32-IDE

Use VS Code as STM32 IDE with CubeMX
MIT License
247 stars 52 forks source link

Make file missing seprator #41

Open NoamYu opened 4 years ago

NoamYu commented 4 years ago

I'm trying to convert a keil project to vscode using the script. after running the importKeilProject.py I'm trying to run the update script but I'm running into an error

Update started.

Existing '.vscode' folder used. One STM32CubeMX file found: Main-boot.ioc Existing 'Makefile' file will be restored from 'Makefile.backup'. Copy of file (new name: Makefile): c:/Users/Noam.Yulzari/Documents/migrationTest/Main-Boot/Makefile.backup Makefile 'print-variable' function added. Valid 'buildData.json' file found. Valid 'toolsPaths.json' file found. 'toolsPaths.json' file updated! makefile:80: *** missing separator. Stop.

ERROR (0 seconds). Unexpected error occured during 'Update' procedure. Exception: Traceback (most recent call last): File "c:/Users/Noam.Yulzari/Documents/migrationTest/Main-Boot/ideScripts/update.py", line 56, in makefileData = makefile.getMakefileData(makeExePath, gccExePath) File "c:\Users\Noam.Yulzari\Documents\migrationTest\Main-Boot\ideScripts\updateMakefile.py", line 109, in getMakefileData projectName = self.getMakefileVariable(makeExePath, gccExePath, self.mkfStr.projectName)[0] IndexError: list index out of range

I went to line 79 in the makefile and saw that '\' is missing.

../SharedModules/Src/CommonFunctions.c\ Boot/Src/Fonts.c Src/main.c\

also, the file in this line appears twice (again in line 120). When I'm trying to edit to the makefile to fix these issues when running the update script again the makefile returned to the initial state.

schperplata commented 4 years ago

This is usually the problem while you are using CubeMX simultaneously. Seems like CubeMX cache Makefile data and when python script also changes Makefile, it is not up-to-date. Or some other combination of already modified Makefile/CubeMX/py script.

I suggest you close CubeMX, remove all available Makefiles and regenerate the project. Makefile is modified by py script so it is possible to get its variables.