MaxPCB4 problems


Peter Boreland
 

On the MaxPCB4 the Teensy is not connecting to the WEMOS WIFI processor board. If I set a SERIAL_B baud rate I get a compile error:

In file included from H:\OnStepX\src\pinmaps\Models.h:70:0,
                 from H:\OnStepX\src\Common.h:14,
                 from H:\OnStepX\OnStepX.ino:50:
H:\OnStepX\src\pinmaps\Validate.h:12:4: error: #error "Configuration (Config.h): SERIAL_B isn't defined, SERIAL_B_BAUD_DEFAULT should be OFF."
   #error "Configuration (Config.h): SERIAL_B isn't defined, SERIAL_B_BAUD_DEFAULT should be OFF."
    ^
In file included from H:\OnStepX\OnStepX.ino:52:0:
H:\OnStepX\src\Validate.h:17:4: error: #error "Configuration (Config.h): PINMAP must be set to a valid board (from Constants.h) or OFF (for user pin defs in Config.h)"
   #error "Configuration (Config.h): PINMAP must be set to a valid board (from Constants.h) or OFF (for user pin defs in Config.h)"
    ^
Error compiling for board Teensy 4.1.


Howard Dutton
 

On Sat, Nov 26, 2022 at 08:30 AM, Peter Boreland wrote:
In file included from H:\OnStepX\OnStepX.ino:52:0:
H:\OnStepX\src\Validate.h:17:4: error: #error "Configuration (Config.h): PINMAP must be set to a valid board (from Constants.h) or OFF (for user pin defs in Config.h)"
   #error "Configuration (Config.h): PINMAP must be set to a valid board (from Constants.h) or OFF (for user pin defs in Config.h)"
I suggest you look into why this is.


Peter Boreland
 

Well I thought I had to setup right in the config.h file. What else is there?

#define PINMAP                        MaxPCB4 //    OFF, Choose from: MiniPCB, MiniPCB2, MaxPCB2, MaxESP3, CNC3, STM32Blue,      <-Req'd
// PINMAP ------------------------------------------------- see https://onstep.groups.io/g/main/wiki/Configuration_Controller#PINMAP
                                          //         MaxSTM3, FYSETC_S6_2, etc.  Other boards and more info. in ~/src/Constants.h
 
#define SERIAL_A_BAUD_DEFAULT        57600 //   9600, n. Where n=9600,19200,57600,115200,230400,460800 (common baud rates.)    Infreq
#define SERIAL_B_BAUD_DEFAULT        57600 //   9600, n. Baud rate as above. See (src/pinmaps/) for Serial port assignments.   Option
#define SERIAL_B_ESP_FLASHING         OFF //    OFF, ON Upload ESP8266 WiFi firmware through SERIAL_B with :ESPFLASH# cmd.    Option
// SERIAL PORT COMMAND CHANNELS --------------------- see https://onstep.groups.io/g/main/wiki/Configuration_Controller#SERIAL_PORTS
#define SERIAL_C_BAUD_DEFAULT         OFF //    OFF, n. Baud rate as above. See (src/pinmaps/) for Serial port assignments.   Infreq
#define SERIAL_D_BAUD_DEFAULT         OFF //    OFF, n. Baud rate as above. See (src/pinmaps/) for Serial port assignments.   Infreq
#define SERIAL_E_BAUD_DEFAULT         OFF //    OFF, n. Baud rate as above. See (src/pinmaps/) for Serial port assignments.   Infreq
 


Peter Boreland
 

Not sure if this is important, but in the drawing you have the WEMOS serial interface listed as RX2 and TX2. 

Pins.MaxPCB4

 

// Serial2: RX4 Pin 7,  TX4 Pin 8


Howard Dutton
 

On Sat, Nov 26, 2022 at 08:50 AM, Peter Boreland wrote:
Well I thought I had to setup right in the config.h file. What else is there?

#define PINMAP                        MaxPCB4 //    OFF, Choose from: MiniPCB, MiniPCB2, MaxPCB2, MaxESP3, CNC3, STM32Blue,      <-Req'd
// PINMAP ------------------------------------------------- see https://onstep.groups.io/g/main/wiki/Configuration_Controller#PINMAP
                                          //         MaxSTM3, FYSETC_S6_2, etc.  Other boards and more info. in ~/src/Constants.h
 
#define SERIAL_A_BAUD_DEFAULT        57600 //   9600, n. Where n=9600,19200,57600,115200,230400,460800 (common baud rates.)    Infreq
#define SERIAL_B_BAUD_DEFAULT        57600 //   9600, n. Baud rate as above. See (src/pinmaps/) for Serial port assignments.   Option
#define SERIAL_B_ESP_FLASHING         OFF //    OFF, ON Upload ESP8266 WiFi firmware through SERIAL_B with :ESPFLASH# cmd.    Option
// SERIAL PORT COMMAND CHANNELS --------------------- see https://onstep.groups.io/g/main/wiki/Configuration_Controller#SERIAL_PORTS
#define SERIAL_C_BAUD_DEFAULT         OFF //    OFF, n. Baud rate as above. See (src/pinmaps/) for Serial port assignments.   Infreq
#define SERIAL_D_BAUD_DEFAULT         OFF //    OFF, n. Baud rate as above. See (src/pinmaps/) for Serial port assignments.   Infreq
#define SERIAL_E_BAUD_DEFAULT         OFF //    OFF, n. Baud rate as above. See (src/pinmaps/) for Serial port assignments.   Infreq
Config.h file has the typos with the comments out of place that have since been fixed.

... looks like the correct pinmap setting but the pinmap was only recently added to OnStepX so perhaps you need to update.


Howard Dutton
 

And...


MSG: OnStepX, version 10.10i
MSG: OnStepX, MCU Teensy4.1
MSG: OnStepX, pinmap MaxPCB v4
MSG: Setup, HAL initalize
MSG: Setup, start system service task (rate 10ms priority 7)... success
MSG: Setup, start input sense polling task (rate 1ms priority 7)... success
MSG: NV, correct key found
*********************************************
MSG: Dallas/Maxim 1-wire DS2413 device s/n's:
No DS2413 devices found
*********************************************
MSG: Axis1, reverting settings to Config.h defaults
MSG: Axis1, stepsPerMeasure=5156620.16, reverse=OFF
MSG: Axis1, backlash takeup frequency set to 0.10 deg/s
MSG: Axis1, adding any home and/or limit senses
MSG: StepDir1, pins step=38, dir=39, en=33
MSG: StepDir1, start task to move motor... success
MSG: StepDirDriver1, init model TMC5160 (SPI) u-step mode 256X (goto mode 8X)
MSG: StepDirDriver1, TMC Ihold=500mA, Irun=1000mA, Igoto=1000mA
MSG: TmcSPI, init RSENSE=0.08
MSG: SoftSpi, init MOSI=37, SCK=36, CS=35, MISO=34
MSG: StepDir1, sequencer homes every 32 step(s)
MSG: Axis1, start monitor task (rate 1000us priority 1)... success
MSG: Axis2, reverting settings to Config.h defaults
MSG: Axis2, stepsPerMeasure=5156620.16, reverse=OFF
MSG: Axis2, backlash takeup frequency set to 0.10 deg/s
MSG: Axis2, adding any home and/or limit senses
MSG: StepDir2, pins step=15, dir=16, en=40
MSG: StepDir2, start task to move motor... success
MSG: StepDirDriver2, init model TMC5160 (SPI) u-step mode 256X (goto mode 8X)
MSG: StepDirDriver2, TMC Ihold=500mA, Irun=1000mA, Igoto=1000mA
MSG: TmcSPI, init RSENSE=0.08
MSG: SoftSpi, init MOSI=41, SCK=13, CS=14, MISO=34
MSG: StepDir2, sequencer homes every 32 step(s)
MSG: Axis2, start monitor task (rate 1000us priority 1)... success
MSG: Rotator, init (Axis3)
MSG: Axis3, reverting settings to Config.h defaults
MSG: Axis3, stepsPerMeasure=64.00, reverse=OFF
MSG: Axis3, backlash takeup frequency set to 0.25 deg/s
MSG: Axis3, adding any home and/or limit senses
MSG: StepDir3, pins step=26, dir=27, en=11
MSG: StepDir3, start task to move motor... success
MSG: StepDirDriver3, init model TMC2130 (SPI) u-step mode 1X (goto mode OFF)
MSG: StepDirDriver3, TMC Ihold=250mA, Irun=500mA, Igoto=500mA
MSG: TmcSPI, init RSENSE=0.13
MSG: SoftSpi, init MOSI=12, SCK=24, CS=25, MISO=34
MSG: StepDir3, sequencer homes every 1 step(s)
MSG: Axis3, start monitor task (rate 1000us priority 1)... success
MSG: Axis4, reverting settings to Config.h defaults
MSG: Axis4, stepsPerMeasure=0.15, reverse=ON
MSG: Axis4, backlash takeup frequency set to 125.00um/s
MSG: Axis4, adding any home and/or limit senses
MSG: StepDir4, pins step=32, dir=27, en=28
MSG: StepDir4, start task to move motor... success
MSG: StepDirDriver4, init model TMC2130 (SPI) u-step mode 32X (goto mode OFF)
MSG: StepDirDriver4, TMC Ihold=250mA, Irun=500mA, Igoto=500mA
MSG: TmcSPI, init RSENSE=0.13
MSG: SoftSpi, init MOSI=29, SCK=30, CS=31, MISO=34
MSG: StepDir4, sequencer homes every 1 step(s)
MSG: Axis4, start monitor task (rate 1000us priority 1)... success
MSG: Focuser1, init (Axis4)
MSG: StepDirDriver1, TMC standstill automatic current calibration
MSG: StepDirDriver2, TMC standstill automatic current calibration
MSG: Mount, site get Latitude/Longitude from NV
MSG: Mount, site get Date/Time from NV
MSG: Mount, site start sidereal timer task (rate 10ms priority 0)... success
MSG: Mount, type GEM
MSG: StepDirDriver1, status change SGA. OLA. SGB. OLB. OTP. OTE. SST< FLT.
MSG: StepDirDriver2, status change SGA. OLA. SGB. OLB. OTP. OTE. SST< FLT.
MSG: StepDir1, driver powered down using pin 33
MSG: StepDir2, driver powered down using pin 40
MSG: Mount, reset at home and in standby
MSG: Mount, limits start monitor task (rate 100ms priority 2)... success
MSG: Mount, start guide monitor task (rate 500us priority 3)... success
MSG: Mount, library allocated 216 catalog records
MSG: Mount, ST4 start monitor task (rate 1.7ms priority 1)... success
MSG: Mount, start tracking monitor task (rate 1000ms priority 6)... success
MSG: StepDirDriver3, TMC standstill automatic current calibration
MSG: Rotator, start derotation task (rate 1s priority 6)... success
MSG: StepDir3, driver powered up using pin 11
MSG: Rotator, unpark position 0.00 deg
MSG: StepDirDriver4, TMC standstill automatic current calibration
MSG: Focusers, starting TCF task (rate 1s priority 6)... success
MSG: StepDir4, driver powered up using pin 28
MSG: Focuser1, unpark position 10453.33um
MSG: Telescope, start status LED task (rate 500ms priority 4)... success
MSG: Setup, start command channel A task (priority 5)... success
MSG: Setup, start command channel B task (priority 5)... success
MSG: Setup, start command channel ST4 task (priority 5)... success
MSG: Setup, start command channel Local task (priority 5)... success
MSG: SerialST4, activated


Howard Dutton
 

On Sat, Nov 26, 2022 at 09:07 AM, Peter Boreland wrote:
// Serial2: RX4 Pin 7,  TX4 Pin 8
Typo in comments, copy/pasted from MaxPCB3.6 pinmap.

No effect on operation.


Peter Boreland
 

I'm using the latest OnStepX download as of this morning. 

Validate:

#if !defined(SERIAL_B) && SERIAL_B_BAUD_DEFAULT != OFF
  #error "Configuration (Config.h): SERIAL_B isn't defined, SERIAL_B_BAUD_DEFAULT should be OFF."
#endif

Where does Serial_B get defined?


Peter Boreland
 

I take that back it's obviously Pins.MaxPCB4


Peter Boreland
 

Howard, really not sure what you did, but I downloaded the updated code you just posted and created a new build,  now everything works. You are a Saint for sure!

Peter