Pico question

For general Flowcode discussion that does not belong in the other sections.
Post Reply
Amtor
Posts: 56
http://meble-kuchenne.info.pl
Joined: Thu Dec 17, 2020 4:35 pm
Has thanked: 20 times
Been thanked: 16 times

Flowcode v9 Pico question

Post by Amtor »

Sorry I expect this has been asked often before.

Once Flowcode has made the .uf2 file, are you just supposed to drop it into the pico window that appears when its plugged in.
Everything works fine if I do that, it runs the program ok. But I've seen talk about com ports. But I've had a port appear, even if I hold the boot
button as I plug in.

It's no problem just dragging the file over
I was just wondering that all.

Thanks

Mark

medelec35
Matrix Staff
Posts: 2120
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 658 times
Been thanked: 716 times

Re: Pico question

Post by medelec35 »

Hi Mark
You can get the Pico into boot mode by holding the boot button down, then plugging in the USB cable.
A window should pop up like this:
Pico Boot mode.png
Pico Boot mode.png (16.83 KiB) Viewed 206 times
It's just like plugging in a USB flash drive.
When you use compile to target, Flowcode will transfer the correct file to the above directory and the directory will be automatically closed.
The Pico should then be programmed.
Martin

Amtor
Posts: 56
Joined: Thu Dec 17, 2020 4:35 pm
Has thanked: 20 times
Been thanked: 16 times

Re: Pico question

Post by Amtor »

Thanks very much for the info

Drive F: does pop up and its named RPI-RP2

but I get this error, like it can't find it.

find: /i: No such file or directory
find: RPI-RP2: No such file or directory
find: /i: No such file or directory
find: RPI-RP2: No such file or directory
find: /i: No such file or directory
find: RPI-RP2: No such file or directory
find: /i: No such file or directory
find: RPI-RP2: No such file or directory
find: /i: No such file or directory
find: RPI-RP2: No such file or directory
find: /i: No such file or directory
find: RPI-RP2: No such file or directory
find: /i: No such file or directory
find: RPI-RP2: No such file or directory
. . . . . . . . . . . . .

find: /i: No such file or directory
find: RPI-RP2: No such file or directory
. . . . . . . . .

find: /i: No such file or directory
find: RPI-RP2: No such file or directory
RPI-RP2 board is not connected.


FINISHED

I expect I've got something set wrong somewhere

All the best Mark

Amtor
Posts: 56
Joined: Thu Dec 17, 2020 4:35 pm
Has thanked: 20 times
Been thanked: 16 times

Re: Pico question

Post by Amtor »

I asked copilot to make up a new pico_prog.bat file and it came up with the following and it worked. Its all a mystery to me. But it worked
somehow.

REM DIR: FCD\PICO\batch\pico_prog.bat
@echo off
setlocal

:: Get the .uf2 file path from arguments
set "object=%~1%~2.uf2"
set "vName=%3"

:: Loop through all drive letters to find RPI-RP2
set "ltr="
for %%d in (D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
vol %%d: 2>nul | findstr /i "RPI-RP2" >nul
if not errorlevel 1 (
set "ltr=%%d:"
goto :found
)
)

echo %vName% board is not connected.
goto :eof

:found
if "%object%"=="" (
echo Please pass a parameter.
goto :eof
)

echo Copying %object% to %ltr%
copy /Y "%object%" "%ltr%"
endlocal

Amtor
Posts: 56
Joined: Thu Dec 17, 2020 4:35 pm
Has thanked: 20 times
Been thanked: 16 times

Re: Pico question

Post by Amtor »

The old one

REM DIR: FCD\PICO\batch\pico_prog.bat
@echo off
setlocal
set object="%~1%~2.uf2"
set vName=%3
set n=0
set ltrs=ABCDEFGHIJKLMNOPQRSTUVWXYZ
:Loop
call set ltr=%%ltrs:~%n%,1%%
set /a n +=1
vol %ltr%: 2>nul|find /i " %vname%">nul||if %n% lss 26 goto :loop
if %n% equ 26 (set "ltr="
echo %vName% board is not connected.
) else if [%object%]==[] (echo Please pass a parameter.
) else (copy %object% %ltr%:)
endlocal & set ltr=%ltr%

Post Reply