Notifications
Clear all

Arduino IDE 2.1.1 will not send the compiled file to the pico

31 Posts
4 Users
1 Likes
1,382 Views
 DanC
(@danc)
Member
Joined: 5 years ago
Posts: 17
Topic starter  

@zander 

Latest news.

The file folder (on the pico) does remain open while the compiler downloads the file to the pico, after the file is loaded (~3 seconds) the IDE pops to the foreground, closes the pico file folder and forgets which port was selected for the download, and when I reopen the pico folder by unplugging, press button, replug the file is no longer on the pico.

This thing with the port being closed and forgotten isn't something new, it did the same thing when I was able to program the pico.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7011
 

@danc Sorry, I have no idea what you are talking about. I don't think I have ever 'looked' at a board, I am pretty sure you can't for any of the other boards. On the PICO you can if you plug it in as a USB Mass Storage Device which is what the Boot Sel button does.

Follow the published instructions EXACTLY then tell us what happened.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
 DanC
(@danc)
Member
Joined: 5 years ago
Posts: 17
Topic starter  

@zander 

I am sure I am following the exact steps for downloading a compiled file to the pico.

Please see the attached file it illustrates what I do and see.

When I go back and open the pico (mass storage mode) the file is no longer in the pico.

Thank you for your patients, Dan

 


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

@danc

Its been a while since I used Arduino on the rpi pico as I usually use micropython.  When installing the C code uf2 code that contains the micropython program environment then you never see the uf2 file again after the initial load.  The boot select is then only used again to upload a new version of the micropython program, and its not need to upload the programs one produces in mp.   

Something similar happens when initially using the pico with the Arduino IDE.  The boot select button is only used for the first usage and then the pico should operate in usb mode without needing to use the boot select button again.  I found a recent guide on getting the pico set up for use with the Arduino IDE and I give a link to the web page:

https://www.upesy.com/blogs/tutorials/install-raspberry-pi-pico-on-arduino-ide-software#


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7011
 

@danc I don't use Msft Word, send a simple text file.

Why are you opening the board in mass storage mode again, every time you do that you have to do the one time setup. I have NEVER used a file manager to 'look' at a board, why would I, there is nothing to see, besides, it isn't a memory device, it's a MCU. ONLY the PICO can be put into that special USB MASS STORAGE MODE to use with Python. After the one time procedure is done (usually once but there are exceptions) the PICO is no longer a storage device. If you try to 'see' inside you will mess it up.

What do you 'see' if you use an UNO or other arduino board, or any esp board. 

You are not understanding that there is a special part of the board that is loaded by the IDE to interface with either Python, C++SDK, or Arduino IDE. You are constantly causing the IDE to re-load the Python firmware.

Go back over ALL my screen shots, quoted text and links and READ every word carefully.

Exceptions:

Make sure you have the 'right' version of the IDE (see old screen shot).

Make sure the Serial port is not hanging up. If you are not actively using the Serial port, do a Serial.end(); when your code is done with it. If you can't and you think there may be a resource lock issue, quit the IDE and reload to eliminate the resource lock.

I just tried a little experiment. I just this afternoon got a new UNO R4 WiFi board so I plugged it into my Mac and I also plugged a USB stick I use for 'sneakernet' to my Pi4. I realize you may not know the Mac Finder, but I am pretty sure you can see the USB stick and nothing else other than OneDrive and Network and my boot HD (actually SSD) The USB stick is the one with the Eject icon beside it and it's the ONLY one, the UNO is not shown because it is not a USB device. The PICO is when the firmware is loaded that makes it into a USB stick, otherwise, the one-time first-time procedure deletes the USB firmware and loads the 'normal' firmware. IF you meet the requirements, the IDE will reload the USB firmware again. If you want to look at the board after a successful UPLOAD then terminate the IDE first! If it's NOT Python the PICO will not be visible.

Screenshot 2023 07 12 at 16.54.20

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
 DanC
(@danc)
Member
Joined: 5 years ago
Posts: 17
Topic starter  

@byron 

Hi Byron.

I found a test program on the pico web site and just finished running it on two picos.

#include"pico/stdlib.h"

intmain(){
#ifndefPICO_DEFAULT_LED_PIN
#warningblink example requires a board with a regular LED
#else
constuint LED_PIN = PICO_DEFAULT_LED_PIN;
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);
while(true){
gpio_put(LED_PIN, 1);
sleep_ms(250);
gpio_put(LED_PIN, 0);
sleep_ms(250);
}
#endif
}
 
The only problem I am having now is when I add the #include"pico/stdlib.h" to a different program it still won't run my program. At least I was able to get the pico(s) to do something. So it looks like there is hope after all.
I will checkout the link that you provided, maybe there will be some more answers.
Thanks very much, Dan

   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7011
 

@byron That's what he was told several hours ago.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7011
 

@danc OK, now we are getting somewhere. The sketch you provided is NOT an arduino IDE sketch. Here is the equivalent arduino sketch

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

I believe what you posted is a C++SDK file.

 

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
 DanC
(@danc)
Member
Joined: 5 years ago
Posts: 17
Topic starter  

@zander 

I found a file on Raspberry Pi web site that flashes the on board led. Upto now / over the last few days I haven't been able to get anything to work on my picos, I ran the Arduino IDE with:

#include"pico/stdlib.h"

intmain(){
#ifndefPICO_DEFAULT_LED_PIN
#warningblink example requires a board with a regular LED
#else
constuint LED_PIN = PICO_DEFAULT_LED_PIN;
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);
while(true){
gpio_put(LED_PIN, 1);
sleep_ms(250);
gpio_put(LED_PIN, 0);
sleep_ms(250);
}
#endif
}
And it loaded and ran. As for being able to download without doing the power off / press button / power on routine, I have to do it every time I want to down load from the Arduino IDE, if I don't the port from the IDE will not be selectable.

 


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

Posted by: @zander

@byron That's what he was told several hours ago.

Ron, you are counting the ticktock rhythm of passing time.  

Devouring Time, blunt thou the lion’s paws,
And make the earth devour her own sweet brood;
Pluck the keen teeth from the fierce tiger’s jaws,
And burn the long-lived phoenix in her blood …

from the bard. 

 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7011
 

@danc First of all it's UPLOAD.

I can't say this enough times, you are doing it wrong. After the first time to change the loader the board is just like any UNO, NANO etc.

I am done, I have nothing more to add.

Looking at your past history I see you are consistent.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7011
 

@byron Is that one of those limey rhyming slang things?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

Posted by: @zander

@byron Is that one of those limey rhyming slang things?

I said the bard, and of course I should have said The Bard.  All written when your ancestors were probably happily toiling the fields in some European part of the world.  

Posted by: @zander

I can't say this enough times

Take a queue from you ancestors working in the fields

To toil and not to seek for rest,

To labour and not to ask for any reward

etc

 

 

 

 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7011
 

@byron Very likely, but one of my ancestors was the oldest woman in the British Empire at 106 IIRC, and I am something like 8th generation here. Sorry, no fields for us. We were trades people and the women folk were cooks and cleaners. One of my ancestral lines worked for Lady Aberdeen, we have a signed photo album. Very old photos on tin plates.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7011
 

@byron Did you mean cue? English is such a tricky language, isn't it? Thankfully in Canadian High Schools, the technical stream did NOT have to take Shakespeare. We got to take Algebra instead, which is much more useful.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Page 2 / 3