Shop OBEX P1 Docs P2 Docs Learn Events
Noticed something funny on the P2 booting — Parallax Forums

Noticed something funny on the P2 booting

I was trying out my new boards and I had a bug in my code - I never have bugs in my code so it must have been an aberration as I haven't had any bugs since my last bug ;)

So I tried a working board, the P2-EVAL RevB with a RevB chip. I had a very simple RGB LED connected to the P0-3 pins with P0=GND (common) and 1=Green, 2=Blue, 3=Red.
When powering up via USB and then booting from microSD I noticed the blue LED flashing before the code to flash this LED could possibly be executing. When this was flashing I noticed that the P2Eval leds P56 & P57 turn on for a short time and P58-61 flash while booting from the SD card. Then my code starts flashing the RGB LEDs. But it's the flashing of the P2 while P0 must be outputting low while the P2 is booting from the microSD that is unusual. Has anyone seen this or can confirm this as it seems these lower P2 pins might be being driven while the P2 is booting up?

I'll do some more tests on my own pcb a little later but thought I'd post before I forget about it.

Comments

  • jmgjmg Posts: 15,173
    Could some debug code be left in the ROM ?
    What does a scope say about the lower pin activity relative to booting sequence ?
  • Cluso99Cluso99 Posts: 18,069
    jmg wrote: »
    Could some debug code be left in the ROM ?
    There's no debug code in the ROM. But I never checked what Chip does with the smart pins for autobauding. I know he uses P0 & P1 but I didn't think he uses P2.
    Perhaps during bootup the I/O pins are being driven briefly???
    What does a scope say about the lower pin activity relative to booting sequence ?
    No idea.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-11-01 08:59
    Isn't this your code?
                       DAT
                       ''################################################################################################
                       ''##    LMM Monitor - HUBEXEC code...                                                           ##
                       ''################################################################################################
    fca78                              orgh
                       
                       ''-----------------------------------------------------------------------------------------------
                       ''      RESET BOOTER SERIAL INTERRUPTS & AUTOBAUD - KEEP SMART UART RUNNING
                       ''-----------------------------------------------------------------------------------------------
    fca78     fd640025 _reset_booter   setint1 #0                              ' disable int1
    fca7c     f527f403                 andn    dira,#3                         ' reset smart pins on P0 & P1
    fca80     fc0c0001                 wrpin   #0,#rx_ths                      ' clear P1 rx_ths mode
    fca84     0c0c0000         _RET_   wrpin   #0,#rx_tne                      ' clear P0 rx_tne mode
    


    EDIT: I see Chip is using this for autobaud and you are just clearing them.
                               rx_pin          =       63              'pin serial receiver
                               tx_pin          =       62              'pin serial transmitter
                               spi_cs          =       61              'pin SPI memory select          (also sd_ck)
                               spi_ck          =       60              'pin SPI memory clock           (also sd_cs)
                               spi_di          =       59              'pin SPI memory data in         (also sd_di)
                               spi_do          =       58              'pin SPI memory data out        (also sd_do)
                               rx_ths          =       1               'pin autobaud time high states
                               rx_tne          =       0               'pin autobaud time negative edges
    
    '
                       ' Autobaud ISR - detects initial "> "
                       '
                       '             falls |--7---|
                       '        $3E --> ..10011111001..10000001001..
                       '               highs |-5--|
                       '
    fc1a0 11d fa8ed200 autobaud_isr    rdpin   a0,#rx_tne              '2      get fall-to-fall time   (7x if $3E)
    fc1a4 11e fa8ed401                 rdpin   a1,#rx_ths              '2      get high time           (5x if $3E)
                       
    
  • Cluso99Cluso99 Posts: 18,069
    The monitor code is not executing in an SD Boot sequence. I don't do any autobaud cleardown when my SD boot code is called from Chip's booter.
    It just seems strange i/o pins 0 & 2 seem to be driven while booting. There is enough drive between these two pins to drive my led. P56 & P57 are also on for a short time but this could just be the LED driver chip glitching. P58-61 flash as the the flash is being checked and then the SD is being read. Once the code is loaded these stop.
Sign In or Register to comment.