tarxvftech / FCS-152

FCS-152 PRC-152 clone software. Warning: Do not flash unless comfortable with arduino IDE.
18 stars 3 forks source link

After flash radio will not boot #73

Closed CorruptHart closed 4 months ago

CorruptHart commented 4 months ago

So I flashed your release and the radio will not boot, when power button is pressed it just makes a short speaker noise when released, no light or booting on the screen. Please help with this I really hope this didnt brick the radio, but your instructions say this is recoverable. Could you please give me instructions on how to fix this with another flash hopefully; What software and settings do you recommend?

tarxvftech commented 4 months ago

That's interesting, as it suggests it didn't fully flash somehow or there's some kind of incompatibility. The only release in this repo has no issues with any known (ESP32 based) FCS-152 radios - it was the officially released firmware with a couple minor bugs fixed. I'm happy to help, but I'll need your commitment to figuring this out. No giving up.

You can't really brick this particular radios main chip. That you were able to flash it at all kind of suggests it'll be fine. You can reassure yourself by looking at the output of the serial port from the radio - the bootloader will happily chirp some text at you over serial during that short speaker noise. That nothing is happening past that suggests the bootloader isn't loading a valid firmware somehow.

So, one step at a time. Let's start with:

  1. your description of the radio,

  2. any information you have about the hardware and software revisions if possible,

  3. and most importantly linking to the exact .bin you flashed

  4. and the tool you flashed it with

  5. and a quick description of the flashing procedure you followed.

  6. Tell me a little about your knowledge and tools available: Can you check the serial port output without specific instructions? Have you ever used the Arduino IDE or done embedded development? What OS are you on?

CorruptHart commented 4 months ago

I am very happy you replied first off, I will certainly stick with this to figure it out, thanks in advance.

  1. I have an FCS 152

  2. Device : FCS PRC-152-N Version: Rev 2.0.000 BOOT Rev 0.0.003

  3. I tried to flash the bin test152.ino.bin which resulted in this, and then I tried to flash the official firmware hoping that would fix it , FCS PRC152-N 2.1.1226.bin , which it did not, resulted in the same error.

  4. NodeMCU PyFlasher; 4a. I tried to compile the source from your ZIP file and use arduino ide but it threw out the error "driver/dac_common.h: No such file or directory" so Im unsure if I have to add files to the source directory or reference them elsewhere I know surface level arduino ide program at best. This was with ESP32-WROOM-DA Module selected on port 4.

  5. The upgrade wouldnt take from the CPS program so I figured hey why not give your method a try, so I opened NodeMCU PyFlasher, held down 9 and the power button, released 9, kept holding power button and then flashed the BIN in your releases with and it went through, said

Command: esptool.py --port COM4 --baud 115200 --after no_reset write_flash --flash_size detect --flash_mode dio 0x00000 C:\Users\Corrupt\Downloads\test152.ino.bin

esptool.py v3.0 Serial port COM4 Connecting..... Detecting chip type... ESP32-S2 Chip is ESP32-S2 Features: WiFi Crystal is 40MHz MAC: 60:55:f9:d7:5a:0c Uploading stub... Running stub... Stub running... Configuring flash size... Auto-detected Flash size: 4MB Compressed 845552 bytes to 553335... Wrote 845552 bytes (553335 compressed) at 0x00000000 in 50.0 seconds (effective 135.3 kbit/s)... Hash of data verified.

Leaving... Staying in bootloader.

Firmware successfully flashed. Unplug/replug or reset device to switch back to normal boot mode.

so I removed power a couple seconds after that message and we are here now unfortunately not booting just making speaker noise.

  1. I know a pretty good amount computers, networking and a small bit about flash programming boards from 3d printers and klipper. Currently on Windows 11 but have Debian on my laptop. The Serial Monitor via Arduino IDE for the com4 port it is on goes from quiet when powered off to spamming alot about "invalid header: 0x6d616e79" here is an example with some invalid header repeats removed for size reasoning

ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT) invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616e79 invaESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x7 (TG0WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT) Saved PC:0x4001276a invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616e79 inva�ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x10 (RTCWDT_RTC_RST),boot:0x8 (SPI_FAST_FLASH_BOOT) invalid header: 0x6d616e79 invalid header: 0x6d616eESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x7 (TG0WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT) Saved PC:0x4001276a invalid header: 0x6d616e79 i�ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x10 (RTCWDT_RTC_RST),boot:0x8 (SPI_FAST_FLASH_BOOT) invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616eESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x7 (TG0WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT) Saved PC:0x4001276a invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid header: 0x6d616e79 invalid head�ESP-ROM:esp32s2-rc4-20191025 Build:Oct 25 2019 rst:0x10 (RTCWDT_RTC_RST),boot:0x8 (SPI_FAST_FLASH_BOOT) invalid header: 0x6d616e79

  1. Im pretty sure it could still be flashed so Im hopeful at least

this is the com port output when put holding down 9 and powering on

[21:54:30]ESP-ROM:esp32s2-rc4-20191025 [21:54:30]Build:Oct 25 2019 [21:54:30]rst:0x1 (POWERON),boot:0x0 (DOWNLOAD(USB/UART0/1/SPI)) [21:54:30]waiting for download

If flashed via the same procedure, hold down 9, then power on, then flash with ESPHOME-Flasher, i get same result of no power on screen and speaker flash, but the com port output is just this no repeating errors trying to boot? So Im pretty sure Im just using the wrong combination of things, I wish I could figure out the way you recommend to flash the bin or how to setup IDE properly.

[21:50:47]ESP-ROM:esp32s2-rc4-20191025 [21:50:47]Build:Oct 25 2019 [21:50:47]rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT) [21:50:47]Invalid chip id. Expected 2 read 0. Bootloader for wrong chip? [21:50:47]ets_main.c 386

tarxvftech commented 4 months ago

Okay, awesome! Your radio will be fine. I not sure those are the right arguments to esptool in either case for this radio, which might be the core problem. Unfortunately I don't know the right arguments to esptool.

For using the arduino stuff, make sure you check out the release tag (git checkout xvf_2.1.000 I think it would be). The master branch is in a broken state. That's probably your easiest way forward for now.

I can't believe I didn't write this down anywhere before, but settings that are known to work - I just refigured it out: ESP32S2 Dev Module No higher than 460800 baud serial on my machine (was twice that by default!). Looks like other stuff can be left at defaults, but here's all the settings that worked for me just in case: (esp32:esp32:esp32s2:UploadSpeed=460800,CDCOnBoot=default,MSCOnBoot=default,DFUOnBoot=default,UploadMode=cdc,CPUFreq=160,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=default,DebugLevel=none,PSRAM=disabled,EraseFlash=all,JTAGAdapter=default)

I run NixOS and also had to stop ModemManager, since it was hogging the serial port.

Edit: I have the radios on my desk and tomorrow will try to figure out how to flash with one of the web esptool.py setups to have something easier.

CorruptHart commented 4 months ago

I do believe my issue is this is a fresh install of Arduino IDE 2.3.2, I added board manager https://dl.espressif.com/dl/package_esp32_index.json for the ESP32s and then I run into the issue of error after trying to verify / compile .

5 | #include "driver/dac_common.h"
  |          ^~~~~~~~~~~~~~~~~~~~~

compilation terminated. exit status 1

Compilation error: driver/dac_common.h: No such file or directory

Which I believe references libraries that can be installed on Arduino IDE via Sketch then Include Library , do you happen to have a list of libraries that you have installed? I'm just guessing this based on the list as I am new to Arduino IDE compiling.

include "driver/dac_common.h"

include "freertos/FreeRTOS.h"

include "freertos/task.h"

include "freertos/queue.h"

I certainly would appreciate the esptool.py for something easier, or just a little more back and forth about how you setup IDE for this compile, I'm assuming I am missing something simple with IDE configuration but I am just learning hints via google.

tarxvftech commented 4 months ago

Hm. I think you're right. I'm on Arduino 2.2.1 for the record. For libraries I have

ArduinoJson 7.0.3
AutoConnect 1.4.2
PageBuilder 1.5.6

And that's all it lists.

In Boards Manager I have quite a few more listed but only the Arduino AVR and ESP32 boards installed. For Arduino AVR Boards I have 1.8.6. I have esp32 2.0.11 by espressif, which appears to be way out of date.

With a more modern esp32 3.0.1 package installed, I immediately run into the same problem you did

Compilation error: driver/dac_common.h: No such file or directory

Testing some more shows that esp32 2.0.17 works fine for me with no other changes, so it appears there were breaking changes to get to esp32 v3.x.y, which would make sense as that looks like semantic versioning.

CorruptHart commented 4 months ago

Appreciate your help on this, I was able to compile and upload the firmware when rolling back the board manager to 2.0.17 and the radio is now functional again! I am now on XVF 2.1.000.

Have you been able to use a method of ESP32 flashing to update to the latest 2.1.1226 by any chance? Unfortunately I updated the KDU to 2.1.1226 and need the radio to match now, and am still getting failures to connect on the FCS CPS software revision 1.0.000 and 1.1.000. Thanks again in advance.

Edit: I actually figured out how to web flash the .bin file, I used https://adafruit.github.io/Adafruit_WebSerial_ESPTool/ and first box only, pasted offset 00010000 from the arduino ide and used the official 2.1.1226 the radio actually booted into 2.1.1226 and now has the wifi control menu, and boot rev 0.1.0000.

tarxvftech commented 4 months ago

Excellent, glad to hear it! And thanks for the report on the web flasher, that's awesome! I'll try that too!