cnoviello / CubeMXImporter

This tool can be used to import projects generated by STM32CubeMX tool inside an Eclipse project created with the GNU ARM Eclipse plugin
102 stars 28 forks source link

CubeMXImporter unable to find startup_x.s file #14

Open C47D opened 6 years ago

C47D commented 6 years ago

Hi,

I got a problem when using this tool, i'm using CubeMX version 4.25.0.

\CubeMXImporter>python cubemximporter.py ..\projects\hello_cube2 ..\cubemx_out\nucleo64_f103rb Traceback (most recent call last): File "cubemximporter.py", line 544, in cubeImporter.importCMSIS() File "cubemximporter.py", line 318, in importCMSIS shutil.copy(loc[0], loc[1]) File "C:\Python27\lib\shutil.py", line 133, in copy copyfile(src, dst) File "C:\Python27\lib\shutil.py", line 96, in copyfile with open(src, 'rb') as fsrc: IOError: [Errno 2] No such file or directory: '..\cubemx_out\nucleo64_f103rb\startup/startup_stm32f103xb.s'

CubeMX 4.25.0 places the startup file on the SW4STM32 directory:

(my cube project directory)\SW4STM32> dir 20/03/2018 05:00 p. m. 11,536 startup_stm32f103xb.s

So i think the script is searching the startup file on a wrong directory. Can you reproduce the problem or i'm doing something wrong?

Regards, Carlos

C47D commented 6 years ago

Modifying the script made it work, i don't know if this is special for Cube 4.25.0. Just noticed there's a special case handling the Cube version 4.19, should i add a special handling for Cube 4.25? Let me know if this fix can become a pull request.

Regards, Carlos

cubemximporter.zip

C47D commented 6 years ago

Sorry for the noise but i found the problem, when generating the project under root the startup file is located on the startup directory, this way this script works as expected. When generating the project with the Generate under root checkbox unchecked the startup file is located on the root directory.