I need advice on the very strange behavior of GPIO16
. I try to build new firmware for the new Meshtastic schematic where the TXEN
of the LoRa (I use EBYTE E22-900M30S module) is connected to the GPIO16
of my ESP32 WROOM-32 DevKit board. I have noticed that this pin is used for several boards as RESET_OLED
and in SerialPlugin for RXD2
. Even if I do not use SerialPlugin I have tried to reassign RXD2
to another pin. The device is working but became very hot in a short time, I measured and noticed that TXEN
(GPIO16
) is always high. I have double-checked all the code of firmware and could not see why it is happening.
In code, these pins (RXEN
/TXEN
) are set to LOW
as OUTPUT
: Meshtastic-device/SX126xInterface.cpp at e9f01de051b28c4d45e589f08102d73b48823025 · meshtastic/Meshtastic-device · GitHub
but why is TXEN
(GPIO16
) is always HIGH?
I have noticed this comment in SerialPlugin: Meshtastic-device/SerialPlugin.cpp at e9f01de051b28c4d45e589f08102d73b48823025 · meshtastic/Meshtastic-device · GitHub
As I understand it’s just initialized with pinMode(txPin, OUTPUT);
as it happens in SX126xInterface.cpp
.
There is no short or pull-up. Somewhere in the firmware set GPIO16
to HIGH
. What could it be?
Without seeing what you’re doing, first thing that comes to mind is to to check what is causing a drain on the pin. If there is no short, the device shouldn’t get warm.
Do you have a schematic to show what you’ve put together?
I get high on GPIO16 even on this schematic (notice that GPIO16 not connected): Meshtastic-DIY/Mesh_Ebyte_E22-XXXM30S.pdf at main · NanoVHF/Meshtastic-DIY · GitHub
On a new schematic LoRa TXEN connected to the GPIO16.
And it’s detected on 38- and 30-pins versions of the WROOM-32 DevKits. I suspect that GPIO16 could be high even on TBEAMs.
GPIO16 is used as chip enable for the PSRAM!
You might need to edit the arduino espressif32 sdkconfig.h and recompile. Get a platformio dev environment running, then compile the code to pull all required files. Then edit the file:
~/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/config/sdkconfig.h
you can use this schematic for reference, regarding the PSRAM:
%PDF-1.5
%
3 0 obj
<< /Length 4 0 R /Filter /FlateDecode >>
stream
xÚĽ];N&x~E^ÎDÇ9ØüÅU@SÍ» §¯:àPÓTsb èé_?¯õa?Z¹«k¹*¨ÚOZKeYÖkËvú!¥^^ÒúÏùç¯/ùå?]ÿÿßµäå_þýã¯þãKNéåÿýîÍß¿K?ÔÜ÷]ø*×ß5ù¯ÙfzÉJzáR¯ÿþ>vÿ˯^¾ !MN/}ôë¿s©^ÇW¹_Lzmv
¿%,Ô6å«#©à§ï"G¢|
}°9¡¡¯ÒÆ!4ô5Â.¹¥ÃÒߥoaõÿ¼ä«[×ÿIÿÊ?¾ßÿÚeº³8_ÿ³_¾üÞþúÇ¿ýû?þçúÍKÏéJíåÿ÷½üò_Ä~ù?_þ·ü¿¿üò¿¿üÑ/¿ûòò¿»÷9^r&ÑL¤E¼úvj´J/$´µ ¢)e5²ÕáÏÑ·5SÑQÝ×¹ÚNÔÄдïBíh¬
BÊQ .ñDJ.j;=á»_>\r}Xô>+m=¯ª ÁJ$VȬ;¢Z^.$®¦!áB¨ÊÜËjå©!%D¥#¥J\¡ù^Ô^Ò<?¢ùåÏEâ¶¹-uJÒÞ¦¥EÇqývÓEyÚ8ÅúåÖ×GZ?ËÌÇîfiýØÝÀ¼L-m^Î28 ZstlÒQ jMÎE-ÍkÈ¡vG#eãçÚdÎÅäniM<¹Ô~úå³`9^tÁtÜè gذ@¬êZt¹+ÊN\o`$®3°ÒIaW¤P{~Ó¬8VÄÄØ"±6a³ÒÒÛE#' »<`í«Q)øFMF¦àkd3¯YÀdtn?>zâ4<ñúÇNNèäe
Ì%pb4nb
÷çFMiä&^î1{è³&ö¨HzfHd+
öpÈcdN¬d7²Ý
OÓá7J¢LS&±GBÜ,%>4òaê'(b*
y#2ëNt´Aé@&*çF©ú"#^N×£m9qãqé'*2ð¼ è±vCLd&¦ÁÆf;V¢V¥ {ȳ& kg°¢3>Évè3·Uë:hÈ?Õø,z¬¾%²n°OÄS¶W´øÇÜ¢>ih4`êwTRîð½ (ëD.âÖw
¨ %uä¡Òp@(EêÍEZDåM@!±ÃU¡.-KQð52Ô7¯eY32Ï1/±«6Z}ÀºþàëjchÇÕÁjç&wÿ.0óXe<±Ý<f Ý?{¨Ýc^îAÛM$ÖbÖ¬`É1s&%û0H¢8éwL%ËoÀ¬IÉ^ÃcònÜ Î¨e` àи]iiOí«r9äúêçõKk´¿ª
.@[ÕkÂPÀ
O¯2YKÖ7Ú5k-mc K¸ÆºO¨tdg¾ÚdÚþÜ#¢ßÝøP,u̦nbý;§l]hIÞöyUvÌøgTÍYοÇz³×ýëküo¶³Õ]òuû
å+Ôþ¤óoqûFêßH¿êúÔ¿>ÓýÛ÷Ì À
.¸æ´3 ¬r:Ó@ÖyîTàóü'Õ(:ÓÁjT:Ât¦ë6L3§ýÛt¦UQ;óÁÒíW Í [ªÇ$6gn¡^ÎRÄ«2CE¥17eX>sÒ°~ñiÃâ3uϬç@L?>,ÈgÙ°¥@Üf`Õ9TÔgcä äÀ>bm`öÐ{â´bê±ÅÏ&K;#ÀÖÎôb6íiǧÓM2hhM5VM6&M1(ì2d¸AûFߣäzéoõý·¿ùÕï¿TÊ÷)ú¶ìc}_7ùÌÀ#ï²_¿Aà¿ËãëÖ8Ŧzíâ0['¬0Ð%:cxV©®_l²Ð"Ýå¢*Ð.»À±ºI·º¯u»Vim~\ß^±þjòÉTéð6 YÅjõÝX;J»Óå{ýn¤~°_.È:àÕV<ÄâM¤!£Á5®²êÜM¼áúãÔß
hwMTÍF¦ú3*¬±Þ`Y+À@6ÞX×ÝÚ!2°:4::ø¶ù
Ùæ×+ðS»ôübI}CvñËk¢MUeÖH ³GBÐlc°öè2@ÑÈvKÇ<
Ñ©¶,¯VÖO¼Ú¢ß÷Ý´V©iÔaLÉÊÚÔ¯t*ÎÈt´YRpÖ¡R.®<t`àMÖÞ¸UIO§ÄÅoÂ>@?³ R>5Ñà\ȬdµÑ®d»¨´#èë7'KN¶n±:HA2
t;¦K ^Á©ÿ*ã6Aq?ÞðÈG$tDâýľë[%³^WfÊÚ,;;G²¾¾ÉZËlÖàw
¸8Bæ6èfeík
ªòrFÍaüÕmð¯L]U:@çÇëW}ÏÆb¸ÆkO§7Z®ØÖÓWi
¼Jk06~¹u0bÌT¦LÊÚÔÜÀtL^ qÌÀz}ìJ¸8CKxÉѨ¤PIÏ0zAÜ5p)ÒQ0L¨JfèéD$ÆÚÞ3ؤãdbÎ2°`ÙÜ£LeÝ+Tºj´ í+òsØ®².S´çíu^â\òÖòHÔú§¿þùßþýËýð?üÁ//ÿ¸è_êù_ÓÒa-*f/([UÕ´]6ü®zP&1Áþ6Bÿnä:4î´b ½)oÈ.~yyJº{×eÕÉ¥X`ýï ÈÖ8¨ºXuµ¹¡¥}¥Üz«4²ÎÀ #k[+5¹U"¨INVÚ«kO~ _@ºÀ~µX^ûÕ§ò&Ûü¨¿zè
A¥,V[)\)BÆXfë
Z|³{l+Shòɧ¿$R¬}`¯¶^ "%ºgdÖiÊÀ´§¬MaZéµG¥X¬k.»7VYM§UJ¸óùÊél%Ûí%QY,õyZEØÔé¶ÄÚd?N0ÚXÅ#JvùÜfy-Q¸53£2 (kU+µFÙTÔF§éÜðWRâ¿jé¶ÄdË·¬+äÜvµÔýQ¡§.Â*jBU1«ZKL¨Jó¶ÄB²Lû^±Ý÷U#«lÄß
7Éý»Ý¾r$§íQGíÚÿÚËV¢"÷Þ7d_Ëg<öZ
:Î.¶aúèT>ºÌ6ØxT23.e`ã±ãÔJ´àÍÆ]
Ì;üF"`1a°wYnøYkG¨¿r0ÀX»¿JÆX9Deí@*ÝÞQ6'vZº|f±ÁA9ò
5U6ÐOo(°ÞP2ë
eàÚc[´R"ÎÖ¬¹íÉê®ÕÔ®¶õ%t*²êë5Í
Ny6²3cîp2b``ZPÖ¦ÔîÓ%>Þ`Ns´ÄYÌ|[â2Lty#ÕãFÊ3Q2j[{Ëz·]u[¥Ý¿rR[Ü¡áÙÚN?æqz[BülÒÐq47
e%AY9í2çzÄÕHÉÄU[ÜÜOôw ,FÝîI×pÌ#é²Mí¾ÔsÇ@Í@¦Va¬ÊÚ¯ZTmY«À `ÝT*ÀÅ2´Uh°öÆuþæ£C¾pöG û?:V\zÿæDÒ¥¯-ÿì·~wüÕ¯þÇï¿Kà½f¥¹?ö¯zumco»¬L;Ò/ÓÍÓYZè|ùzúQ쨤Ôo@çbûVC³ßiíG6I³%àÎÆ8!¢³Æ²PÙËÀ¼F¥ì¹lI¥:R¶\é׫×P·¹p{eüB@Òp¡</µ×"hí_þ¦Ìréåáª+ÈÎÕ{ÀÊr½)«o)×ÎåBh-M°V( Ár1X¡[¶ÙAJyZÜê=¶V@WZ¶YÛ2×#R.®=²¥)C©¢ÝæÙöBÚBg)ÇùøRÚ³Ö4Ûûòëÿù«ßù~p£m¨6Ø3ÜYÙ~³Zï í<)ÛSÖê%tiÄ÷ÒØ².øÆ
This file has been truncated. show original
However I strongly suggest that you choose another GPIO since PSRAM might come in handy at some point in time.
1 Like
@PlumRugOfDoom , thank you for your help!
I use VS Code with PlatformIO on Windows 10. I tried to modify CONFIG_D0WD_PSRAM_CS_IO
value in
~/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/config/sdkconfig.h
and
~/.platformio/packages/framework-arduinoespressif32/tools/sdk/sdkconfig
without any changes. I clear the .pio/libdeps
and .pio/build
all the time, but GPIO16
is still HIGH
.
I even tried to override CONFIG_D0WD_PSRAM_CS_IO
value in platformio.ini
:
; Meshtastic DIY v1b new Schematic based on ESP32-WROOM-32 & SX1262/SX1268 modules
[env:meshtastic-diy-v2]
extends = esp32_base
board = esp32doit-devkit-v1
build_flags =
${esp32_base.build_flags}
-D DIY_V2
-D EBYTE_E22
-D CONFIG_D0WD_PSRAM_CS_IO=32
-D CONFIG_D0WD_PSRAM_CLK_IO=33
No changes.
Of course, I will use different pin, but I want to clarify this issue for myself.
I am not sure if you also need to do something regarding UART2
Name No. Type Function
IO16 27 I/O GPIO16, HS1_DATA4, U2RXD, EMAC_CLK_OUT
GPIO16 also has an internal pullup, not sure if you need to disable it as well.