comparison doc/Leonardo-target @ 630:b639f7ab0007

Leonardo GPIO 2 fix
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 03 Jan 2020 07:13:51 +0000
parents 41238a8e140c
children 6edd9be81b94
comparison
equal deleted inserted replaced
629:3231dd9b38c1 630:b639f7ab0007
74 If you specify the build target as just leonardo, your fw will be configured 74 If you specify the build target as just leonardo, your fw will be configured
75 and built for the leonardo-dsp36 target. If you actually need leonardo-c05b or 75 and built for the leonardo-dsp36 target. If you actually need leonardo-c05b or
76 leonardo-dsp34 because your board has an older Calypso chip version on it, then 76 leonardo-dsp34 because your board has an older Calypso chip version on it, then
77 you will need to specify the build target as just stated - see the 77 you will need to specify the build target as just stated - see the
78 Calypso-version-override article. 78 Calypso-version-override article.
79
80 Calypso GPIO 2 configuration
81 ============================
82
83 On TI's C-Sample and D-Sample boards Calypso GPIO 2 is wired to serve as the DCD
84 output for the MODEM UART (Calypso device as DCE), and our FC Magnetite firmware
85 drives it as such on D-Sample, FCDEV3B and GTM900 targets. But this same config
86 does NOT apply to Leonardo: on the latter boards GPIO 2 is wired in a way that
87 requires it to be configured as an input to Calypso, not an output.
88
89 TI's TCS211 firmware had this Leonardo GPIO 2 situation handled in a very
90 bizarre manner: the main GPIO init code in AI_InitIOConfig() in armio.c made no
91 differentiation between D-Sample and Leonardo and configured GPIO 2 as an
92 output, then the init code in uartfax.c did the same setup again, but at the
93 end of the Init_Serial_Flows() function in the init module (which we only got
94 as init.obj, with init.c censored out) they inserted a bit of code that switches
95 GPIO 2 to be an input. What a mess.
96
97 Our handling of this GPIO 2 situation in FC Magnetite is much cleaner: we have
98 put an #ifndef CONFIG_TARGET_LEONARDO around the AI_ConfigBitAsOutput(2) call
99 in AI_InitIOConfig() so this GPIO line never becomes an output in the first
100 place, and our targets/leonardo.h configuration header defines
101 UARTFAX_CLASSIC_DTR_DCD to 0 on this target, disabling that code in the
102 uartfax.c driver.
103
104 Other GPIO and multifunction pins
105 =================================
106
107 Our Magnetite-Leonardo fw is unchanged from TI's TCS211 original in that GPIO0,
108 TSPDI/GPIO4 and DSR_MODEM/LPG pins are left configured as inputs, even though
109 the schematics we've got show GPIO0 as an output and the other two pins as
110 unconnected, in which case they should also be configured as outputs in order
111 to not float. We are leaving this aspect unchanged currently because this
112 Magnetite-Leonardo fw build target is really just a reference for practically
113 non-existent hw, and given the unknown of what other Leonardo variants may have
114 existed once beyond our known schematics, we would rather leave a few floating
115 inputs than risk causing a driver conflict on some unknown board.