zerog2k / stc_diyclock

STC DIY Clock redux (STC15F204EA, STC15W404AS, STC15W408AS)
MIT License
173 stars 66 forks source link

Some improvement #49

Closed serybva closed 2 years ago

serybva commented 4 years ago

Fixed compilation failure when using WITHOUT_* flags Updated the readme with flashing feedback on OSX with FTDI and CP2102 chips

Thanks a lot for the good work

zerog2k commented 4 years ago

hi @serybva thanks for the contribution looks like the main contribution is handling of new macro option WITHOUT_DATE Can you resubmit a clean PR with only this? (Readme and whitespace changes don't seem generally helpful, and the various other make vars can be overridden at compile time, depending upon individual user's env, e.g. STCGAL=stcgal make flash etc)

zerog2k commented 4 years ago

if you havent tried it, I'd also suggest trying platformio for building - it works pretty good in most cases.

zerog2k commented 4 years ago

also for what it's worth, I just tried flashing w/ CP2102 on Mac, and I notice on stc15w408as, with latest stcgal, I can no longer flash with setting handshake baudrate... I get error:

Trimming frequency: Serial port error: pulse timeout

If I remove those options and let it flash normally, it works again...

$ stcgal/stcgal.py -p /dev/tty.SLAB_USBtoUART -P auto -t 11059  main.hex -a
Cycling power: done
Waiting for MCU: done
Protocol detected: stc15
Target model:
  Name: STC15W408AS
  Magic: F51F
  Code flash: 8.0 KB
  EEPROM flash: 5.0 KB
Target frequency: 11.045 MHz
Target BSL version: 7.2.5T
Target wakeup frequency: 37.345 KHz
Target options:
  reset_pin_enabled=True
  clock_source=internal
  clock_gain=high
  watchdog_por_enabled=True
  watchdog_stop_idle=True
  watchdog_prescale=256
  low_voltage_reset=True
  low_voltage_threshold=3
  eeprom_lvd_inhibit=True
  eeprom_erase_enabled=True
  bsl_pindetect_enabled=False
  por_reset_delay=long
  rstout_por_state=high
  uart2_passthrough=False
  uart2_pin_mode=normal
  cpu_core_voltage=unknown
Loading flash: 3869 bytes (Intel HEX)
Trimming frequency: 11.063 MHz
Switching to 19200 baud: done
Erasing flash: done
Writing flash: 4160 Bytes [00:03, 1180.25 Bytes/s]                                                   
Finishing write: done
Setting options: done
Target UID: F51F01740761D4
Disconnected!
zerog2k commented 4 years ago

if you want to resubmit the PR with just the relevant change here (improved handling of WITHOUT_DATE macro), I can look at merging it.