platformio / platform-intel_mcs51

Intel MCS-51 (8051): development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/intel_mcs51
Apache License 2.0
56 stars 44 forks source link

STC8H1K08 upload failed #53

Closed hhgyu closed 4 months ago

hhgyu commented 6 months ago

I bought a new development board and tried to upload the firmware, but failed to upload.

There seems to be a change in the latest development board.

I successfully uploaded the firmware using STC-ISP (V6.91) from the official site.

https://www.stcmicro.com/rjxz.html

There also seems to be an update for stcgal, which we use internally.

https://github.com/grigorig/stcgal/releases

Below is the log of the failed upload.

 *  The terminal process "C:\Users\hhgyu\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: C:\Users\hhgyu\.platformio\penv\Scripts\platformio.exe run --target upload 

Processing STC8H1K08 (platform: intel_mcs51; board: STC8H1K08)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/intel_mcs51/STC8H1K08.html
PLATFORM: Intel MCS-51 (8051) (2.1.0) > Generic STC8H1K08
HARDWARE: STC8H1K08 36MHz, 1.25KB RAM, 8KB Flash
PACKAGES:
 - tool-stcgal @ 1.106.0 (1.6)
 - tool-vnproch55x @ 1.0.220407
 - toolchain-sdcc @ 1.40200.0 (4.2.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 1 compatible libraries
Scanning dependencies...
Dependency Graph
|-- FwLib_STC8 @ 1.0
Building in release mode
Checking size .pio\build\STC8H1K08\firmware.hex
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
Flash: [====      ]  37.1% (used 3041 bytes from 8192 bytes)
Configuring upload protocol...
AVAILABLE: stcgal
CURRENT: upload_protocol = stcgal
Looking for upload port...
Auto-detected: COM3
Uploading .pio\build\STC8H1K08\firmware.hex
Cycling power: done
Waiting for MCU: done
Target model:
WARNING: Unknown model F734!
  Name: UNKNOWN
  Magic: F734
  Code flash: 62.0 KB
  EEPROM flash: 0.0 KB
Target frequency: 11.062 MHz
Target BSL version: 7.3.13U
Target wakeup frequency: 34.925 KHz
Target ref. voltage: 1186 mV
Target mfg. date: 2023-01-29
Target options:
  reset_pin_enabled=False
  clock_gain=high
  watchdog_por_enabled=False
  watchdog_stop_idle=True
  watchdog_prescale=256
  low_voltage_reset=True
  low_voltage_threshold=0
  eeprom_erase_enabled=True
  bsl_pindetect_enabled=False
  por_reset_delay=long
  rstout_por_state=high
  uart1_remap=False
  uart2_passthrough=True
  uart2_pin_mode=push-pull
  epwm_open_drain=True
  program_eeprom_split=8192
Loading flash: 3041 bytes (Intel HEX)
Protocol error: frequency trimming unsuccessful
Trimming frequency: Disconnected!
*** [upload] Error 1
============================================================================================================================== [FAILED] Took 56.29 seconds ==============================================================================================================================
hhgyu commented 6 months ago

@ivankravets Can you fix this for me?

zaoshang67dian commented 4 months ago

try install stcgal. and run common like "stcgal -P auto -p /dev/ttyxxxxx -t 22481 ./pio/xxxxx/firmware.hex" in your terminate; where -P auto may be the point you failed because pio attch -P stc8 witch may incorrect; -t is thr mcu frequency; -p is com;

ivankravets commented 4 months ago

Resolved in https://github.com/platformio/platform-intel_mcs51/commit/793ef84483168484a6ce6877b49632eafc2a3c4b