Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:52 29 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Firmware Update a Remote Picomite

Author Message
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 02:40am 25 Apr 2023
Copy link to clipboard 
Print this post

Hi All,

I think I know that this cant be done but "asking for a friend" Actually its me but you all knew that

I have a PicoMite `up a pole' running for several months now (no watchdog either) and it hasnt crashed yet. But with the newer versions coming out now I am wondering is there a way to update the firmware without having to pull the assembly down off the pole, opening the case and flashing on my desk?

I have enabled serial console over about 20m of cat5 and can flash new code in (I use 38k baud but it worked ok at 56k, I just allowed for more reliable transfers) but the firmware is different and `generally' requires the USB to be plugged in.

Is there an method of doing this without climbing ladders?

Kind Regards,

Mick
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6101
Posted: 05:39am 25 Apr 2023
Copy link to clipboard 
Print this post

How high?
You could leave a long USB cable dangling from the pico and plug the laptop in as required.

You have to watch out for power supply conflicts.

Jim
VK7JH
MMedit   MMBasic Help
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6805
Posted: 06:33am 25 Apr 2023
Copy link to clipboard 
Print this post

I don't think so, Mick. I suspect that, even if the console is redirected to the COM port, you might be able to start the update but it probably won't complete because the new flash data will overwrite the old flash data that made the serial port into the console.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Bill.b

Senior Member

Joined: 25/06/2011
Location: Australia
Posts: 226
Posted: 11:03am 25 Apr 2023
Copy link to clipboard 
Print this post

Hi Mick

You could replace the pico with a picow and have wifi access

Bill
Edited 2023-04-25 21:04 by Bill.b
In the interests of the environment, this post has been constructed entirely from recycled electrons.
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 11:40am 25 Apr 2023
Copy link to clipboard 
Print this post

as it happens, i've been looking into something similar recently.

Mick: if you were to add an Arduino or similar (or, indeed, a 1455 with the right firmware onboard), connected to the SWD port, then you could update the PICO over a serial link.

the communications over theRP2040's SWD port is closely related to the ICSP protocol used to reprogram the flash of a PIC32MX170 (MX170). but first you'd need to put the necessary hardware up the pole, and then write the necessary software (an equivalent to PIC32Prog). last time i did this, it took about a year!

the SWD port can also be used for some other neat things. apart from allowing you to rewrite the flash, it also provides bi-directional access to the PICO's internal RAM while the processor is running MMbasic, and so opens up an alternative route to adding external peripherals.

for instance, a 1455 could add serial and/or USB CDC console access, without needing to use TinyUSB or the PICO's onboard USB port, and without using any of the existing I/O pins that an MMbasic program might want to use.

there is also the possibly of some interesting external video and keyboard options. see:
https://forums.raspberrypi.com/viewtopic.php?t=350606


cheers,
rob   :-)
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 12:01am 26 Apr 2023
Copy link to clipboard 
Print this post

Hi All,

I `wrote’ a reply yesterday but I mustn’t have posted it (dont get old)

In my case the pico is only about 5m off the ground (maybe only 4m) and the pole is one that can rock down 90 degrees to make access easy via a small  2 or 3 step ladder.

I know I will have to pull it down at least once to flash in firmware to get the flash drive feature, the version that’s in it is over 3 or 4 months old.

The hassle is the case is multi part and needs to be entirely disassembled to access the usb and is awkward to get the pieces to snap together again whilst maintaining a good seal against moisture and bugs. Then aligning the station to north (actually I think its west it needs to align to —- there is an arrow pointing in the direction) and then raising the pole so it is exactly vertical.

None of this is really terrible but it is a pain and if I can add hardware or other to remotely flash the firmware it would negate having to do this every time i want to run on a new firmware.

@Robert,
That sounds like something to explore if I could feed a serial stream to it. I can always run another cat 5, or possibly use a pair of the multiple GNDs I run up the pole, though I think a second cable might be best.

Would the software be the same as the micro-bridge? Or totally different?

Don’t go to any effort though, certainly not investing a year into the work.

Exploring further the SWD port, is that a fixed speed or could presumably long serial lines at a slow(ish) speed be possible negating a local 1455?

@Bill,
I dont think the W will be interchangeable in this case but even if it was, could you actually flash the firmware over the wifi?

I have project going, in conjunction with AndrewG, where we have a Pico-W piggybacked onto a Pico directly soldered via standard male headers making the sandwich only about 4mm high we thought there might be interference with the 2 SMPS so close to each other but that seems not to be the case. We linked all of the GNDS and the 5V input only between the 2 Picos so each run their own 3v3 power supply. These are connected to each other via GP0/GP1 in crossed wires for communication between the 2.

So if the Pico-W would allow the flashing firmware then it might be possible to piggy back one in, (although space is a premium inside the unit.)

Anyway,

Thank you all for the advice, I am leaning towards, in the absence of a way using the SWD, to fitting a usb socket externally then I could flash it via a laptop and cable.


Kind Regards,

Mick
Edited 2023-04-26 10:05 by bigmik
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 573
Posted: 04:05am 26 Apr 2023
Copy link to clipboard 
Print this post

have a look pico OTA

  May be Geoff / Peter could make use of this.
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2140
Posted: 04:07am 26 Apr 2023
Copy link to clipboard 
Print this post

A speculative idea, the Pico has pads on the underside for external USB. Use a spare pair in the Cat 5 cable to get closer to the ground.

Before attacking the existing installation perhaps test the idea on a spare Pico. I don't know how far cat 5 will carry USB so some Trial-n-Error will be needed.
Its a differential signal so it might make 5 metres on a twisted pair.
Edited 2023-04-26 14:11 by phil99
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6805
Posted: 06:42am 26 Apr 2023
Copy link to clipboard 
Print this post

You can get adapter leads from USB-A male to RJ45 female especially for this sort of thing (on Amazon). Whether one would fit in the box, together with another adapter to micro USB, is something else entirely.  :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 01:52pm 26 Apr 2023
Copy link to clipboard 
Print this post

  bigmik said  That sounds like something to explore if I could feed a serial stream to it. I can always run another cat 5, or possibly use a pair of the multiple GNDs I run up the pole, though I think a second cable might be best.

Would the software be the same as the micro-bridge? Or totally different?
Don’t go to any effort though, certainly not investing a year into the work.

Exploring further the SWD port, is that a fixed speed or could presumably long serial lines at a slow(ish) speed be possible negating a local 1455?


the 1455 code would need to be 're-plumbed': the current 1455 code provides a bridge from USB to serial, or USB to ICSP. switching between serial and ICSP is controlled by the push-button switch. to remotely program over SWD would require a bridge between serial and SWD (==ICSP). so the blocks of code it is built out of would need rearranging.

also, the asciiICSP 'interpreter' within the 1455 would benefit from some minor alterations as it is currently optimised for ICSP. while SWD command strings could be handled as-is, optimising for the specific SWD strings would provide better throughput.


SWD over longer distances at a slower speed would be 'interesting'. it is just a clock line (1-way) and a data line (bidirectional). it could be an worthwhile experiment to try out. perhaps Peter may be able to comment, as he is likely to have made far more use of the SWD software than anyone else here. it would also be interesting to look into ways of using an SWD programming adapter to program an MX170 et al!


  phil99 said  ... the Pico has pads on the underside for external USB. Use a spare pair in the Cat 5 cable to get closer to the ground


this is probably the most sensible approach to test out first. i was involved with some experiments sending USB over 'non-compliant' cables some 15 or so years ago, and found it surprisingly robust. the application was on road-making machinery (graders, hexes, etc). i would expect that repurposing a twisted pair within a Cat5 cable, over 5-10 metres, should work fine.


cheers,
rob   :-)
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4253
Posted: 03:28pm 26 Apr 2023
Copy link to clipboard 
Print this post

  bigmik said  Hi All,

I think I know that this cant be done but "asking for a friend" Actually its me but you all knew that

I have a PicoMite `up a pole' running for several months now (no watchdog either) and it hasnt crashed yet. But with the newer versions coming out now I am wondering is there a way to update the firmware without having to pull the assembly down off the pole, opening the case and flashing on my desk?

I have enabled serial console over about 20m of cat5 and can flash new code in (I use 38k baud but it worked ok at 56k, I just allowed for more reliable transfers) but the firmware is different and `generally' requires the USB to be plugged in.

Is there an method of doing this without climbing ladders?

Kind Regards,

Mick


I Guess not.Climb. When it is socketted, you could prep one so you don’t need to balance too long on that ladder.
Edited 2023-04-27 01:29 by Volhout
PicomiteVGA PETSCII ROBOTS
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 05:57am 27 Apr 2023
Copy link to clipboard 
Print this post

Hi All,

I have decided I will try to utilise one of these adapters as on reflection an extension cable would be difficult to mount in my enclosure (The enclosure looks big but the way its designed there isnt a lot of room inside).




I have one here and it is very small so I could hang it out the bottom from an accurately drilled hole and pop a `bung' in the hole when not in use.

If It becomes unworkable I will try soldering a cat 5 on the underside pads (I just looked and there are a few TP test points so presumably two are the data lines.)

I will test one on the ground and see how it goes with the cat5 cable.

Watch this space.

Regards,

Mick
Edited 2023-04-27 15:58 by bigmik
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6805
Posted: 07:04am 27 Apr 2023
Copy link to clipboard 
Print this post

D+ and D- are on pads. With 5V and GND you have a full set for USB. Keep D+ and D- on the same pair and you should be ok.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 04:17am 28 Apr 2023
Copy link to clipboard 
Print this post

Hi Mick (The Other One), All,

Well,

I have just tested the pads on the underside with this very rushed bodge job of mounting a MINI-USB with a bit of double sided tape/goop.

Why did I use a MINI? Well I had a 3m and 5m cable of USB-A (full size) to mini Male cables.



And I first tried with a 3m cable and was able to flash an old version firmware,

I then tried a 5m cable, that wouldn't work with my car camera, and I am happy to say that the firmware flashed perfectly.

I am amazed. I now need to look at what is the best way to provide this option.
As I said, Space is at a premium inside the weather station (commercial unit I stripped down) so I may not be able to fit a short m-F cable/socket into the unit easilly but a few soldered wires is a different matter. I could just cut the connector off the end on the cable and have 5m dangling down the pole but I really want to have this socketed so I could pull the unit down for maintenance when needed.

Anyway that is looking like a reasonable option for me to run with.

Thank you all for your advice.

Kind regards,

Mick (the Big one)
Edited 2023-04-28 14:18 by bigmik
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4253
Posted: 07:27am 28 Apr 2023
Copy link to clipboard 
Print this post

Hi Mick,

When you get up on that mast and do a modification, please consider also phill99's suggestion to add a capacitor to ground from the RUN pin (and maybe a pullup of 10k). For me that works great, I have modified all my pico's already on the pico board itself with a small 10nF SMT capacitor the adjacent GND pin.

It prevents reboots caused by ESD. Up in a pole, that may be happening with nearby thunder. Maybe not an issue for your application, but never the less...

Volhout

P.S. if you do the remote update, do you also have to cycle the power to get into update mode ? Does this conflict with the rest of the system on the pole ? No back-powering from other circuits through GPx pins ?
Edited 2023-04-28 17:31 by Volhout
PicomiteVGA PETSCII ROBOTS
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 08:59am 28 Apr 2023
Copy link to clipboard 
Print this post

Hi Volhout, All,

I admit that I have not fitted the cap and resistor and when I say that it hasn’t missed a beat, in retrospect, I can’t really tell if it has suffered a reboot or not. I will get the station to send a start message that can be monitored on my base station if it does restart.

I have marked a section of my brain to fit such modification when I eventually pull it down.

Re power cycle etc, of course this won’t be tested until I do the work to try it.

But.

I currently drive the ‘Up the pole’ aka UTP from a 5v dc plug pack via approx 6-7m of cat 5 that also holds the TX and RX. My intention is to NOT run 5v into the Pico from the USB (just D+, D- and GND) and keep the Pico powered as it is when running.

The modules in the UTP don’t draw a lot of power (The HC12 is probably the exception) they are all low power devices. I have flashed the firmware with all devices connected when it is sitting on my desk but with it in Situ on the roof. Well we shall find out.

All I can say is that I could successfully flash the firmware through 5m cable as if I had a short cable connected instead

Stay tuned

Regards,

Mick
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2140
Posted: 12:32pm 29 Apr 2023
Copy link to clipboard 
Print this post

Testing USB over Cat5, 4 metres is perfect including Update Firmware. 10 m almost works, loosing the plot after typing a few characters. Don't have anything in between and no spare sockets to make a joiner.

Edit
Now have it working at 7 metres.
No need to have a cable dangling outside.
CAT5e
Pair 1 - TTL Tx, Gnd
Pair 2 - TTL Rx, Gnd
Pair 3 - 5V power, Gnd
Pair 4 - USB D+, USB D-
Edited 2023-04-30 12:14 by phil99
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2140
Posted: 03:39am 01 May 2023
Copy link to clipboard 
Print this post

After joining scraps of Cat5 cable the limit for 100% reliable USB console and firmware update seems to be 8.5m.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6805
Posted: 06:30am 01 May 2023
Copy link to clipboard 
Print this post

That's very impressive. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024