INTL 3:770/1 3:770/3   
   REPLYADDR tnp@invalid.invalid   
   REPLYTO 3:770/3.0 UUCP   
   MSGID: 0ccdbc43   
   REPLY: <20240324072346.81064ff46570e669982a1f4e@eircom.net> e8da4bc3   
   PID: SoupGate-Win32 v1.05   
   On 24/03/2024 07:23, Ahem A Rivet's Shot wrote:   
   > On Sat, 23 Mar 2024 22:20:34 +0000   
   > The Natural Philosopher wrote:   
   >   
   >> On 23/03/2024 18:37, Ahem A Rivet's Shot wrote:   
   >   
   >>> 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.   
   >   
   > Instrument /Inside/ gpio_get().   
   gpio_get (X) for presumably memory mapped IO is going to be little more   
   than   
    return (iobase & (1<   
   >> I know it enters the routine, but never leaves, and the lack of GPIO   
   >> voltage suggest it is being stuck where it is.   
   >   
   > Right so the next step is the inside of the routine.   
   >   
   >>> 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.   
   >   
   > Unix tools but yes.   
   >   
   >> We are running bare metal-ish here.   
   >   
   > Ah - no way to attach a debugger via the SDK ?   
   >   
   There may be but it would be more complex.   
      
   >> Back in the day I would have used a chip emulator with hardware break   
   >> points.   
   >   
   > An ICE is always nice if someone else is paying :)   
   >   
   Precisely!   
      
   >> 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   
   >   
   > Hmm is there a minimum range spec ?   
   >   
   Not really in practical terms.   
      
   However on trawling the internet I discovered a conversation with   
   someone else *on here* (c.s.r-pi) last year, who was finding that   
   *sleep_us(x)* was highly inconsistent for certain (small) values of x.   
   Sometimes taking a day to end.   
      
   Further investigation reveals that in fact it really is a 'sleep' with   
   the processor being put in low power mode and requiring an interrupt to   
   'wake it up'.   
      
   I haven't thought it through, but it could be that too long a delay in   
   some sense might miss a complete set of send and return pulses, leaving   
   the thing stuck. Especially on a very short range echo.   
      
   So last night instead of leaving it facing a wall, I left it facing the   
   opposite wall, and it's still blinken away...   
      
   There is an alternative to sleep_us, that simply involves a tight   
   processor loop watching the clock, that might work better for these very   
   small delays.   
      
   I am going to do a statistical test on both methods at long and short   
   ranges.   
      
   (Fortunately, I managed to remove the existing radio sensor from the oil   
   tank and on shaking, could hear water sloshing around inside. After   
   emptying out and drying n the oven, it started working again. I don't   
   think +60°C made it very accurate as it then showed a full tank, but it   
   seems to have settled down to a figure consistent with what a dipstick   
   shows. So there is no urgency to get the replacement PI sensor working:-)   
      
   I am getting to really love these little PICOS, but there are a lot of   
   quirks and bugs in the hardware and software.   
      
   Thank's for your input.   
      
      
   --   
    “A leader is best When people barely know he exists. Of a good leader,   
   who talks little,When his work is done, his aim fulfilled,They will say,   
   “We did this ourselves.”   
      
   ― Lao Tzu, Tao Te Ching   
      
   --- SoupGate-Win32 v1.05   
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)   
   SEEN-BY: 15/0 19/38 90/1 105/81 106/201 128/260 129/305 135/225 153/757   
   SEEN-BY: 153/7715 218/700 840 220/70 226/17 30 100 227/114 229/110   
   SEEN-BY: 229/111 112 113 200 206 307 317 400 426 428 470 550 616 664   
   SEEN-BY: 229/700 266/512 267/800 282/1038 291/111 292/854 310/31 320/219   
   SEEN-BY: 322/757 342/200 396/45 460/58 633/280 281 412 418 420 509   
   SEEN-BY: 633/2744 712/848 770/1 3 100 330 340 772/210 220 230 5020/400   
   SEEN-BY: 5075/35   
   PATH: 770/3 1 633/280 229/426   
      
|