ATSAMD11C14 - DISABLE SWD PINS FUNCTION

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello

I have a small problem with SWD lines ...
These pins have default detection of low and high states enabled.
When I connect the sensor to these lines, the processor will not turn on. It behaves like it would go into debug mode.

How to disable debug mode for SWD ports and switch them to normal GPIO mode. I tried to use the function
"void pin_set_peripheral_function (uint32_t pinmux)" from the AFS library but does not work.
I searched quite a lot on Google but I did not find the answer.

Has anyone solved this problem?

 

Regards

Thomas War

 

Last Edited: Mon. Jan 15, 2018 - 06:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you really that stuck for pins that you will sacrifice your debugging capability??

 

surprise

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think so, the design is very small, it uses all available pins in the small ATSAMD11C14 processor.

Maybe it would be worth thinking about a larger processor but at the current state wants to consider the other possibilities. Finally,

Atmel's documentation in the description of the MUX function allows you to use them as a normal GPIO, so why not try?

Do you know how to do it?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had no problem doing that on a SAMD21. I don't use ASF. Therefore, I'm not familiar with pin_set_peripheral_function. I think I used something like this to switch SWCLK to GPIO:
PORT->Group[0].PINCFG[30].reg &= ~PORT_PINCFG_PMUXEN

Last Edited: Mon. Jan 15, 2018 - 07:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I tried your code. unfortunately it did not help, but I discovered something else ...
The situation described by me occurs in the moment when I turn on the power supply to the processor.

I measured the voltage on the SWCLK line, and performed the test. when the voltage on this line is below 1.8V, the processor does not execute the code (I think that it detects the debug mode immediately and stays in it).
if the voltage exceeds 2.4V to 3.3V then the processor turns on normally.

Soo. Are there any fusebits that attach debug?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is probably in the "CPU Reset Extension" state when SWCLK is low.
No, I'm not aware of any such fusebits.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, 

 

I use a SAMD21E, for space saving, I connect an input tu SWCLK.. This input is most of the time LOW. 

So when I press the RESET button it always go into debugging mode. In documentation I read this is called "CPU Reset Extension".

 

Is there a way to disable this ? With fuses or registers ?

 

I tried those solutions but no ones works :

- PORT->Group[0].PINCFG[30].reg &= ~PORT_PINCFG_PMUXEN

- PORT->Group[PORTA].PINCFG[30].bit.PMUXEN = 1;

- PORT->Group[PORTA].PINCFG[30].bit.PULLEN = 1;

 

I want to disable this permanently to be sure that when RESET is pressed chip doesn't go in debugging mode ! 

Thanks a lot to who can help me !