firmata / arduino

Firmata firmware for Arduino
GNU Lesser General Public License v2.1
1.54k stars 514 forks source link

setPinModeCallback For SWDIO Causes Board To Crash #477

Open vindicatorr opened 3 years ago

vindicatorr commented 3 years ago

I was simplifying the StandardFirmata.ino since I was having issues with it and I think I found the cause... It would seem that there may be some pins that simply must not be touched. In the case of my STM32F4-Discovery board, it would be PA13 (pin 75), which is "JTMS-SWDIO".

I saw: https://community.st.com/s/question/0D50X00009XkfYN/debug-problem and https://www.programmersought.com/article/4917389165/ though with this one, I found no reference of 'GPIO_Remap_SWJ_Disable' in the STM32CubeF4 Drivers nor in the F4 documents.

I just added Firmata.setPinMode(PA13, PIN_MODE_IGNORE); to deal with it.