Enabling NUCLEO-F401RE in PlatformIO

Hi,

I intend to use PlatformIO IDE for my future development. I made a try with Arduino UNO board and it does work well.
I am trying to make things work with NUCLEO F401RE board from STMicroelectronics. It is specified in the PlatformIO documentation that this development board is supported. Moreover, when I use in PlatformIO CLI with the command platformio boards, it is listed in.
However, when I try to init a new project using home screen of the IDE I got the following message:

Error: [08/29/16 16:03:48] Processing nucleo_f401re (platform: ststm32, board: nucleo_f401re, framework: mbed)
IOError: [Errno 2] No such file or directory: ‘C:\Users\Arnaud\.platformio\packages\framework-mbed\variant\NUCLEO_F401RE\NUCLEO_F401RE.eix’:
File “C:\Users\Arnaud.atom\packages\platformio-ide\penv\lib\site-packages\platformio\builder\main.py”, line 159:
env.SConscript(“$BUILD_SCRIPT”)
File “C:\Users\Arnaud.platformio\packages\tool-scons\script..\engine\SCons\Script\SConscript.py”, line 551:
return _SConscript(self.fs, *files, **subst_kw)
File “C:\Users\Arnaud.platformio\packages\tool-scons\script..\engine\SCons\Script\SConscript.py”, line 260:
exec file in call_stack[-1].globals
File “C:\Users\Arnaud.atom\packages\platformio-ide\penv\lib\site-packages\platformio\builder\scripts\ststm32.py”, line 80:
target_elf = env.BuildProgram()
File “C:\Users\Arnaud.platformio\packages\tool-scons\script..\engine\SCons\Environment.py”, line 224:
return self.method(*nargs, **kwargs)
File “C:\Users\Arnaud.atom\packages\platformio-ide\penv\lib\site-packages\platformio\builder\tools\platformio.py”, line 62:
f.lower().strip() for f in env.get(“FRAMEWORK”, “”).split(“,”)])
File “C:\Users\Arnaud.platformio\packages\tool-scons\script..\engine\SCons\Environment.py”, line 224:
return self.method(*nargs, **kwargs)
File “C:\Users\Arnaud.atom\packages\platformio-ide\penv\lib\site-packages\platformio\builder\tools\platformio.py”, line 248:
join(“$PIOBUILDER_DIR”, “scripts”, “frameworks”, “%s.py” % f)))
File “C:\Users\Arnaud.platformio\packages\tool-scons\script..\engine\SCons\Script\SConscript.py”, line 614:
return method(*args, **kw)
File “C:\Users\Arnaud.platformio\packages\tool-scons\script..\engine\SCons\Script\SConscript.py”, line 551:
return _SConscript(self.fs, *files, **subst_kw)
File “C:\Users\Arnaud.platformio\packages\tool-scons\script..\engine\SCons\Script\SConscript.py”, line 260:
exec file in call_stack[-1].globals
File “C:\Users\Arnaud.atom\packages\platformio-ide\penv\lib\site-packages\platformio\builder\scripts\frameworks\mbed.py”, line 250:
join(env.subst(“$PLATFORMFW_DIR”), “variant”, variant, “%s.eix” % variant))
File “C:\Users\Arnaud.atom\packages\platformio-ide\penv\lib\site-packages\platformio\builder\scripts\frameworks\mbed.py”, line 193:
tree = ElementTree.parse(filename)
File “C:\Python27\Lib\xml\etree\ElementTree.py”, line 1176:
tree.parse(source, parser)
File “C:\Python27\Lib\xml\etree\ElementTree.py”, line 646:
source = open(source, “rb”)

I cant figure out what is the issue or, to be true I understood something was missing but don’t know why as PlatformIO pretends everything is OK considering this platform.

Thanks

Try to remove this folder C:\Users\Arnaud\.platformio and re-start IDE.

Thank you, it seemed to have a positive effect. After two attempts it downloaded all the toolchain, framework-mbed and required utilities. However I still have an issue related to the port for my platform. Here is the error message:

Looking for upload port/disk…
scons: *** [upload] Explicit exit, status Error: Please specify upload_port for environment or use global --upload-port option.
For some development platforms this can be a USB flash drive (i.e. /media//)

Error: Please specify upload_port for environment or use global --upload-port option.
For some development platforms this can be a USB flash drive (i.e. /media//)

I listed the serialports using the platformio command line and it returns me this:

PS C:\Users\Arnaud\projects\embedded\test2> platformio serialports list
COM9

Hardware ID: USB VID:PID=0483:374B LOCATION=1-1
Description: STMicroelectronics STLink Virtual COM Port (COM9)

How can I force the port to be the COM9 port?

Thank you

Does this board has ARM mbed bootloader with media disk? Check File Explorer.

Yes it has. It appears as a “disk” in the explorer with the name : NODE_F401RE. I tried unsuccesfully to force an upload port in the .ini file using COM9…

What does this disk contain?

Set upload_port = *:/NODE_F401RE. Replace * with the disk letter

Sorry fo being so long to answer. I finally succeeded to push my code into the device. My “workaround” was only to define the value upload_protocol as stlink, as it was recommended for an other post for the STM32F411RE. And it seems to work like that.

I especially didn’t say you about it :blush: I need to understand why generic mbed media disk wasn’t used. Please help me to resolve this issue.

  1. Do you see some content on that disk?
  2. Try to specify full path to this disk using upload_port = X:/NODE_F401RE, where X is the letter of drive.

Thanks.

I have been using the Nucleo-F401RE for some time and it works fine. By leaving the upload port blank, it finds the USB drive to upload to automatically. If I need to specify the drive, then I do it with no slashes or path, e.g. upload_port = G:.