CubeMXImporter icon indicating copy to clipboard operation
CubeMXImporter copied to clipboard

CubeMXImporter unable to find startup_x.s file

Open C47D opened this issue 6 years ago • 2 comments

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 avatar Apr 05 '18 19:04 C47D

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 avatar Apr 05 '18 20:04 C47D

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.

C47D avatar Apr 05 '18 21:04 C47D