HelTecAutomation / Heltec_ESP32

Arduino library for Heltec ESP32 (or ESP32+LoRa) based boards
Other
579 stars 219 forks source link

Cannot compile WiFi_LoRa_32_V3_FactoryTest_V2 #145

Open romoloman opened 1 month ago

romoloman commented 1 month ago

During linking the linker raise the following error:

undefined reference to `ex_32k_start_cnt'

I have installed the latest HELTEC ESP32 development framework following the instructions in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/blob/master/InstallGuide/windows.md and the latest 2.0.1 library using Arduino 2.3.2 library manager.

where is the ex_32k_start_cnt variable defined ?

If I remove the following part in setup() the example links correctly:

if(ex_32k_start_cnt>5) { VextON(); delay(100); factory_display.init(); factory_display.setFont(ArialMT_Plain_16); factory_display.setTextAlignment(TEXT_ALIGN_CENTER); packet ="EX 32K ERROR"; factory_display.clear(); factory_display.drawString(64, 24, packet); factory_display.display(); while(1); }

what is ex_32k_start_cnt supposed to count or do ?

Best regards

rodrigobutta commented 1 month ago

After some hours of digging, I've found this Issue that explains that, it appears that indeed was an error in the Heltec ESP32 that they fixed it on a PR of Mar 27 (while the last release is from Mar 22), but Heltec has still not published the release. For others, downgrading worked, not for me, at least not with the LoRaWan_APP library. So I hope they publish this soon (more than a month already, sad).

https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/issues/248

MiningPickaxe commented 16 hours ago

The ex_32k_start_cnt seems to be linked to an external 32K RTC. To me it looks like the code is trying to check if the RTC is working properly. The variable might count something like start attempts or similar. If the RTC didn't initialize/start properly, it shows text on the screen "EX 32K ERROR".

I don't see a RTC chip in the schematic published by Heltec for the v3.1, so I assume this code has been added for some internal test unit or maybe a future revision which includes a dedicated rtc.

It should be safe to remove the

  {
    VextON();
    delay(100);
    factory_display.init();
    factory_display.setFont(ArialMT_Plain_16);
    factory_display.setTextAlignment(TEXT_ALIGN_CENTER);
    packet ="EX 32K ERROR";
    factory_display.clear();
    factory_display.drawString(64, 24, packet);
    factory_display.display();
    while(1);
  }

to get it to compile. All it does is output an error in some edge case during startup.