Eamonb
 
We have strange behaviour when we attempt to transfer a simple test Ladder Logic program to the Raspberry Pi Pico 
 
There are some C code warning messages that are output to the console  - my understanding is we can ignore these   .
 
Then the have the following output to the console  - 
 
Uploading program to Arduino board at None...
Converting to uf2, output size: 143872, start address: 0x2000
Scanning for RP2040 devices
Flashing F: (RPI-RP2)
Wrote 143872 bytes to F:/NEW.UF2

Done!
 
 
This looks normal . 
 
As you can see it seems to indicate the file was written successfully to the Raspberry Pi Pico ( Drive F🙂
 
The program however is not running when we test it - we don't see the expected Ladder logic program behaviour
 
Then we noticed that Drive F : ( Raspberry Pi Pico ) disappears  in file manager immediately after or during the upload. This suggests I think that the Raspberry Pi Pico is crashing for some reason during the upload of the file or the execution of the uploaded file immediately after it is uploaded 
 
Then if we power off the Raspberry Pi Pico and power it on again , and check the Raspberry Pi Pico drive we do not see the F:/NEW.uf2 written there . This seems to point to a problem during the writing of this file to the Raspberry Pi Pico  . 
 
Any advice on this issue would be very much appreciated . 
Reply 0 0
thiagoralves
The flash storage only appears when the Pico is in bootloader mode. This is normal and expected. Once the program file is transferred, the Pico exits bootloader mode and then the drive must disappear. You can read more about UF2 here: https://learn.adafruit.com/adafruit-hallowing/uf2-bootloader-details
 
When the Pico crashes, you usually cannot upload new programs to it (as it is stuck) and the only way to get out of it is to reset your board and manually place it in bootloader mode to add a new program. If that's not happening and you can still upload new programs to it, then most likely your Pico hasn't crashed and it is running as it should.
Reply 0 0
thiagoralves
By the way, I just fixed the compilation warnings on some platforms (like the Pico): https://github.com/thiagoralves/OpenPLC_Editor/commit/7b40432931be99a908f5822f8634420845141374
 
If you update your editor and compile again you will see a "cleaner" log. The compiled binary, however, continues exactly the same.
Reply 0 0
Reply