Cart New Account Login

HomeAbout usProductsSupportForumsBlogCustomer Service

Please accept the use of cookies on our site

At PEmicro we use web browser cookies in order to provide you with an enhanced experience and in order to be able to do things like shopping cart processing and identify you when you login to our website.

Click here to accept

search inside this forum
search inside all forums
How to use Cyclone FX with SAMD21G18A
Jonathan M. May 19, 2017 at 01:19 PM (13:19 hours)
Staff: Johnny N.

  • Hi community!

    How can I flash a SAMD21G18A with Cyclone FX?

    I'm getting an error 0007, which states that cannot enter debug mode. And documentations says Error enabling module.

    I already used the script wizard in order to create a valid *.sap image for the device. Double checked the pin layout and is correct.

    What can be wrong?

    Thanks a lot!

    Kind regards,
    Jon M.


    • Jon,

      If you are having problems in stand alone, you should try to debug and troubleshoot the issue from the PC first using the GUI programming software. Please try to connect to the board with progacmp_cyclone.exe.

      The microcontroller is the Atmel SAMD21G18A.

      How are you providing power to the target board?

      Did you try the lowest BDM Debug Speed frequency setting?


      • Hi there Johnny!

        Ok, done the usage of the progacmp.exe, but it says that it cannot communicate with target processor. Please check your connections between the cable and the target and make sure the target has power.

        The target is powered. The power configuration is the default one at the Cyclone that is, the target is powered independently.

        Tried to communicate with default frequency and the lowest one, with the same error message.

        • Is Vdd and Vss connected on your programming header?

          I assume you are using SWD (and not JTAG). Did you check the Use SWD box in the progacmp?

          • Yes they're connected.

            Regarding the SWD, you're right, we're using SWD and indeed the box is checked.

            • Is there anything unusual about your setup that I need to be aware of? Perhaps you are connecting the Cyclone FX to the target board with an adapter or a much longer  ribbon cable than we supplied?

              Another test you can try is to power the target board using the Cyclone FX. Make sure you install the right jumpers to the Target Power header. Refer to the documentation.

              Can I see a snippet of the debug header part of the board schematic?

              I'm really sorry about the trouble.

              • Nothing unusual I suppose... Normal cable length...

                Hardware team says that there should be no difference, since we are already debugging and programming with the Atmel ICE, which doesn't power the device which is connected with (via SWD).

                I'll send you the schematic snippet via mail, cause I can't find an option to put it here.

                No problem, strange things happen often! :)

                • I just tested my Cyclone Universal FX and Cyclone ACP FX on an eval board containing the Atmel SAMD21J18 ( same procedure to enter debug mode as the SAMD21G18A ) and I had no trouble programming it. Your debug header also looks perfectly fine. Typically, in this situation, we ask you to first test the Cyclone with an eval board to determine if there is something wrong with the Cyclone and then send us your target board so we can debug the issue more efficiently and resolve it quickly. This is very unusual and I don't see anything obviously wrong with the setup.

                  • Hi Johnny!

                    Thanks a lot for the follow up!

                    How did you connected the SAMD21J18A? ñ_n

                    I have one of those too.

                    Kind regards,

                    Jon M.

                    • The SAMD21J18A eval board doesn't have a mini 10 or mini 20 connector. We had to cut a ribbon cable and solder its wires to test points on the board and make our own connector.

                      • Oh... I'll talk with hardware folks... And get back to you after testing the board.

                        • Ok! If it is easier for you to just send us a target board, we can pursue that option.

                          • Hi there!

                            Ok, hardware folks are kinda hardcore busy right now, and I'm not able to send the target device to you, sorry.

                            Can you share an schematic of your SWD connection to the test points. I already saw where are the SWDIO and SWDCLK at the microcontroller, but haven't seen where and how can I connect a bus interface.

                            Thanks a lot! :D

    • I have the SAMD21 Xplained PRO.

      • Ok, meanwhile... I have a SAMD21E18... I'll test it since we adapted a SWD for it not so long ago, lucky us we kept it. 

        Does that one work to the testing we're doin'?

      • Hi again!

        We managed to connect it to the SAME21E18, and now we could connect to the target module SAMD21G18 with the progacmp.exe tool.

        However, when we create an image for testing, we choose the corresponding arp file, and we only erase or reset the module, but, same error when we press the start button.

        Any hint?

      • Also tested with a valid srec file in order to program it. But same error.


  • Hi,

    What settings did you use to connect to the SAMD21E18 board?

    I would like you to try a full programming cycle on this board with the PROGACMP software only.

    - Choose algorithm
    - Specify srecord
    - Erase Module
    - Program Module
    - Verify Module


    • Hi Johnny!

      I connected via SWD the devices.

      I opened progacmp.exe, selected the corresponding *.arp for the SAMD21E18.

      Specified an srecord containing a infinite loop script from source code.

      Erased module.

      Programmed module.

      Verified module.

      No issues or error messages obtained. Any recommendation?

      Kind regards,

      Jon M.

      • This is good. It means the Cyclone FX is not broken/defective.

        What do you see if you perform the same test process on your SAMD21G18A board?

        • Hi Johnny!

          Good news! Both devices programmed succesfully via progacmp.exe

          What can be the proble of the image and the button routine with Cyclone? D:

          • Can you email me a screenshot of the settings you configured in progacmp.exe and in the Image Creation utility?

    • P.D.: Default options left.

  • We know that the SAMD21G18 works in PROG so the hardware is fine. The only other option that we could try is adding a 300 ms delay after reset. This is sometimes necessary for boards with Low voltage supervisor and reset ICs. With your board, PROG works but not standalone so the issue is probably not that it needs a rest delay. It's also a good idea to select a very low frequency (Debug Shift Speed < 25) in standalone mode until we can establish stable communication between the Cyclone and the target. 

    Is there any way for you to loan our engineering team a target board in the next week or two? They can analyze debug communication with a logic analyzer and use a debugger to see where exactly it is failing. With your board, they can quickly resolve this issue.

    • Bravo! Johnny! xD

      Thanks a lot, we managed to program the target device with that observation of yours.

      I used down to 1ms to "After reset, delay X ms before contacting target and enter programming mode"

      Why is this? We didn't know the Low Supervisor supervisor unitl your comment... Can you explain some more of that? :)

      With 1ms it takes 8.09 seconds to fully program the target. Can we do something in order to program it faster? Or is it the maximum we can get since we have the hardware as it is?

      Kind regards,

      Jon M.

      • Great to hear.

        I actually mean "Low voltage supervisor and reset" IC. This option tells the programming pod and software to wait X milliseconds so the reset line can rise and stablize before driving the processor into debug mode.

        What you should do is pick a very slow BDM Debug Speed and make sure that communication is stable and there are no random programming or verify errors. Once you have established that programming is solid, then you can keep increasing the BDM Debug Speed and testing until you get to the highest.

        • Hi! :D

          Yeah, it accepted the highest BDM without issues, and indeed the time is pretty much better than the beginning.

          Guess it can be said to be solved.

          Anything else that you suggest to be taken into account?

          • I recommend adding a note about the reset delay into your documentation on the programming procedure and save a copy of the configuration script by going to File -> Save Script so you can easily rebuild the SAP file if you needed to.

            • Got it, will do.

              Many thanks for your time and attention Johnny!

              Have a nice day! :D

              Kind regards,
              Jon M.

Add comment

   Want to comment? Please login or create a new PEMicro account.

© 2018 P&E Microcomputer Systems Inc.
Website Terms of Use and Sales Agreement