Hi,
I would like to use the following board to make this focuser.
Seeed studio XIAO ES32-C3.
What would be the easiest way to add this board ?
This board only has 11 GPIO pins so I'm guessing I would have to make a jsn file for this board and add it's option to the firmware boarddefs.h ?
Here's the board pinout.
The number of available pins will limit the options for this board.
6 pins are needed for the DRV8825 stepper driver,
1 pin for temperature,
1 pin for home position switch (would like to use hall effect sensor at some point),
3 pins are spare and could be used for either i2c for the display, In/Out leds or In/Out PB(none of which are necessary for me).
Reason for this board is that its footprint is only slightly larger than the stepper driver board, which will allow for very small footprint.
Regards
Last edit: Woodpeckercz 2023-11-03
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Any particular reason why it's not supported? I couldn't find it referenced anywhere. Could be blind, that's always a possibility.
I also have S3 version of the board, would that work?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
it is a little naive to think that all ESP32 devices are the same. I guess there are some that think esp32x = esp32y, sadly it is not the case that all esp32 devices are the same.
For me to support the hundreds of different ESP32 variations, would require me to
purchase each variation
make firmware versions for each variation
test and debug everything across all variations
etc
As someone on very limited funding, its hard finding funds for one variation, let alone many, There are also not enough hours in a day to do that, And I think users would find the result a spaghetti of changes, making firmware harder to configure and result in increased issues for users to deal with. (as well as complicate the support level etc).
Hence, for projects, I put together something, and I say "use this and this" and if the user follows those instructions, they can have a certain degree of assurance they will end up at a successful journey end with a working system, with a minimal of stress and heartache. That is why the documentation is of a high standard, AND the firmware well documented/commented, and TEST programs provided, not to mention the free online support here or via email.
The PDF and firmware is quite specific, esp32 dev module is the only esp32 chip supported. The Wemos version uses the same ESP32 chip, and is supported because of the help I received from other users of the project who provided WEMOS kit and assisted with all the testing etc that went with all of that,
As stated, there are numerous esp32 chip variations. Hardly a week goes by and a new variant comes out. The esp32 dev module is cheap and widely available.
The Arduino core for esp32 is done by the ExpressIF guys. And you cannot expect that the core generates the same code that runs generically on every esp32 chip. That is not the case. Each chip vaiation is selected via "Target CPU" so that when you compile for C3 the code is NOT the same as generated for "ESP32 Dev Module". This is especially true at the hardware level, which is important because many of the pins of the esp32 chip are used for interface purposes for devices like display, joysticks, push buttons, temperature probes etc. There are also differences in clock events/handling as well as WiFi differences,
For example, one of the variations generated for the WEMOS chip is that the I2C pins are different from the ESP32 Dev, meaning that I2C devices will fail unless the hardwiring is changed to support the WEMOS boards. But its not just limited to the I2C bus, it also affects SPI and EEPROM amongst others. And some of the S2/C3 also have issues running the Hardware timers required for the state machine. Hence any C3/S3 variations are NOT supported.
What you are suggesting is akin to this - Lets take the Car computer from a Checvy V8 and drop it into a Toyota four-cyclinder and expect it will work. Expressed on that level I think it becomes clear that "why not - it is an ESP32" is not the right question.
I apologize if all this sounds negative or basic to you, that is not my intent, I am trying to highlight the difficulties any developer has with a plethora of devices and dealing with user expectations that are not easily achievable. The reason there are restrictions mentioned in the PDF and Firmware is to prevent (or limit) chaos as a result.
Regards
Robert
Last edit: brownrb 2023-11-03
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the extensive reply, didn't realise there is such a disparity between the esp32 boards.
I didn't mean to sound ungrateful, I'm astonished by the level of detail and work that has gone into your projects.
My intention was to gain some guidance to be able to test this board rather than having you doing the work.
I understand the need for limiting the chaos as you said.
I have very little understanding of programing so most of the time I trial and error my way through projects to get them to suit my needs.
I do not wish to waste your time on this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I found some information on the boards, looks like the C3 is intended as an upgrade to esp8266 chips, S2 is meant as upgrade to ESP-Wroom-32 chip and the S3 is beefed up S2 with some built in AI stuff.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
One other tip - sometimes one just has to wait a while for the memory to find the right info, it takes longer to find the on switch as one gets older.
The standard uploader for data sketch files does not work with the S2/C2/S3 chips.
From memory the uploader for those chips is .. oh yes, my memory just flicked on a light
Oh I found this. An email I got from Higany who converted the code to an S2. Hope it helps. I am unable to do this as I do not have any S2/S3 type boards. But he has done the work and it runs, so all credit to him for doing the work and sharing what he found.
Regards
Robert
HiganyHello,FewyearsagoIbuilttheprojectonacustomPCBwithaLolinD1miniESP8266board&DRV8825controlboard.TheESP8266supportwasremovedfromtheproject,butLolincameoutaLolinD1Minipin-compatibleESP32-S2breakoutboard,calledtheLolinS2-Mini.S2MiniIdidn't want to throw out my PCBs and enclosure, so I decided to upgrade my controller with the S2-Mini.There were a few pitfalls, but at the end it works.Here are my findings, maybe it will help others:1. Controller not starting:The ESP32-S has a native USB port, and the controller didn'tstartuntilIopenedtheserialmonitorinArduinoIDE.Thiswhilecyclehadtobecommentedoutinmyfp2esp32F.inotomakeitworkwiththeS2://while(!Serial)//{//;//waitforserialporttostart//}2.Motornotmoving&BoardoptionsMaybemyDRV8825boardhadsomehiccups,butIcouldn't get the motor moving with the CUSTOMBRD & 99.json tweaking. It worked after I defined the DRVBRD PRO2ESP32DRV8825 instead and modified, 44.jsn according to my pins.{ "board":"PRO2ESP32DRV8825","maxstepmode":32,"stepmode":1,"enpin":7,"steppin":9,"dirpin":11,"temppin":18,"hpswpin":-1,"inledpin":-1,"outledpin":-1,"pb1pin":-1,"pb2pin":-1,"irpin":-1,"brdnum":44,"stepsrev":-1,"fixedsmode":1,"brdpins":[-1,-1,-1,-1],"msdelay":4000 }3. I2C pins:Needed to modify in Controller_defines.h according to the D1 Mini -> S2 Mini pinout:// I2C#define I2CDATAPIN 33#define I2CCLKPIN 354. ESP32 Sketch data downloader:The manual refers to an old version of the ESP32 sketch data downloader, which doesn'tsupporttheS2.Thisistherecentone,whichsupportstheS2chip:ArduinoESP32filesystemuploader(SPIFFShastobeselected)SPECIALNOTEPluginrequiredforPRO2ESP32LOLINS2MINIboardsarduino-esp32fs-pluginhttps://github.com/lorol/arduino-esp32fs-pluginOther:TheS2-MinihasadoublerowofpinsforextraGPIOs,sosoftwareselectionofstepsidewouldbealsopossiblewith3Dupont-wiresontheexistingPCB,butIamhappywiththejumperselection,becauseithastobeonlysetonceanyway.MyPCBisaminimalD1mini&DRV8825boardwithtempsensorandLCDoptions.Pins:Function|D1Mini|ESP8266GPIO|ESP32-SGPIOEN|D5|14|7STEP|D6|12|9DIR|D7|13|11SCL|D1|5|35SDA|D2|4|33TEMP|D3|0|18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How are things going?
If you want, send me the board pin numbers etc, and I will look at defining and then integrating the board into ,yFP2ESP32. Another board was added recently, LilyGo T-Motor
which Eric built. That will appear in the next update.
Regards
Robert
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Robert,
I’am working on the XIA0 ESP32-C3.
It’s like a rescent ESP32 (S2, S3)
The main issue is that Serial 2 is not defined.
We have to add :
//Define Serial2 devices mapped to the internal UARTs
#ifdef ARDUINO_XIAO_ESP32C3
HardwareSerial Serial2(0);
#endif
And to set it up :
Serial2.begin(115200,SERIAL_8N1, 20, 21);
At boot time some logs are sended on this serial port.
De : brownrb
Envoyé le :mardi 19 décembre 2023 10:29
À : [myfocuserpro2-esp32:discussion]
Objet :[myfocuserpro2-esp32:discussion] Re: adding board support (XIAO ESP32-C3)
How are things going?
If you want, send me the board pin numbers etc, and I will look at defining and then integrating the board into ,yFP2ESP32. Another board was added recently, LilyGo T-Motor
which Eric built. That will appear in the next update.
Regards
Robert
Hello, how is this going?
I saw that the newest version has integrated support for PRO2ESP32TMC2209XIAOC3 by Eric, and I'm trying to adapt this for my setup (ESP32 C3 Supermini + a4988), but when I start the code, it immediately crashes after connecting to the WiFi AP.
This is when using MultiAP:
I then tried to disable multiAP and hardcode the stations info in the relative header, as I saw something funky going on (there's probably a return missing in the setup), and instead I got this, which at least seem to be more explicit about what's going wrong:
The only thing that comes to mind is that I've used PRO2ESP32DRV8825 as my profile base (changing the pinouts where necessary) instead of PRO2ESP32TMC2209XIAOC3, but when looking at all the places where the latter define is used, it doesn't look like there's anything major going on there that might explain this crash.
I also know that the C3 has only two timers (hence the exception) and IIRC one of the timers is also used by the wifi, but if somehow the C3 profile disabled some timer(s) I'd expect it to see underneath the relative ifdefs directives.
Is the profile for PRO2ESP32TMC2209XIAOC3 actually working? Am I missing something?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I remember a buffer to small when printing the IP address in the debug
log that cause similar issue.
The main change for the C3 is Serial and only 2 timers.
That have been addressed in my code.
I haven't tested the DRV8825
Best regards
Le 12/08/2024 à 14:42, Marco Gulino a écrit :
Hello, how is this going?
I saw that the newest version has integrated support for
PRO2ESP32TMC2209XIAOC3 by Eric, and I'm trying to adapt this for my
setup (ESP32 C3 Supermini + a4988), but when I start the code, it
immediately crashes after connecting to the WiFi AP.
This is when using MultiAP:
I then tried to disable multiAP and hardcode the stations info in the
relative header, as I saw something funky going on (there's probably a
return missing in the setup), and instead I got this, which at least
seem to be more explicit about what's going wrong:
The only thing that comes to mind is that I've used PRO2ESP32DRV8825
as my profile base (changing the pinouts where necessary) instead of
PRO2ESP32TMC2209XIAOC3, but when looking at all the places where the
latter define is used, it doesn't look like there's anything major
going on there that might explain this crash.
I also know that the C3 has only two timers (hence the exception) and
IIRC one of the timers is also used by the wifi, but if somehow the C3
profile disabled some timer(s) I'd expect it to see underneath the
relative ifdefs directives.
Is the profile for PRO2ESP32TMC2209XIAOC3 actually working? Am I
missing something?
The main change for the C3 is Serial and only 2 timers.
I'd say that's the thing I'm missing... I couldn't find where you disabled the extra timer(s), where would that be? I looked in the code for where "PRO2ESP32TMC2209XIAOC3" is used, but couldn't see anything related to timers, mostly just the TMC stuff (which I don't need).
Thank you!
Marco
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Not so sure that multiap is not working, it says
13:37:12.155 > multiap connected successfully
meaning it connected ok
then you had a crash
Next when you did specify the multip by hand (which i think was unnecessary) you got
Timer number 2 exceeds available number of Timers.
Thats an obvious one. The chip you are using only supports timers 0 and 1.
And mysqm+ requires three timers to work
Regards
Robert
Last edit: brownrb 2024-08-14
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've made a change, in the past, to use only 2 timer for the XIAO C3.
Best regards
Eric
Le 14/08/2024 à 12:56, brownrb a écrit :
Not so sure that multiap is not working, it says
13:37:12.155 > multiap connected successfully
meaning it connected ok
then you had a crash
Next when you did specify the multip by hand (which i think was
unnecessary) you got
Timer number 2 exceeds available number of Timers.
Thats an obvious one. The chip you are using only supports timers 0 and 1.
At this point the thing to do is run the exception decoder to generate a back trace on the code.
That may give you the offending code
Howeverm as I previously stated above in this thread And some of the S2/C3 also have issues running the Hardware timers required for the state machine. Hence any C3/S3 variations are NOT supported.
Your complie environment should be
// Firmware 310+
//
// Arduino IDE 1.8.19
// Expressif ESP32 Core 2.0.16 https://github.com/espressif/arduino-esp32
//
// NOTE
// DO NOT Update to ESP32 Core 3.0.0 or higher
as noted in the about.h file.
We will only migrate to core 3,x,x when all the bugs in those core versions are fixed. There are signification changes in the base IDF version, first in v4 and then the recent update to v 5, and so the arduino core v3xxx is still playing catchup mode to the changes in the underlying IDF updates . I beleive I posted this on one of the esp32 projects recently
Sorry, I probably didn't express myself well... I didn't mean to imply it's not working, just that it's somehow polluting/confusing the stacktrace (I did notice something odd in the multiAP code, but it's probably unrelated. I'll have a better look later)
Next when you did specify the multip by hand (which i think was unnecessary) you got
I just tried to simplify the workflow and reduce the number of factors involved (which kinda worked, as I got a more readable stacktrace).
And mysqm+ requires three timers to work
Uh.. what's that? And can it be disabled?
At this point the thing to do is run the exception decoder to generate a back trace on the code.
That may give you the offending code
I'm already running the exception decoder, that's why I see at least a partial stacktrace. I assume some parts are not decoded because it's either in parts of the code that is unreachable by the exception decoder, or perhaps the Serial logger doesn't print the whole thing (I've seen this before).
And some of the S2/C3 also have issues running the Hardware timers required for the state machine. Hence any C3/S3 variations are NOT supported.
I know.. but still, if a C3 is already in the current release, I wouldn't see why my variation wouldn't work, especially with most of the optional stuff disabled (I plan to run just the basic focuser, webserver, and possibly an i2c display. Nothing more).
// DO NOT Update to ESP32 Core 3.0.0 or higher
Great, that's something else I missed :) I'll give it a go!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ESP32 C3 Supermini and Xiao ESP32 C3 have a some different pinout and
GPIO usage.
I sure I will be able to make it work but there is some work to do and I
have not this board ( I have a lot but not this one)
Le 14/08/2024 à 13:54, Marco Gulino a écrit :
Not so sure that multiap is not working, it says
Sorry, I probably didn't express myself well... I didn't mean to imply
it's not working, just that it's somehow polluting/confusing the
stacktrace (I did notice something odd in the multiAP code, but it's
probably unrelated. I'll have a better look later)
I'm already running the exception decoder, that's why I see at least a
partial stacktrace. I assume some parts are not decoded because it's
either in parts of the code that is unreachable by the exception
decoder, or perhaps the Serial logger doesn't print the whole thing
(I've seen this before).
I know.. but still, if a C3 is already in the current release, I
wouldn't see why my variation wouldn't work, especially with most of
the optional stuff disabled (I plan to run just the basic focuser,
webserver, and possibly an i2c display. Nothing more).
// DO NOT Update to ESP32 Core 3.0.0 or higher
Great, that's something else I missed :) I'll give it a go!
ESP32 C3 Supermini and Xiao ESP32 C3 have a some different pinout and
GPIO usage.
I sure I will be able to make it work but there is some work to do and I
have not this board ( I have a lot but not this one)
Thank you :)
But if it's easier for you to remember where this third timer is disabled, I already have all the pinout reshuffled here locally.
I'll try after work to see if I can spot it on my own as well, it's just a bit overwhelming given all the amount of optional configs in the codebase!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Got there in the end :)
It looks like the issue is that in
void init_task_timer() {
//Serial.println("Tasktimer started");
init_task_counters();
// using a define in place of 2, the task timer did not start
task_timer = timerBegin(2, 80, true);
we need to use
task_timer = timerBegin(0, 80, true);
instead.
Also, I noticed that the controller waits indefinitely for the serial port to be available, so the infinite loop in setup needs to be disabled, such as for the PRO2ESP32LOLINS2MINI board (or possibly, move it to a timed wait, timing out after a few seconds, I do the same in some of my projects).
Both these changes should be addressed, as I would assume that the current release shouldn't work with the XIAOMI C3 either. If not done earlier, I will add them to my patch once I finish wrapping up my board support (if that's desired of course)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I noticed that the controller waits indefinitely for the serial port to be available,
It does not.
Some esp32 newer models may not have a serial port. I wrote this code for myesp32 Dev module. So obviously because it has a serial port, it will exit the while loop as soon as the serial port has started.
It will of course for a device that does not have a serial port the while will not exit. The while() associated with the serial port is standard practice in the Arduino world.
void setup() {
// serial port is used for runtime messages and debugging support
Serial.begin(SERIALPORTSPEED);
if (myboardnumber != PRO2ESP32LOLINS2MINI) {
while (!Serial) {
;
}
}
You can always add another board check here.
if ( (myboardnumber != PRO2ESP32LOLINS2MINI) || (myboard_numer != PRO2ESP32TMC2209XIAOC3) ) {
On the question of using #define, I use that with this controller code By using the defines, it removes code from compilation when that would fail or reference code it cannot call, because of the chip type or options chosen. Without that, the linked file to upload would be excessive and not fit in the space of the esp32, because every nearly every class would ned to be included and that blows up all of memory then some more. Obviously if I only supported 1 drive chip and 1 cpu type then there would be very few parts that would need to be excluded.
Now that project mysqm+ update has been posted, and the myFP2 updates completed, I am now focuing on the next focuser update 313 but more likely to be higher as it gets ready for release.
I am working my way through the code update for myesp32 focuser, and there are a lot of new stuff as well as all the fixes to be applied.
Regards
Robert
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I'm wondering if th esp32-c3 code is working. in the fdiscussion here it is unclear if it is functional or not. c3 support would realy be very attractive since it is just so much smaller than the normal devboard.
further, can the aarduino Ide 2 be used or do i still need v1?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I'm wondering if th esp32-c3 code is working. in the fdiscussion here it
is unclear if it is functional or not. c3 support would realy be very
attractive since it is just so much smaller than the normal devboard.
It does, but some patching is required (mostly the timer thing).
There's also the esp32-s3-zero with a similar footprint, and a bit less
patching required (probably just the custom pinout if necessary)
Hi,

I would like to use the following board to make this focuser.
Seeed studio XIAO ES32-C3.
What would be the easiest way to add this board ?
This board only has 11 GPIO pins so I'm guessing I would have to make a jsn file for this board and add it's option to the firmware boarddefs.h ?
Here's the board pinout.
The number of available pins will limit the options for this board.
6 pins are needed for the DRV8825 stepper driver,
1 pin for temperature,
1 pin for home position switch (would like to use hall effect sensor at some point),
3 pins are spare and could be used for either i2c for the display, In/Out leds or In/Out PB(none of which are necessary for me).
Reason for this board is that its footprint is only slightly larger than the stepper driver board, which will allow for very small footprint.
Regards
Last edit: Woodpeckercz 2023-11-03
silly me. just noticed the customboard option in the firmware
I'll share the board design when I have it done.
Yeah, but I expect you will run into issues because the firmware does not support C3. It is mentioned in a number of places
Regards
Robert
Any particular reason why it's not supported? I couldn't find it referenced anywhere. Could be blind, that's always a possibility.
I also have S3 version of the board, would that work?
Hi
it is a little naive to think that all ESP32 devices are the same. I guess there are some that think esp32x = esp32y, sadly it is not the case that all esp32 devices are the same.
For me to support the hundreds of different ESP32 variations, would require me to
purchase each variation
make firmware versions for each variation
test and debug everything across all variations
etc
As someone on very limited funding, its hard finding funds for one variation, let alone many, There are also not enough hours in a day to do that, And I think users would find the result a spaghetti of changes, making firmware harder to configure and result in increased issues for users to deal with. (as well as complicate the support level etc).
Hence, for projects, I put together something, and I say "use this and this" and if the user follows those instructions, they can have a certain degree of assurance they will end up at a successful journey end with a working system, with a minimal of stress and heartache. That is why the documentation is of a high standard, AND the firmware well documented/commented, and TEST programs provided, not to mention the free online support here or via email.
The PDF and firmware is quite specific, esp32 dev module is the only esp32 chip supported. The Wemos version uses the same ESP32 chip, and is supported because of the help I received from other users of the project who provided WEMOS kit and assisted with all the testing etc that went with all of that,
As stated, there are numerous esp32 chip variations. Hardly a week goes by and a new variant comes out. The esp32 dev module is cheap and widely available.
The Arduino core for esp32 is done by the ExpressIF guys. And you cannot expect that the core generates the same code that runs generically on every esp32 chip. That is not the case. Each chip vaiation is selected via "Target CPU" so that when you compile for C3 the code is NOT the same as generated for "ESP32 Dev Module". This is especially true at the hardware level, which is important because many of the pins of the esp32 chip are used for interface purposes for devices like display, joysticks, push buttons, temperature probes etc. There are also differences in clock events/handling as well as WiFi differences,
For example, one of the variations generated for the WEMOS chip is that the I2C pins are different from the ESP32 Dev, meaning that I2C devices will fail unless the hardwiring is changed to support the WEMOS boards. But its not just limited to the I2C bus, it also affects SPI and EEPROM amongst others. And some of the S2/C3 also have issues running the Hardware timers required for the state machine. Hence any C3/S3 variations are NOT supported.
What you are suggesting is akin to this - Lets take the Car computer from a Checvy V8 and drop it into a Toyota four-cyclinder and expect it will work. Expressed on that level I think it becomes clear that "why not - it is an ESP32" is not the right question.
I apologize if all this sounds negative or basic to you, that is not my intent, I am trying to highlight the difficulties any developer has with a plethora of devices and dealing with user expectations that are not easily achievable. The reason there are restrictions mentioned in the PDF and Firmware is to prevent (or limit) chaos as a result.
Regards
Robert
Last edit: brownrb 2023-11-03
Thanks for the extensive reply, didn't realise there is such a disparity between the esp32 boards.
I didn't mean to sound ungrateful, I'm astonished by the level of detail and work that has gone into your projects.
My intention was to gain some guidance to be able to test this board rather than having you doing the work.
I understand the need for limiting the chaos as you said.
I have very little understanding of programing so most of the time I trial and error my way through projects to get them to suit my needs.
I do not wish to waste your time on this.
I found some information on the boards, looks like the C3 is intended as an upgrade to esp8266 chips, S2 is meant as upgrade to ESP-Wroom-32 chip and the S3 is beefed up S2 with some built in AI stuff.
Hi again.
One other tip - sometimes one just has to wait a while for the memory to find the right info, it takes longer to find the on switch as one gets older.
The standard uploader for data sketch files does not work with the S2/C2/S3 chips.
From memory the uploader for those chips is .. oh yes, my memory just flicked on a light
Oh I found this. An email I got from Higany who converted the code to an S2. Hope it helps. I am unable to do this as I do not have any S2/S3 type boards. But he has done the work and it runs, so all credit to him for doing the work and sharing what he found.
Regards
Robert
Thanks, I'll try this tonight.
How are things going?
If you want, send me the board pin numbers etc, and I will look at defining and then integrating the board into ,yFP2ESP32. Another board was added recently, LilyGo T-Motor
which Eric built. That will appear in the next update.
Regards
Robert
Hi Robert,
I’am working on the XIA0 ESP32-C3.
It’s like a rescent ESP32 (S2, S3)
The main issue is that Serial 2 is not defined.
We have to add :
//Define Serial2 devices mapped to the internal UARTs
#ifdef ARDUINO_XIAO_ESP32C3
HardwareSerial Serial2(0);
#endif
And to set it up :
Serial2.begin(115200,SERIAL_8N1, 20, 21);
At boot time some logs are sended on this serial port.
So enable the Driver (TMCXXXX) after.
I will test that within a week
Pins are :
And Pins number are define as :
ifndef Pins_Arduino_h
define Pins_Arduino_h
include <stdint.h></stdint.h>
static const uint8_t TX = 21;
static const uint8_t RX = 20;
static const uint8_t SDA = 6;
static const uint8_t SCL = 7;
static const uint8_t SS = 20;
static const uint8_t MOSI = 10;
static const uint8_t MISO = 9;
static const uint8_t SCK = 8;
static const uint8_t A0 = 2;
static const uint8_t A1 = 3;
static const uint8_t A2 = 4;
static const uint8_t A3 = 5;
static const uint8_t D0 = 2;
static const uint8_t D1 = 3;
static const uint8_t D2 = 4;
static const uint8_t D3 = 5;
static const uint8_t D4 = 6;
static const uint8_t D5 = 7;
static const uint8_t D6 = 21;
static const uint8_t D7 = 20;
static const uint8_t D8 = 8;
static const uint8_t D9 = 9;
static const uint8_t D10 = 10;
endif / Pins_Arduino_h /
Prototype schematics (5Vcc power via USB):
Regards
Eric
Envoyé à partir de Courrier pour Windows
De : brownrb
Envoyé le :mardi 19 décembre 2023 10:29
À : [myfocuserpro2-esp32:discussion]
Objet :[myfocuserpro2-esp32:discussion] Re: adding board support (XIAO ESP32-C3)
How are things going?
If you want, send me the board pin numbers etc, and I will look at defining and then integrating the board into ,yFP2ESP32. Another board was added recently, LilyGo T-Motor
which Eric built. That will appear in the next update.
Regards
Robert
adding board support (XIAO ESP32-C3)
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/myfocuserpro2-esp32/discussion/general/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
--
Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
www.avast.com
Hello, how is this going?
I saw that the newest version has integrated support for PRO2ESP32TMC2209XIAOC3 by Eric, and I'm trying to adapt this for my setup (ESP32 C3 Supermini + a4988), but when I start the code, it immediately crashes after connecting to the WiFi AP.
This is when using MultiAP:
I then tried to disable multiAP and hardcode the stations info in the relative header, as I saw something funky going on (there's probably a return missing in the setup), and instead I got this, which at least seem to be more explicit about what's going wrong:
The only thing that comes to mind is that I've used PRO2ESP32DRV8825 as my profile base (changing the pinouts where necessary) instead of PRO2ESP32TMC2209XIAOC3, but when looking at all the places where the latter define is used, it doesn't look like there's anything major going on there that might explain this crash.
I also know that the C3 has only two timers (hence the exception) and IIRC one of the timers is also used by the wifi, but if somehow the C3 profile disabled some timer(s) I'd expect it to see underneath the relative ifdefs directives.
Is the profile for PRO2ESP32TMC2209XIAOC3 actually working? Am I missing something?
Hi Marco.
I will have a look later.
I make it workd for PRO2ESP32TMC2209XIAOC3
Some fixes may be missing int the latest release.
I remember a buffer to small when printing the IP address in the debug
log that cause similar issue.
The main change for the C3 is Serial and only 2 timers.
That have been addressed in my code.
I haven't tested the DRV8825
Best regards
Le 12/08/2024 à 14:42, Marco Gulino a écrit :
--
Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
www.avast.com
I see,
I'd say that's the thing I'm missing... I couldn't find where you disabled the extra timer(s), where would that be? I looked in the code for where "PRO2ESP32TMC2209XIAOC3" is used, but couldn't see anything related to timers, mostly just the TMC stuff (which I don't need).
Thank you!
Marco
Not so sure that multiap is not working, it says
13:37:12.155 > multiap connected successfully
meaning it connected ok
then you had a crash
Next when you did specify the multip by hand (which i think was unnecessary) you got
Timer number 2 exceeds available number of Timers.
Thats an obvious one. The chip you are using only supports timers 0 and 1.
And mysqm+ requires three timers to work
Regards
Robert
Last edit: brownrb 2024-08-14
Hello Robert
I've made a change, in the past, to use only 2 timer for the XIAO C3.
Best regards
Eric
Le 14/08/2024 à 12:56, brownrb a écrit :
--
Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
www.avast.com
*13:37:12.155 > multiap connected successfully
13:37:12.160 > Guru Meditation Error: Core 0 panic'ed (Load access fault). Exception was unhandled.
13:37:12.160 > *
At this point the thing to do is run the exception decoder to generate a back trace on the code.
That may give you the offending code
Howeverm as I previously stated above in this thread
And some of the S2/C3 also have issues running the Hardware timers required for the state machine. Hence any C3/S3 variations are NOT supported.
Your complie environment should be
// Firmware 310+
//
// Arduino IDE 1.8.19
// Expressif ESP32 Core 2.0.16 https://github.com/espressif/arduino-esp32
//
// NOTE
// DO NOT Update to ESP32 Core 3.0.0 or higher
as noted in the about.h file.
We will only migrate to core 3,x,x when all the bugs in those core versions are fixed. There are signification changes in the base IDF version, first in v4 and then the recent update to v 5, and so the arduino core v3xxx is still playing catchup mode to the changes in the underlying IDF updates . I beleive I posted this on one of the esp32 projects recently
https://sourceforge.net/p/mysqmproesp32/discussion/general/thread/eb00bc100c/?limit=25&page=4#0831
Also take note that the esp32 chip should have 2 cores, not 1. This project is a killer app for esp32 and requires twin cores to operate reliably.
Regards
Robert
Last edit: brownrb 2024-08-14
Sorry, I probably didn't express myself well... I didn't mean to imply it's not working, just that it's somehow polluting/confusing the stacktrace (I did notice something odd in the multiAP code, but it's probably unrelated. I'll have a better look later)
I just tried to simplify the workflow and reduce the number of factors involved (which kinda worked, as I got a more readable stacktrace).
Uh.. what's that? And can it be disabled?
I'm already running the exception decoder, that's why I see at least a partial stacktrace. I assume some parts are not decoded because it's either in parts of the code that is unreachable by the exception decoder, or perhaps the Serial logger doesn't print the whole thing (I've seen this before).
I know.. but still, if a C3 is already in the current release, I wouldn't see why my variation wouldn't work, especially with most of the optional stuff disabled (I plan to run just the basic focuser, webserver, and possibly an i2c display. Nothing more).
Great, that's something else I missed :) I'll give it a go!
Hi Marco,
ESP32 C3 Supermini and Xiao ESP32 C3 have a some different pinout and
GPIO usage.
I sure I will be able to make it work but there is some work to do and I
have not this board ( I have a lot but not this one)
Le 14/08/2024 à 13:54, Marco Gulino a écrit :
--
Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
www.avast.com
Thank you :)
But if it's easier for you to remember where this third timer is disabled, I already have all the pinout reshuffled here locally.
I'll try after work to see if I can spot it on my own as well, it's just a bit overwhelming given all the amount of optional configs in the codebase!
Got there in the end :)
It looks like the issue is that in
we need to use
instead.
Also, I noticed that the controller waits indefinitely for the serial port to be available, so the infinite loop in setup needs to be disabled, such as for the PRO2ESP32LOLINS2MINI board (or possibly, move it to a timed wait, timing out after a few seconds, I do the same in some of my projects).
Both these changes should be addressed, as I would assume that the current release shouldn't work with the XIAOMI C3 either. If not done earlier, I will add them to my patch once I finish wrapping up my board support (if that's desired of course)
Hi
I noticed that the controller waits indefinitely for the serial port to be available,
It does not.
Some esp32 newer models may not have a serial port. I wrote this code for myesp32 Dev module. So obviously because it has a serial port, it will exit the while loop as soon as the serial port has started.
It will of course for a device that does not have a serial port the while will not exit. The while() associated with the serial port is standard practice in the Arduino world.
void setup() {
// serial port is used for runtime messages and debugging support
Serial.begin(SERIALPORTSPEED);
if (myboardnumber != PRO2ESP32LOLINS2MINI) {
while (!Serial) {
;
}
}
You can always add another board check here.
if ( (myboardnumber != PRO2ESP32LOLINS2MINI) || (myboard_numer != PRO2ESP32TMC2209XIAOC3) ) {
On the question of using #define, I use that with this controller code By using the defines, it removes code from compilation when that would fail or reference code it cannot call, because of the chip type or options chosen. Without that, the linked file to upload would be excessive and not fit in the space of the esp32, because every nearly every class would ned to be included and that blows up all of memory then some more. Obviously if I only supported 1 drive chip and 1 cpu type then there would be very few parts that would need to be excluded.
Now that project mysqm+ update has been posted, and the myFP2 updates completed, I am now focuing on the next focuser update 313 but more likely to be higher as it gets ready for release.
I am working my way through the code update for myesp32 focuser, and there are a lot of new stuff as well as all the fixes to be applied.
Regards
Robert
Hi all,
I'm wondering if th esp32-c3 code is working. in the fdiscussion here it is unclear if it is functional or not. c3 support would realy be very attractive since it is just so much smaller than the normal devboard.
further, can the aarduino Ide 2 be used or do i still need v1?
On Thu, 17 Jul 2025 at 16:28, hans joggel hansjoggel@users.sourceforge.net
wrote:
There's also the esp32-s3-zero with a similar footprint, and a bit less
patching required (probably just the custom pinout if necessary)