1 2 Previous Next 15 Replies Latest reply on Sep 1, 2016 6:14 AM by bWFyb2dp

    Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues

    bWFyb2dp

      Hi,

       

      I just got my Quark D2000 Developer Kit and tried to flash it with OpenOCD for the first time. However I constantly get this error:

      Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues

       

      Why would a new dev board be locked? Is there a way to unlock it?

       

      Thanks!

        • 1. Re: Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
          Intel_Alvarado

          Hi bWFyb2dp,

           

          Have you already seen this thread https://communities.intel.com/message/405074#405074 ? It has some suggestions to flash the Quark with OpenOCD.

          Try it out and let us know your results.

           

          -Sergio

          • 2. Re: Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
            MichelleC_Intel

            Hi ,

             

            One additional thing to try that should resolve most issues with JTAG : Ground Digital Pin 0 , reset the board and try to flash again.

             

            -regards,

            Michelle.

            • 3. Re: Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
              bWFyb2dp

              MichelleC_Intel & @Intel_Alvarado - thanks for hints!

               

              Setting QUARK_D2000_OTPC_DATA_WRITE_ENABLED to 1 and doing del_flash0 helped with original error. Now I can see that OpenOCD connects correctly, but after loading blinky.bin* (from QMSI examples) the user LED is not blinking and I cannot do another load_image  - all commands fail with error that target is not halted; 'reset halt/init' make the OpenOCD loose connection ("redirect to PM, tapstatus=0xffffffff, submit_pir TS_PIR_BIT did not clear, TS=0xffffffff) and only reset via SW1 button makes the connection work again (but only connection, programming and mass_erase still fail because target is running). The same happens after resetting with digital pin 0 connected to dev kit ground.

               

              I also tried to flash and debug with ISSM on Windows, but with similar results - flashing and GDB connection were always timing out.

               

              *Loading binary took a really long time - over 120s and with average speed of 0.005 kbs.

              • 4. Re: Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
                MichelleC_Intel

                Can you outline the steps you did so far and the exact errors recieved 

                 

                Did you manage to flash the ROM image ok to the board ?

                • 5. Re: Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
                  bWFyb2dp

                  1. I got the dev kit

                  2. I downloaded Linux ISSM toolchain & got QMSI from github

                  3. I built an example app - blinky

                  4. I tried to connected with OpenOCD:

                  ~/Downloads/issm-toolchain-linux-2016-05-12/tools/debugger/openocd/bin/openocd -s ~/issm-toolchain-linux-2016-05-12/tools/debugger/openocd/scripts -f board/quark_d2000_onboard.cfg
                  

                     but got

                  Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
                  

                  5. I noticed post from @Intel_Alvarado and executed following on OpenOCD console (via telnet):

                  set QUARK_D2000_OTPC_DATA_WRITE_ENABLED 1
                  del_flash0
                  reset halt
                  

                  6. Now OpenOCD connected to the board without errors

                  7. I installed full ISSM on Windows machine, imported QMSI blinky project and tried to run a debugging session via Eclipse

                  8. Debugging in Eclipse was impossible, as both GDB and OpenOCD were timing out.

                  9. I went back to Linux console and tried to program the board from OpenOCD telnet console:

                  > load_image ~/blinky.bin
                  

                  10. It finished after 120s and I restarted the board (closed OpenOCD and power cycled)

                  11. User LED was not blinking

                  12. I tried to connect with OpenOCD again to check why code is not toggling LED, but OpenOCD displays the same error as at the beginning:

                  Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
                  

                  13. OpenOCD retries to connect, but succeeds only when I press the RESET button on dev kit

                  14. All commands in OpenOCD (apart from reset [halt | init | run]) complain that target is running and should be halted first

                  15. I tried restarting with Digital PIN 0 connected to ground but it did not change the status

                   

                  Is the board still salvageable?

                   

                  Thanks!

                  • 6. Re: Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
                    MichelleC_Intel

                    Hi ,

                     

                    Yes - It should be salvageable

                     

                    I think your main issue is that you missed a step - you have no ROM loaded to the board.

                     

                    You can load the ROM from ISSM (Go to 'Intel ISSM' -> 'Update target ROM') . ISSM does include the QMSI Board Support package - the one on github is just a newer version.

                    I would advise just loading that default one from ISSM  first to verify that your board is ok.

                     

                    Then load a project from 'Intel ISSM' -> 'Import Intel QMSI/BSP Project' and browse to the 'blinky' project in the QMSI you downloaded. Build and Run it.

                     

                    There are more instructions on GitHub - quark-mcu/qmsi  on flashing ROM and Applications using the command line.. the location you flash to is important i.e. ROM runs from 0x00000000 and your Application runs from 0x00180000

                     

                    Flashing

                    For flashing the board OpenOCD must be used. You can optionally use gdb as a frontend for OpenOCD as described below.

                    You must first flash a bootstrap rom before flashing an application. Assuming the toolchain was unpacked into$HOME/issm_2016.0.019/, this can be done with:

                    $ cd $HOME/issm_2016.0.019/tools/debugger/openocd

                    $ ./bin/openocd -f scripts/board/quark_d2000_onboard.cfg

                    $ gdb

                    (gdb) target remote :3333

                    (gdb) monitor clk32M 5000

                    (gdb) monitor load_image $PATH_TO_QMSI/build/debug/quark_d2000/rom/quark_d2000_rom.bin 0x0

                    (gdb) monitor load_image $PATH_TO_QMSI/examples/hello_world/debug/quark_d2000/bin/hello_world.bin 0x00180000

                     

                    Let me know how you get on with this.

                     

                    There are major improvements in progress for our  'Out-of-the-Box' User Experience  and they will be put in place in the next couple of weeks .

                     

                    regards,

                    Michelle.

                    • 7. Re: Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
                      bWFyb2dp

                      Hi Michelle,

                       

                      I just tried flashing ROM from ISSM on Windows, but it fails the same way as app binary:

                      Open On-Chip Debugger 0.8.0-dev-g7845893 (2015-11-26-18:12)
                      Licensed under GNU GPL v2
                      For bug reports, read
                          http://openocd.sourceforge.net/doc/doxygen/bugs.html
                      Info : only one transport option; autoselect 'jtag'
                      adapter speed: 1000 kHz
                      trst_only separate trst_push_pull
                      flash_rom
                      Info : clock speed 1000 kHz
                      Info : JTAG tap: quark_d2000.cltap tap/device found: 0x0e786013 (mfg: 0x009, part: 0xe786, ver: 0x0)
                      Enabling lmt core tap
                      Info : JTAG tap: quark_d2000.lmt enabled
                      Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
                      redirect to PM, tapstatus=0xffffffff
                      Error: submit_pir TS_PIR_BIT did not clear, TS = 0xffffffff
                      Error: submit_instruction_pir error submitting pir
                      Polling target lmt.cpu failed, GDB will be halted. Polling again in 100ms
                      redirect to PM, tapstatus=0xffffffff
                      Error: submit_pir TS_PIR_BIT did not clear, TS = 0xffffffff
                      Error: submit_instruction_pir error submitting pir
                      Polling target lmt.cpu failed, GDB will be halted. Polling again in 300ms
                      Setup clock
                      adapter speed: 3 kHz
                      redirect to PM, tapstatus=0xffffffff
                      Error: submit_pir TS_PIR_BIT did not clear, TS = 0xffffffff
                      Error: submit_instruction_pir error submitting pir
                      Polling target lmt.cpu failed, GDB will be halted. Polling again in 700ms
                      Error: target running, halt it first
                      Runtime Error: scripts/board/quark_d2000_onboard.cfg:83:
                      in procedure 'flash_rom'
                      in procedure 'clk32M' called at file "scripts/board/quark_d2000_onboard.cfg", line 141
                      in procedure 'mww' called at file "scripts/board/quark_d2000_onboard.cfg", line 83
                      

                       

                      If I run OpenOCD manually I can get it to connect:

                      Open On-Chip Debugger 0.8.0-dev-g7845893 (2015-11-26-18:12)
                      Licensed under GNU GPL v2
                      For bug reports, read
                              http://openocd.sourceforge.net/doc/doxygen/bugs.html
                      Info : only one transport option; autoselect 'jtag'
                      adapter speed: 1000 kHz
                      trst_only separate trst_push_pull
                      flash_rom
                      Info : clock speed 1000 kHz
                      Info : JTAG tap: quark_d2000.cltap tap/device found: 0x0e786013 (mfg: 0x009, part: 0xe786, ver: 0x0)
                      Enabling lmt core tap
                      Info : JTAG tap: quark_d2000.lmt enabled
                      Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
                      redirect to PM, tapstatus=0xffffffff
                      Error: submit_pir TS_PIR_BIT did not clear, TS = 0xffffffff
                      Error: submit_instruction_pir error submitting pir
                      Polling target lmt.cpu failed, GDB will be halted. Polling again in 100ms
                      redirect to PM, tapstatus=0xffffffff
                      Error: submit_pir TS_PIR_BIT did not clear, TS = 0xffffffff
                      Error: submit_instruction_pir error submitting pir
                      Polling target lmt.cpu failed, GDB will be halted. Polling again in 300ms
                      redirect to PM, tapstatus=0xffffffff
                      Error: submit_pir TS_PIR_BIT did not clear, TS = 0xffffffff
                      Error: submit_instruction_pir error submitting pir
                      Polling target lmt.cpu failed, GDB will be halted. Polling again in 700ms
                      redirect to PM, tapstatus=0xffffffff
                      Error: submit_pir TS_PIR_BIT did not clear, TS = 0xffffffff
                      Error: submit_instruction_pir error submitting pir
                      Polling target lmt.cpu failed, GDB will be halted. Polling again in 1500ms
                      redirect to PM, tapstatus=0x0e786013
                      unknown break reason at 0x00000000
                      target state: halted
                      target halted due to undefined at 0x00000000 in real mode
                      Polling target lmt.cpu succeeded again
                      target running for unknown reason
                      

                      but both OpenOCD console via telnet and GDB (the one provided with ISSM) complain:

                      (gdb) monitor clk32M 5000
                      adapter speed: 3 kHz
                      target running, halt it first
                      Runtime Error: D:\devapps\ISSM_2016.0.027\tools\debugger\openocd\scripts\board\quark_d2000_onboard.cfg:83:
                      in procedure 'clk32M'
                      in procedure 'mww' called at file "D:\devapps\ISSM_2016.0.027\tools\debugger\openocd\scripts\board\quark_d2000_onboard.cfg", line 83
                      

                       

                      Is there any other way to force Quark to stop on OpenOCD attach?

                       

                      Thanks!

                      • 8. Re: Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
                        MichelleC_Intel

                        Apologies for the delay getting back on this one...

                         

                        The ISSM does a 'reset_halt' as part of the process when flashing the ROM - however in this case it seems there is somthing running that it cannot stop.

                        Can you try to do a 'mass_erase' on the board as described in the last section this thread Re: How to back to factory mode?

                         

                        If that is sucessful try flashing the ROM again.

                         

                        The ROM has a function that will stop execution if GPIO Pin 13 (DIO 0 on the CRB ) is grounded so that you can access JTAG in the case  in case of any probelms  - However this will not work if there is no ROM loaded.

                         

                        -- Michelle.

                        • 9. Re: Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
                          bWFyb2dp

                          Hi Michelle,

                           

                          I'm afraid that mass_erase has the same issue (I tried with GPIO 13/DIO 0 pin grounded and not) and the result is always the same:

                          Screen Shot 2016-08-02 at 21.08.56.png

                          Like in previous post OpenOCD always starts with "Error: submit_pir TS_PIR_BIT did not clear, TS = 0xffffffff" error messages, which are gone only if I reset the board physically with RESET switch. Executing "reset halt" in console brings back the issue, all other commands (including mass_erase, del_flash0) always return with "target running, halt it first" message.

                          1 of 1 people found this helpful
                          • 10. Re: Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
                            Intel_Alvarado

                            We’ll run some tests to replicate this issue. We’ll contact you soon.

                             

                            -Sergio

                            • 11. Re: Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
                              invaderg

                              I'm sadly having this same issue Any updates?

                              • 12. Re: Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
                                MichelleC_Intel

                                Hi

                                 

                                I have just run though your steps and it seems that you have cleared the OTP bit ...

                                 

                                I tried loading the 'blinky' image as you did - but becase I had not run the 'set QUARK_D2000_OTP_WRITE_ENABLED 1'  it failed and displayed the error below.

                                You had already run that command in the same session in order to erase the flash so you unfortunately suceeded in loading the image to that area of memory. The board is not recoverable from this state.

                                 

                                > load_image c:\\temp\\blinky.bin

                                Trying to clear the OTP bit at address 0xFFFFE000, this will lock further writes to the flash ROM after reset.

                                The QUARK_D2000_OTP_WRITE_ENABLED variable isn't set to 1 so the operation wasn't performed.

                                The following command will allow it: set QUARK_D2000_OTP_WRITE_ENABLED 1 in procedure 'load_image'

                                 

                                The correct process to flash the board is :

                                1. FLash ROM  (using ISSM or the commands provided on GitHub README

                                2. Flash Application Image (using ISSM or commands provided on Github README

                                 

                                GitHub - quark-mcu/qmsi: Quark MCUs HAL

                                 

                                If correct process if followed then JTAG lock issues are recoverable by Grounding Digital Pin 0 / resetting the board / and reloading the ROM

                                 

                                regards,

                                Michelle.

                                • 13. Re: Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
                                  invaderg

                                  So to be clear, both the original poster and my boards are likely bricked?

                                   

                                  It's unfortunate that the error message is not explicit about why it is trying to clear the OTP bit. Would it be possible to check that a ROM has been loaded before prompting the user to set QUARK_D2000_OTP_WRITE_ENABLED 1?

                                   

                                  Guess I should order a new chip and rework my board

                                  • 14. Re: Error: tapstatus invalid - scan_chain serialization or locked JTAG access issues
                                    Intel_Alvarado

                                    It seems that from the description posted above the boards are not recoverable .I’m not sure if it’s possible to check if the ROM has been loaded before prompting the user that message but I’ve never had issues loading the ROM using ISSM. By the way, there’s a new ISSM version available here http://www.intel.com/content/www/us/en/embedded/products/quark/mcu/d2000/software-and-drivers.html .

                                     

                                    I’m sorry to hear you had issues using your board. If you decide to order a new one and have any questions please post them on the forum, we’d be happy to help you.

                                     

                                    -Sergio

                                    1 2 Previous Next