Deutsch   English   Français   Italiano  
<utnkjj$3t5m0$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!feeds.phibee-telecom.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: The Natural Philosopher <tnp@invalid.invalid>
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Need help with PI PICO...
Date: Sat, 23 Mar 2024 22:20:34 +0000
Organization: A little, after lunch
Lines: 53
Message-ID: <utnkjj$3t5m0$1@dont-email.me>
References: <utn4f2$3p985$1@dont-email.me>
 <20240323183723.b2902fb94d75422b924c1bc7@eircom.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 23 Mar 2024 22:20:35 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="02773e8b0c26e99995a7aebdd3f578a7";
	logging-data="4101824"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/A67/6Ics/pk4clPkBCcQp3lwAajlHOKk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:W4kVAJOUNZta53HTyxUyI8v7Kew=
Content-Language: en-GB
In-Reply-To: <20240323183723.b2902fb94d75422b924c1bc7@eircom.net>
Bytes: 3008

On 23/03/2024 18:37, Ahem A Rivet's Shot wrote:
> On Sat, 23 Mar 2024 17:45:05 +0000
> The Natural Philosopher <tnp@invalid.invalid> wrote:
> 
>> It would seem from the pin states that it gets permanently stuck in
>> 	
>>
>> while(!gpio_get(ULTRASONIC_IN))
>> 		;
>>
>> Can anyone cast any light on this one?
>>
>> Or suggest a bug hunting methodology?
> 
> 	Assuming you have access to the source of gpio_get() instrument the
> inside of it with tracers (I'd use printf if there's anything listening to
> stdout - otherwise find somewhere to put breadcrumbs that you can see in
> real time (in ancient times I'd just watch the blinkenlights). Wait for it
> to lock up and see what it's doing.
> 
Well I did. That's how I got this far.
I know it enters the routine, but never leaves, and the lack of GPIO 
voltage suggest it is being stuck where it is.

My choice tree  is between the GPIO out signal never being received by 
the ultrasonic module, or the GPIO in signal is being missed by the Pi 
PICO on account of possibly some interrupt masking its appearance until 
it is too late and its gone low again.


> 	Alternatively run it under strace or similar and wait for it to
> lock up or wait for it to lock up and attach gdb (you'll want to compile
> with -g for that).
> 
AIUI those are linux tools.

We are running bare metal-ish here.
Back in the day I would have used a chip emulator with hardware break 
points.
And a cost of hundreds of thousands.

> 	There's three - hopefully one of them will shed some light.
> 

It's odd, it may be something to do with short ultrasonic distances.  I 
have the PCB just lolling around on the desk, and facing a wall a few 
inches away seemed to make it crash moire predictably

-- 
“Puritanism: The haunting fear that someone, somewhere, may be happy.”

H.L. Mencken, A Mencken Chrestomathy