Topics

OnStep on STM32


Egge
 

Hi All,

after serious problems flashing STM32 (solved and flashed with OnStep Version 3.16), I'm also struggling with configuration of WeMos and basic communication with STM32, so I decided to open a new thread... Thanks, to all contributors!

In Wiki/Connection description is mainly about Wifi/Bluetooth/Ethernet. In the very first section direct USB connection is mentioned. This means connecting USB to CM2102?
check in device-manager which port CM2102 is connected to?

in the meantime I installed the Ascom drivers and conneceted USB via CM2102 - WeMos completely removed from setup, RTC installed

as a first test I used Stelarium... adding telescope with "Ascom" and driver controll "Onestep"; when starting properties, I get the "ASCOM telescope dialog" with "OnStep Setup"...
do I choose Ethernet or COM-Port? I don't have Ethernet to OnStep setup... so I tried COM3 (from device manager)
in the left corner the field "currently connected to" is empty...
when I hit "ok" and "connect" the answer from Stelarium ist "...connecting"... no changes after >1 minute and no flashing LEDs on CM2102 and STM32...

is there a more basic test via USB and CM2102 to check wether OnStep is running correctly on STM32?

do I have a general problem with my setup?


I did all 3 tests recommended on:
https://onstep.groups.io/g/main/files/Utilities%20for%20STM32

blink.ino gaves a few blinks from LED

stm32-i2cscanner.ino: serial monitor answerd
Scanning...
I2C device found at address 0x57 !
I2C device found at address 0x68 !
done

stm32-eeprom-wipe.ino: serial monitor answerd
..................................................
EEPROM Wipe Complete


Khalid Baheyeldin
 

Two tests you can do to verify if the STM32 is running OnStep successfully.

Change TRACK_AUTOSTART to be ON.

See if the green LED on the STM32 blinks.

Then open Serial Monitor with 9600 baud, and enter

:GU#

See if you get a response back.


Egge
 

Thanks Khalid,

I flashed STM32 with TRACK_AUTOSTART ON
only RTC included in setup

output from IDE
Sketch uses 116008 bytes (88%) of program storage space. Maximum is 131072 bytes.
Global variables use 12368 bytes (60%) of dynamic memory, leaving 8112 bytes for local variables. Maximum is 20480 bytes.
stm32flash 0.4
http://stm32flash.googlecode.com/
Using Parser : Raw BINARY
Interface serial_w32: 115200 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0410 (Medium-density)
- RAM        : 20KiB  (512b reserved by bootloader)
- Flash      : 128KiB (sector size: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory
Wrote address 0x0801c528 (100.00%) Done.
Starting execution at address 0x08000000... done.

unplug usb; power off; setting boot0 to operation; power on; plug USB

no flahing LED on STM32

no answer from serial monitor (com6 in my case) with 9600baud on command ":GU#"

does this mean, there is a problem with my setup or with the STM32? :-(
I also testet the other STM32... same as above...

do you have other recommendations?

best regards
Egge


Egge
 

I forgot to mention, that I also have downloaded OnStep 3.16 again, just to make sure, that I have the right settings...

for the above test I only changed in config.h
#define PINMAP                        STM32Blue
// ---------------------------------------------------------------------------------------------------------------------------------
// Configuration for OnStep
/*
 *          For more information on setting OnStep up see http://www.stellarjourney.com/index.php?r=site/equipment_onstep
 *                      and join the OnStep Groups.io at https://groups.io/g/onstep
 *
 *           *** Read the compiler warnings and errors, they are there to help guard against invalid configurations ***
*/
// ---------------------------------------------------------------------------------------------------------------------------------
// ADJUST THE FOLLOWING TO CONFIGURE YOUR CONTROLLER FEATURES ----------------------------------------------------------------------
// <-Req'd = always must set, <-Often = usually must set, Option = optional, Adjust = adjust as req'd, Infreq = infrequently changed
// PINMAP ---------------------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#PINMAP
//   *** See the matching Pins.xxx.h file for your setup (found by looking in src/pinmaps/Models.h) with detailed information ***
//   *** to be sure it matches your wiring.            *** USE AT YOUR OWN RISK ***                                           ***
//      Parameter Name              Value   Default  Notes                                                                      Hint
#define PINMAP                        STM32Blue //    OFF, Choose from: MiniPCB, MiniPCB2, MaxPCB, MaxPCB2, STM32Blue,             <-Req'd
                                          //         Ramps14, MaxESP2, MaxESP3.  Check Constants.h for more info.
// SERIAL PORTS ---------------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#SERIAL
#define SERIAL_A_BAUD_DEFAULT        9600 //   9600, n. Where n=9600,19200,57600,115200 (common baud rates.)                  Infreq
#define SERIAL_B_BAUD_DEFAULT        9600 //   9600, n. See (src/HAL/) for your MCU Serial port # etc.                        Option
#define SERIAL_B_ESP_FLASHING         OFF //    OFF, ON Upload ESP8266 WiFi firmware through SERIAL_B with :ESPFLASH# cmd.    Option
#define SERIAL_C_BAUD_DEFAULT         OFF //    OFF, n, ON for ESP32 Bluetooth.                                               Option
#define SERIAL_C_BLUETOOTH_NAME  "OnStep" // "On..", Bluetooth device name for ESP32.                                         Option
// MOUNT TYPE -------------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#MOUNT_TYPE
#define MOUNT_TYPE                    GEM //    GEM, GEM for German Equatorial, FORK for Equatorial Fork, or ALTAZM          <-Req'd
                                          //         Dobsonian etc. mounts. GEM Eq mounts perform meridian flips.
// USER FEEDBACK -------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#USER_FEEDBACK
#define LED_STATUS                     ON //     ON, Blinks w/sidereal tracking otherwise steady on indicates activity.       Option
#define LED_STATUS2                   OFF //    OFF, ON Blinks 1s interval w/PPS sync, steady for gotos, off if in standby.   Option
#define LED_RETICLE                   OFF //    OFF, n. Where n=0..255 (0..100%) activates feature sets default brightness.   Option
#define BUZZER                        OFF //    OFF, ON, n. Where n=100..6000 (Hz freq.) for piezo speaker. ON for buzzer.    Option
#define BUZZER_STATE_DEFAULT          OFF //    OFF, ON Start with piezo buzzer/speaker enabled.                              Option
// TIME AND LOCATION -------------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#TLS
#define TIME_LOCATION_SOURCE          OFF //    OFF, DS3231 (I2c,) DS3234 (Spi,) TEENSY (T3.2 internal,) or GPS source.       Option
                                          //         Provides Date/Time, and if available, PPS & Lat/Long also.
// SENSORS -------------------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#SENSORS
// * = also supports ON_PULLUP or ON_PULLDOWN to activate MCU internal resistors if present.
#define WEATHER                       OFF //    OFF, BME280 (I2C 0x77,) BME280_0x76, BME280_SPI (see pinmap for CS.)          Option
                                          //         Provides temperature, pressure, humidity.
#define TELESCOPE_TEMPERATURE         OFF //    OFF, DS1820 for telescope temperature on one wire interface.                  Option
#define HOME_SENSE                    OFF //    OFF, ON*. Automatically detect and use home switches. For GEM mode only.      Option
#define HOME_SENSE_STATE_AXIS1       HIGH //   HIGH, State when clockwise of home position, as seen from front. Rev. w/LOW.   Adjust
#define HOME_SENSE_STATE_AXIS2       HIGH //   HIGH, State when clockwise of home position, as seen from above. Rev. w/LOW.   Adjust
                                          //         Signal state reverses when travel moves ccw past the home position.
#define LIMIT_SENSE                   OFF //    OFF, ON* limit sense switch close to Gnd stops gotos and/or tracking.         Option
#define LIMIT_SENSE_STATE             LOW //    LOW, For NO (normally open) switches, HIGH for NC (normally closed.)          Adjust
#define PEC_SENSE                     OFF //    OFF, ON*, n, sense digital OR n=0 to 1023 (0 to 3.3V or 5V) analog threshold. Option
#define PEC_SENSE_STATE              HIGH //   HIGH, Senses the PEC signal rising edge or use LOW for falling edge.           Adjust
                                          //         Ignored in ALTAZM mode.
#define PPS_SENSE                     OFF //    OFF, ON* enables PPS (pulse per second,) senses signal rising edge.           Option
                                          //         Better tracking accuracy especially for Mega2560's w/ceramic resonator.
// ST4 INTERFACE ------------------------------------------------------ see https://onstep.groups.io/g/main/wiki/6-Configuration#ST4
// *** It is up to you to verify the interface meets the electrical specifications of any connected device, use at your own risk ***
#define ST4_INTERFACE                 OFF //    OFF, ON, ON_PULLUP enables interface. <= 1X guides unless hand control mode.  Option
                                          //         During goto btn press: aborts slew or continue meridian flip pause home
#define ST4_HAND_CONTROL              OFF //    OFF, ON for hand controller special features and SHC support.                 Option
                                          //         Hold [E]+[W] btns >2s: Guide rate   [E]-  [W]+  [N] trk on/off [S] sync
                                          //         Hold [N]+[S] btns >2s: Usr cat item [E]-  [W]+  [N] goto [S] snd on/off
#define ST4_HAND_CONTROL_FOCUSER      OFF //    OFF, ON alternate to above: Focuser move [E]f1 [W]f2 [N]-     [S]+            Option
// GUIDING BEHAVIOR ----------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#GUIDING
#define GUIDE_TIME_LIMIT                0 //      0, No guide time limit. Or n. Where n=1..120 second time limit guard.       Adjust
#define GUIDE_DISABLE_BACKLASH        OFF //    OFF, Disable backlash takeup during guiding at <= 1X                          Option
// TRACKING BEHAVIOUR -------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#TRACKING
#define TRACK_AUTOSTART               ON //    OFF, ON Start with tracking enabled.                                          Option
#define TRACK_REFRACTION_RATE_DEFAULT OFF //    OFF, ON Start w/atmospheric refract. compensation (RA axis/Eq mounts only.)   Option
#define TRACK_BACKLASH_RATE            25 //     25, n. Where n=2..50 (x sidereal rate) during backlash takeup.               Option
                                          //         Too fast motors stall/gears slam or too slow and sluggish in backlash.
// SYNCING BEHAVIOUR ---------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#SYNCING
#define SYNC_CURRENT_PIER_SIDE_ONLY    ON //     ON, Disables ability of sync to change pier side, for GEM mounts.            Option
// SLEWING BEHAVIOUR ---------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#SLEWING
#define SLEW_RATE_BASE_DESIRED        1.0 //    1.0, n. Desired slew rate in deg/sec. Adjustable at run-time from            <-Req'd
                                          //         1/2 to 2x this rate, and as MCU performace considerations require.
#define SLEW_RATE_MEMORY              OFF //    OFF, ON Remembers rates set across power cycles.                              Option
#define SLEW_ACCELERATION_DIST        5.0 //    5.0, n, (degrees.) Approx. distance for acceleration (and deceleration.)      Adjust
#define SLEW_RAPID_STOP_DIST          2.5 //    2.0, n, (degrees.) Approx. distance required to stop when a slew              Adjust
                                          //         is aborted or a limit is exceeded.
                                         
#define MFLIP_SKIP_HOME               OFF //    OFF, ON Goto directly to the destination without visiting home position.      Option
#define MFLIP_PAUSE_HOME_MEMORY       OFF //    OFF, ON Remember meridian flip pause at home setting across power cycles.     Option
#define MFLIP_AUTOMATIC_MEMORY        OFF //    OFF, ON Remember automatic meridian flip setting across power cycles.         Option
// PARKING BEHAVIOUR ---------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#PARKING
#define STRICT_PARKING                OFF //    OFF, ON Un-parking is only allowed if successfully parked.                    Option
// MOTION CONTROL -------------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#MOTION
#define STEP_WAVE_FORM             SQUARE // SQUARE, PULSE Step signal wave form faster rates. SQUARE best signal integrity.  Adjust
// Stepper driver models (also see ~/OnStep/src/sd_drivers/Models.h for additional infrequently used models and more info.):
// A4988, DRV8825, LV8729, S109, SSS TMC2209*, TMC2130* **, and TMC5160* ***
// * = add _QUIET (stealthChop tracking) or _VQUIET (stealthChop tracking & slew,) for example "TMC2130_VQUIET"
// ** = SSS TMC2130 if you choose to set stepper driver current (in mA) set Vref pot. 2.5V instead of by motor current as usual.
// *** = SSS TMC5160 you must set stepper driver current (in mA) w/ #define AXISn_TMC_IRUN (IHOLD, etc.)
// AXIS1 RA/AZM
// see https://onstep.groups.io/g/main/wiki/6-Configuration#AXIS1
#define AXIS1_STEPS_PER_DEGREE    12800.0 //  12800, n. Number of steps per degree:                                          <-Req'd
                                          //         n = (stepper_steps * micro_steps * overall_gear_reduction)/360.0
#define AXIS1_STEPS_PER_WORMROT     12800 //  12800, n. Number of steps per worm rotation (PEC Eq mode only:)                <-Req'd
                                          //         n = (AXIS1_STEPS_PER_DEGREE*360)/reduction_final_stage
#define AXIS1_DRIVER_MODEL            OFF //    OFF, (See above.) Stepper driver model.                                      <-Often
#define AXIS1_DRIVER_MICROSTEPS       OFF //    OFF, n. Microstep mode when tracking.                                        <-Often
#define AXIS1_DRIVER_MICROSTEPS_GOTO  OFF //    OFF, n. Microstep mode used during gotos.                                     Option
#define AXIS1_DRIVER_IHOLD            OFF //    OFF, n, (mA.) Current during standstill. OFF uses IRUN/2.0                    Option
#define AXIS1_DRIVER_IRUN             OFF //    OFF, n, (mA.) Current during tracking, appropriate for stepper/driver/etc.    Option
#define AXIS1_DRIVER_IGOTO            OFF //    OFF, n, (mA.) Current during slews. OFF uses same as IRUN.                    Option
#define AXIS1_DRIVER_REVERSE          OFF //    OFF, ON Reverses movement direction, or reverse wiring instead to correct.   <-Often
#define AXIS1_DRIVER_STATUS           OFF //    OFF, TMC_SPI, HIGH, or LOW.  Polling for driver status info/fault detection.  Option
#define AXIS1_LIMIT_UNDER_POLE        180 //    180, n. Where n=150..180 (degrees.) Max HA hour angle + or - for Eq modes.    Adjust
#define AXIS1_LIMIT_MAXAZM            360 //    360, n. Where n=180..360 (degrees.) Max Azimuth + or - for AltAzm mode only.  Adjust
// AXIS2 DEC/ALT
// see https://onstep.groups.io/g/main/wiki/6-Configuration#AXIS2
#define AXIS2_STEPS_PER_DEGREE    12800.0 //  12800, n. Number of steps per degree:                                          <-Req'd
                                          //         n = (stepper_steps * micro_steps * overall_gear_reduction)/360.0
#define AXIS2_DRIVER_MODEL            OFF //    OFF, (See above.) Stepper driver model.                                      <-Often
#define AXIS2_DRIVER_MICROSTEPS       OFF //    OFF, n. Microstep mode when tracking.                                        <-Often
#define AXIS2_DRIVER_MICROSTEPS_GOTO  OFF //    OFF, n. Microstep mode used during gotos.                                     Option
#define AXIS2_DRIVER_IHOLD            OFF //    OFF, n, (mA.) Current during standstill. OFF uses IRUN/2.0                    Option
#define AXIS2_DRIVER_IRUN             OFF //    OFF, n, (mA.) Current during tracking, appropriate for stepper/driver/etc.    Option
#define AXIS2_DRIVER_IGOTO            OFF //    OFF, n, (mA.) Current during slews. OFF uses same as IRUN.                    Option
#define AXIS2_DRIVER_POWER_DOWN       OFF //    OFF, ON Powers off 10sec after movement stops or 10min after last<=1x guide.  Option
#define AXIS2_DRIVER_REVERSE          OFF //    OFF, ON Reverses movement direction, or reverse wiring instead to correct.   <-Often
#define AXIS2_DRIVER_STATUS           OFF //    OFF, TMC_SPI, HIGH, or LOW.  Polling for driver status info/fault detection.  Option
#define AXIS2_TANGENT_ARM             OFF //    OFF, ON +limit range below. Set cntr w/[Reset Home] Return cntr w/[Find Home] Infreq
#define AXIS2_LIMIT_MIN               -91 //    -91, n. Where n=-91..0 (degrees.) Minimum allowed declination.                Infreq
#define AXIS2_LIMIT_MAX                91 //     91, n. Where n=0..91 (degrees.) Maximum allowed declination.                 Infreq
// AXIS3 ROTATOR
// see https://onstep.groups.io/g/main/wiki/6-Configuration#AXIS3
#define ROTATOR                       OFF //    OFF, ON to enable the rotator (or de-rotator for ALTAZM mounts.)              Option
#define AXIS3_STEPS_PER_DEGREE       64.0 //   64.0, n. Number of steps per degree for rotator/de-rotator.                    Adjust
                                          //         Alt/Az de-rotation: n = (num_circumference_pixels * 2)/360, minimum
#define AXIS3_STEP_RATE_MAX           8.0 //    8.0, n, (millisec.) Minimum ms/step depends on processor.                     Adjust
#define AXIS3_DRIVER_MODEL            OFF //    OFF, TMC2130, TMC5160. Leave OFF for all drivers models except these.         Option
#define AXIS3_DRIVER_MICROSTEPS       OFF //    OFF, n. Microstep mode when tracking.                   For TMC2130, TMC5160. Option
#define AXIS3_DRIVER_IHOLD            OFF //    OFF, n, (mA.) Current standstill. OFF uses IRUN/2.0.                  "       Option
#define AXIS3_DRIVER_IRUN             OFF //    OFF, n, (mA.) Current tracking, appropriate for stepper/driver/etc.   "       Option
#define AXIS3_DRIVER_POWER_DOWN       OFF //    OFF, ON Powers off the motor at stand-still.                                  Option
#define AXIS3_DRIVER_REVERSE          OFF //    OFF, ON Reverses movement direction, or reverse wiring instead to correct.    Option
#define AXIS3_LIMIT_MIN              -180 //   -180, n. Where n=-360..0 (degrees.) Minimum allowed rotator angle.             Infreq
#define AXIS3_LIMIT_MAX               180 //    180, n. Where n=0..360 (degrees.) Maximum allowed rotator angle.              Infreq
// AXIS4 FOCUSER 1
// see https://onstep.groups.io/g/main/wiki/6-Configuration#AXIS4
#define FOCUSER1                      OFF //    OFF, ON to enable this focuser.                                               Option
#define AXIS4_STEPS_PER_MICRON        0.5 //    0.5, n. Steps per micrometer. Figure this out by testing or other means.      Adjust
#define AXIS4_STEP_RATE_MAX           8.0 //    8.0, n, (millisec.) Min. ms/step depends on processor. In DC mode, PWM freq.  Adjust
#define AXIS4_DRIVER_MODEL            OFF //    OFF, TMC2130, TMC5160. Leave OFF for all drivers models except these.         Option
#define AXIS4_DRIVER_MICROSTEPS       OFF //    OFF, n. Microstep mode when tracking.                   For TMC2130, TMC5160. Option
#define AXIS4_DRIVER_IHOLD            OFF //    OFF, n, (mA.) Current standstill. OFF uses IRUN/2.0.                  "       Option
#define AXIS4_DRIVER_IRUN             OFF //    OFF, n, (mA.) Current tracking, appropriate for stepper/driver/etc.   "       Option
#define AXIS4_DRIVER_POWER_DOWN       OFF //    OFF, ON Powers off the motor at stand-still.                                  Option
#define AXIS4_DRIVER_REVERSE          OFF //    OFF, ON Reverses movement direction, or reverse wiring instead to correct.    Option
#define AXIS4_DRIVER_DC_MODE          OFF //    OFF, DRV8825 for pwm dc motor control on stepper driver outputs.              Option
#define AXIS4_LIMIT_MIN_RATE           10 //     10, n. Where n=1..1000 (um/s.) Minimum microns/second. In DC mode, min pwr.  Adjust
#define AXIS4_LIMIT_MIN                 0 //      0, n. Where n=0..500 (millimeters.) Minimum allowed position.               Adjust
#define AXIS4_LIMIT_MAX                50 //     50, n. Where n=0..500 (millimeters.) Maximum allowed position.               Adjust
// AXIS5 FOCUSER 2
// see https://onstep.groups.io/g/main/wiki/6-Configuration#AXIS5
#define FOCUSER2                      OFF //    OFF, ON to enable this focuser.                                               Option
#define AXIS5_STEPS_PER_MICRON        0.5 //    0.5, n. Steps per micrometer. Figure this out by testing or other means.      Adjust
#define AXIS5_STEP_RATE_MAX           8.0 //    8.0, n, (millisec.) Min. ms/step depends on processor. In DC mode, PWM freq.  Adjust
#define AXIS5_DRIVER_MODEL            OFF //    OFF, TMC2130, TMC5160. Leave OFF for all drivers models except these.         Option
#define AXIS5_DRIVER_MICROSTEPS       OFF //    OFF, n. Microstep mode when tracking.                   For TMC2130, TMC5160. Option
#define AXIS5_DRIVER_IHOLD            OFF //    OFF, n, (mA.) Current standstill. OFF uses IRUN/2.0.                  "       Option
#define AXIS5_DRIVER_IRUN             OFF //    OFF, n, (mA.) Current tracking, appropriate for stepper/driver/etc.   "       Option
#define AXIS5_DRIVER_POWER_DOWN       OFF //    OFF, ON Powers off the motor at stand-still.                                  Option
#define AXIS5_DRIVER_REVERSE          OFF //    OFF, ON Reverses movement direction, or reverse wiring instead to correct.    Option
#define AXIS5_DRIVER_DC_MODE          OFF //    OFF, DRV8825 for pwm dc motor control on stepper driver outputs.              Option
#define AXIS5_LIMIT_MIN_RATE           10 //     10, n. Where n=1..1000 (um/s.) Minimum microns/second. In DC mode, min pwr.  Adjust
#define AXIS5_LIMIT_MIN                 0 //      0, n. Where n=0..500 (millimeters.) Minimum allowed position.               Adjust
#define AXIS5_LIMIT_MAX                50 //     50, n. Where n=0..500 (millimeters.) Maximum allowed position.               Adjust
// THAT'S IT FOR USER CONFIGURATION!
// -------------------------------------------------------------------------------------------------------------------------
#define FileVersionConfig 3


Khalid Baheyeldin
 

This means that OnStep is not running on the STM32 for some reason.
Your past messages show that the STM32 can access the EEPROM chip on the RTC.
So that is not the case.

When you power on in normal (run) mode. What happens to the 2nd LED?
Does it light up and stay steady, or does not light up at all?


Egge
 

Thanks Khalid,

power on in run-mode with RTC installed: only PWR LED on STM32 blue pill is on - other LED is always off, also when I send the ":GU#" command

again
- blink.ino works -> this tells me, that flashing via CM2102 works and STM32 executes the blink-sketch
- stm32-i2cscanner.ino works and gives an answer from serial port -> does this mean that STM32 sends information via CM2102 to the computer?

I have another USB to serial solution - should I try this?
could it be an issue with OnStep settings (e.g. in config.h)?


Khalid Baheyeldin
 

On Wed, Aug 12, 2020 at 05:10 PM, Egge wrote:
power on in run-mode with RTC installed: only PWR LED on STM32 blue pill is on - other LED is always off, also when I send the ":GU#" command
These two symptoms mean that OnStep is not working.

again
- blink.ino works -> this tells me, that flashing via CM2102 works and STM32 executes the blink-sketch
- stm32-i2cscanner.ino works and gives an answer from serial port -> does this mean that STM32 sends information via CM2102 to the computer?
Yes, it means the CP2102 is working fine, otherwise you would not be able to flash, nor see the output from the scanner.

When we had these two symptoms (2nd LED does not light up, and no response from USB), it was always due to the EEPROM chip on the RTC module that is not working. In some cases, I saw some legs on the chip not touching the board at all. In other cases it may be a defective chip.

But in those cases, we almost always had an issue with the i2c scanner, or the EEPROM wipe.
That is not the case here, since the device IDs are detected, and the output says that wipe is complete.

I have another USB to serial solution - should I try this?
I don't see how that would make a difference.  The CP2102 is already communicating as it should.

could it be an issue with OnStep settings (e.g. in config.h)?
Usually, an error in Config.h would cause other symptoms: motors going in the wrong direction, wrong angular distance, and so on. Never saw these causing a failure to run.

If in doubt, go to the Online Configuration Generator and generate a basic Config.h to make sure it has no glaring errors.

When you flash the STM32, did you have the same parameters as the screen captures that are in the Wiki page?
Did you specify 128K?
Do you see the "128K" in the output from flashing, and a "100%" message at the end?


Egge
 

thanks Khalid for the quick answer
When you flash the STM32, did you have the same parameters as the screen captures that are in the Wiki page?
Did you specify 128K?
Do you see the "128K" in the output from flashing, and a "100%" message at the end?
yes, I folloewd exactly the wiki page including 128K...

output from IDE is
Sketch uses 116008 bytes (88%) of program storage space. Maximum is 131072 bytes.
Global variables use 12368 bytes (60%) of dynamic memory, leaving 8112 bytes for local variables. Maximum is 20480 bytes.
stm32flash 0.4
http://stm32flash.googlecode.com/
Using Parser : Raw BINARY
Interface serial_w32: 115200 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0410 (Medium-density)
- RAM        : 20KiB  (512b reserved by bootloader)
- Flash      : 128KiB (sector size: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory
Wrote address 0x0801c528 (100.00%) Done.
Starting execution at address 0x08000000... done.


Khalid Baheyeldin
 

On Wed, Aug 12, 2020 at 06:05 PM, Egge wrote:
Sketch uses 116008 bytes (88%) of program storage space. Maximum is 131072 bytes.
The above is the size of the compiled binary.

 Wrote address 0x0801c528 (100.00%) Done.
The 1c528 part is exactly 116,008 bytes, so things match up.

Starting execution at address 0x08000000... done.
At this point, when flashing is done, the 2nd LED should light up, even before you power off and move the Flash/Run switch back to the Run position.

I don't know what else to try.
First visually check the EEPROM chip on the RTC module with a magnifying glass. Check if it is soldered correctly, and no legs up in the air. Here is a high resolution photo of the module. The smaller chip is the EEPROM, with 4 wires on each side.
If in doubt, use a hot soldering iron to reflow the solder.

If you can try another RTC module, it is something that you can try.


Mike Ahner
 

On Wed, Aug 12, 2020 at 06:02 PM, Khalid Baheyeldin wrote:
If you can try another RTC module, it is something that you can try.
Everything seems to point to a bad RTC module. Even when erasing it, if there isn't a validation process run, the module could still be defective but accessible. We know OnStep requires RTC to work and everything else is working.

If you don't find anything obvious with the pins, soldering, or traces, then I really think the next option is to try another RTC.


Khalid Baheyeldin
 

On Wed, Aug 12, 2020 at 08:23 PM, Mike Ahner wrote:
We know OnStep requires RTC to work and everything else is working.
Correction: OnStep does not require an RTC.
What OnStep requires is a working EEPROM to store certain values.
All the boards have built in EEPROMs, or emulation of it in flash, except the STM32.
The RTC module has an EEPROM chip that is separately addressable.
So one can disable the DS3231 (i.e. TIME_LOCATION_SOURCE OFF), but the STM32 still works.

The EEPROM may be defective, but it is hard to be sure. The wipe uses the exact same API as OnStep.
When I have time, I will change the wipe to do a read-after-write verification, just to be sure.

Worth inspecting the module for soldering issues, and also replacing it, just to be sure.


Egge
 

thanks Khalid and Martin,

your comments make sense... I checked the RTC module in detail, but did not find anything; anyway I resolderd the relevant pins
Here is a high resolution photo of the module
there is a green wire in the photo... did I miss something? I don't have it...

To verify everything with respect to LEDs on/off, I did all tests again and documented the output (see below) everything points to the RTC module, as you already have noted.

Only open question is, if PC13-LED on STM32 flashes, when operating WITHOUT RTC module - in my case it did not flash. Can you please comment?

in any case, I will order new RTC-module

best regards and thanks for your support
Egge


_________________________________________________________
Setup only CM2102 and STM32; no WeMos, no RTC module

flashing with OnStep.ino works fine; switching to run-mode: only PWR-LED on STM32 is activ; no blink and no solid light on other LED (PC13)

flashing with blink.ino works fine; directly after upload (even with boot-jumper in boot position) the sketch is executed and PC13-LED starts blinking; after power off and on in run-mode, sketch is also executed normally

flashing with i2cscanner.ino works fine; only PWR-LED lights up on STM32; PC13-LED is allways off;
"receiving" LED on CM2102 flahes frequently;

serial monitor gives error message (becuase no RTC/eprom included)
Unknown error at address 0x7D
No I2C devices found

flahsing with eeprom-wipe.ino works fine; only PWR-LED lights up on STM32; PC13-LED is allways off;
no response on serial monitor (as expected due to missing RTC)

____________________________________________________________
same setup as above, but WITH RTC module

flashing with OnStep.ino works fine; swithing to run-mode: only PWR-LED on STM32 is activ; no blink and no solid light on other LED (PC13); power-LED on RTC is on

flashing with i2cscanner.ino works fine; only PWR-LED lights up on STM32; PC13-LED is allways off;
"receiving" LED on CM2102 flahes frequently;

serial monitor gives
Scanning...
I2C device found at address 0x57  !
I2C device found at address 0x68  !
done


flahsing with eeprom-wipe.ino works fine; only PWR-LED lights up on STM32; PC13-LED is allways off; power-LED on RTC is on
response from serial monitor
......................................
EEPROM Wipe Complete


Khalid Baheyeldin
 

Ignore the green wire. No one did this for OnStep, and no one should.

For your tests:
- Without RTC: we know OnStep will never work that way because it tries to access the EEPROM, but fails.
- With RTC: this should work with OnStep. The confusing part is both i2c scanner and eeprom wipe work fine.

If you are a programmer, you can try to copy the eeprom wipe sketch, and write something on a certain
address on the EEPROM and read it back and see whether the read was successful, and whether it is
the same data that was written.

If that fails, then it validates our assumption that the EEPROM is bad.
If it succeeds, then adds to our collective confusion ...


Egge
 

Hi Khalid,
Without RTC: we know OnStep will never work that way because it tries to access the EEPROM, but fails.
fully agree... however I just wanted to know, if the PC13-LED on STM32 flashes when operting without RTC... if this is the case, then my problem is on STM32???

sorry, I'm not  a programmer... in case anybody here can support, I'd be happy to test the code...

RTC is ordered, but will take some time to arrive...

thanks for all your support


Khalid Baheyeldin
 

On Sat, Aug 15, 2020 at 08:13 AM, Egge wrote:
however I just wanted to know, if the PC13-LED on STM32 flashes when operting without RTC... if this is the case, then my problem is on STM32???
If you don't have an EEPROM (on the RTC), then PC13 will never turn on.


Egge
 

Hi,

a few days ago I received the new RTC - unfortunately OnStep still not running. So I spent much time in seachting/thinking about other failures/issues:

I did testing on bread-board and on PCB STM32 V1.8 (only STM32 blue pill; CP2102; DS3231 RTC - no stepper drivers)
- blink.ino, eeprom-wipe.ino and i2cscanner.ino work as expected
- communication between computer and STM32 via CP2102 works in both directions (flashing and answer from i2cscanner on serial monitor)
- boot1 jumper always in same position (same as boot0 in run-mode); for flashing only boot0 changed

Software is
- Arduino IDE 1.8.13
- SAM Boards (32-bits ARM Cortex-M3) 1.6.12 (installed via board-manager - no idea where it installed to)
- STM32 Arduino copied manually here: C:\Program Files (x86)\Arduino\hardware\Arduino_STM32
- RTC by Makuna 2.3.5 installed via library manager; path after installation: C:\Users\lede\Documents\Arduino\libraries\Rtc_by_Makuna
- digitalWriteFast copied here: C:\Program Files (x86)\Arduino\libraries\digitalWriteFast
- OnStep 3.16 copied manually here: C:\Users\lede\Documents\Arduino\OnStep
- config.h (TRACK_AUTOSTART ON; AXIS1_DRIVER_MODEL OFF; AXIS2_DRIVER_MODEL OFF)

-> flashing of OnStep to STM32 terminates normally (settings and answer from IDE see attached screen-shots)
- no blinking PC13-LED on STM32
- no reaction if sending ":GU#" to serial port (COM6 in my case) via serial monitor (only receiving LED on CP2102 flashes once)


questions:

are stepper drivers required for this test? is AXIS1_DRIVER_MODEL or axis2 requried to be ON in config.h?

"STM32 Arduino" and "digitalWriteFast" directories only copied manually to above locations - is this correct or does it require additional activation/installation?

confusion about directories: C:\Users\lede\Documents\Arduino vs. C:\Program Files (x86)\Arduino (see also paths above)
- should "digitalWriteFast" directory be here: C:\Users\lede\Documents\Arduino\libraries\digitalWriteFast
at least the directory of RTC by Makuna is here: C:\Users\lede\Documents\Arduino\libraries\Rtc_by_Makuna
- I even found the hint to copy only "digitalWriteFast.h" to C:\Users\lede\Documents\Arduino\libraries

randomly I get this error-message from Arduino IDE (not related to flashing)
Error downloading https://downloads.arduino.cc/packages/package_index.json

Soldering was checked on old and new RTC... and even resoldered...

I ordered already another RTC from another vendor... just to make sure...

any other recommendations, what I can test / do?
- Khalid mentioned, to extend eeprom-wipe.ino with a write/read procedure... how to do this? unfortunately I'm not a programmer and need help on this
- are there any arduino-sketches availablue (e.g. arduino nano and DS3231RTC), where I can test the RTC separately (meaning independently of STM32)?






Egge
 

sorry, here is the picture in better quality


Khalid Baheyeldin
 

On Fri, Aug 21, 2020 at 09:54 AM, Egge wrote:

- are there any arduino-sketches availablue (e.g. arduino nano and DS3231RTC), where I can test the RTC separately (meaning independently of STM32)?
The RTC itself is not crucial for the STM32 to function. It is just convenient to have the date/time always.
You can even set TIME_LOCATION_SOURCE OFF and the STM32 will work.

What is crucial is the EEPROM on the RTC module.

But you can try the following sketches under Arduino/libraries/Rtc_by_Makuna/examples:

DS3231_Alarms
DS3231_Memory
DS3231_Simple
DS3231_StoreIt

They should work and verify that the RTC is functional.


Khalid Baheyeldin
 

On Fri, Aug 21, 2020 at 09:54 AM, Egge wrote:

- no reaction if sending ":GU#" to serial port (COM6 in my case) via serial monitor (only receiving LED on CP2102 flashes once)
The CP2102 LEDs will flash when anything is sent or received. Not critical to what we are trying to troubleshoot.

Did you change the baud rate to 9600 in Serial Monitor?
If you did then it means OnStep is not running at all.


Egge
 

thanks Khalid,

yes, baud rate was 9600 in serial monitor...

could this be an indication, that flashing OnStep does not work properly?
could there be a hardware problem with (both) STM32?

are my software-settings correct (drivers, libraries,...)? see previous post...