I'm trying to make a project using the ATSAM4LS2A microcontroller (Cortex M4), and i'm using the AtmelICE debugger. The thing is the pinout for the SWD mode also has, beside the SWCLK and SWDIO pins, also the SWO pin (which should be optional). The problem is that the SWO pin is the same as the SCLK pin that i'm using for the SPI (trying to talk to a CC1101 transceiver).
Even if i don't connect the SWO pin, when i'm debugging and trying to read a byte from SPI i always get 0, even though i'm pretty sure it should be different.
So, my first question is, how would i be able to test that the SCLK pin in working in SCLK mode and not SWO mode?
Second question: How can i disable the SWO pin in case it isn't disabled automatically when it is not connected? (if possible).
Thanks.
Electrical – Atmel SWD. Enabling normal GPIO function on the SWO pin
atmelcortex-m4debugginggpioswd
Related Topic
- Electronic – Sharing ARM SWD pins with normal pin function (on Atmel SAM D09 D10 D11)
- Electronic – How to use external ST-Link to debug/program STM32F103 MCU
- Electronic – ST-Link debugger/programmer failed to find STM32L152 MCU on designed PCB
- Electronic – STM32L MCU – SWD pin on board not matching processor pinout
- Electronic – leave SWO/TDO and TDI of J-Link floating
- Electronic – Correct wiring of Cortex-M 10-pin Debug Connector
Best Answer
I kinda forgot i posted this question here, but in the meantime I found the answer on some other site that I can't find right now.
You can disable the SWO functionality simply through this code:
Just call disableSWO() and SWO pin is disabled. I could debug while still keeping the SPI working.