Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 21:07 29 Mar 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 : PicoMite | My program is stuck and I can't make it stop?

Author Message
redrok

Senior Member

Joined: 15/09/2014
Location: United States
Posts: 209
Posted: 04:27am 04 May 2022
Copy link to clipboard 
Print this post

I'm brand new to the PicoMite. I was learning to enter a test program.
It's an endless blinking flashy LED thingy.
I stored it in flash #6.
I also did an "Option AUTORUN 6".

1. It starts and runs flashing just fine.
  However, Ctl-C will not stop it.
2. Pressing boot select while plugging in USB it starts running.

3. Cycling power it runs.

4. Pressing my added reset button to no avail.

5. In TeraTerm I disconnected the port and reconnecting it does stops.
  However no connection is made.

It appears it never sees the Ctl-C to halt the running program.

I tried all kinds of things.

What to do? Im so confused.

I haven't reloaded UF2 yet as the PiPico doesn't show up ad a new drive.

What's going on?
Is this a dangerous bug that bricks the Pico?

redrok
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 1722
Posted: 05:34am 04 May 2022
Copy link to clipboard 
Print this post

Is the following procedure what you are using to re-flash?

Unplug USB from Pico (and any other power input), wait a few seconds, press and hold down the button near the USB socket, plug the USB back in then release the button. A new drive should appear.

If that doesn't work I too am stumped.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9030
Posted: 05:40am 04 May 2022
Copy link to clipboard 
Print this post

So long as you have not done an OPTION BREAK 0 to totally disable the break, then CTRL+C should indeed break into it once it's running.

Sounds like it might be a bug.

Can you please post your blinking LED code so we can have something to experiment with.

No matter WHAT you do, holding BOOTSEL and plugging in the USB cable should bypass ANY firmware in the module, and put it into the mode for copying the uf2 file across - the fact it won't even let you do that is strange and interesting.

I'm assuming that you are connecting to a computer, not just using the USB cable as a power supply.
The bootloader code in the 2040 is on ROM from what I understand, so there is no way you can accidentally erase or corrupt that with any kind of firmware or program, so that should ALWAYS get you into uf2 file upload mode where it shows up as a wee flash drive.  The fact that that is not working for you on your module is most strange.  
Smoke makes things work. When the smoke gets out, it stops!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5867
Posted: 05:46am 04 May 2022
Copy link to clipboard 
Print this post

If the boot button doesn't work for you, try connecting to the pico port at 1200 baud. That is another way to get the firmware drive to appear.

If you are using the sample code from the manual, on my pico, I didn't have any problems with ^C

I am not adventurous enough to use AUTORUN when playing.

Jim
VK7JH
MMedit   MMBasic Help
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2282
Posted: 06:02am 04 May 2022
Copy link to clipboard 
Print this post

under linux, i've found it helps to keep holding the 'boot' button pressed until the file manager dialog pops up. this can take a couple of seconds to happen. ie:
1. press and hold BOOT button
2. tap RESET button
3. AFTER File Manager pops up, release BOOT button


cheers,
rob   :-)
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 06:18am 04 May 2022
Copy link to clipboard 
Print this post

Bloody post disappeared again...grrr.

I managed to brick my Pico one time when I tried an overclock frequency that it didn't like.

The device no-longer appeared in Device Manager and of course, it didn't show-up as a drive when I wanted to re-flash.

I had pretty much given-up but I decided to power-cycle the PC and the USB port re-appeared.

I did the flash-nuke thingy and successfully reloaded the firmware.





Craig
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5648
Posted: 06:59am 04 May 2022
Copy link to clipboard 
Print this post

Erm... which LED are you flashing, redrok?

I hope it's not the on-board green one.

That will flash no matter what you do - it's part of MMBasic and doesn't indicate that your program is running. It just indicates that the MMBasic firmware is running. Even if you take control of it to flash it in your program, as soon as your program stops running it'll start flashing again.
Edited 2022-05-04 17:01 by Mixtel90
Mick

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

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 07:03am 04 May 2022
Copy link to clipboard 
Print this post

  Mixtel90 said  Erm... which LED are you flashing, redrok?

I hope it's not the on-board green one.

That will flash no matter what you do - it's part of MMBasic and doesn't indicate that your program is running. It just indicates that the MMBasic firmware is running. Even if you take control of it to flash it in your program, as soon as your program stops running it'll start flashing again.


I didn't wanna be the one to ask  
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5648
Posted: 07:25am 04 May 2022
Copy link to clipboard 
Print this post

Well, you never know. If someone is new to these things or has only used them with the normal Pico languages then it's something they may not know about. The manual isn't particularly helpful either, it only gives a proper example for an external LED.
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: 2282
Posted: 12:11pm 04 May 2022
Copy link to clipboard 
Print this post

  Tinine said  I had pretty much given-up but I decided to power-cycle the PC and the USB port re-appeared


that is a good point that i'd forgotten about. the pico can quite effectively knock over the whole USB sub-system when it gets confused. this applies to both windows and linux. the problem was more prevalent in the early days of MMbasic running on the pico.

under linux there are magic incantations you can type into a terminal window to recover from this without cycling the PC's power. under windows, not so much so. and some more recent versions of windows may not always go through a power-down level of restart unless you are quite forceful about it.


cheers,
rob   :-)
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 12:31pm 04 May 2022
Copy link to clipboard 
Print this post

Four engineers riding in a car and the engine suddenly dies.

Chemical engineer: "Well we have plenty of fuel but maybe it's contaminated. We should drain the tank and refill with fresh fuel"

Mechanical engineer: "I believe it's a mechanical problem, pop the hood and I'll tear the cylinder head off"

Electrical engineer: "Seems to me like the ignition system just died, pop the hood and let me go through the wiring"

Microsoft Engineer: "Why don't we just try getting out of the car and getting back in again?"



Craig
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 705
Posted: 02:49pm 04 May 2022
Copy link to clipboard 
Print this post

I have had it happen ( with Pico )
that CNTRL-C will not stop a running
loop . ( More than once , but
I wouldn't be able to re - create
it now ) Should have taken notes ...
my site
 
Print this page


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

© JAQ Software 2024