Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

rob42 said:
Ive googled all afternoon, and I'm at a loss, where do I get those utilities?

See here:
https://stm8-binutils-gdb.sourceforge.io/

regards
stancecoke
 
Thanks, I did find that, but when I tried it I ran into all sorts of compile errors etc. I'll try again fresh and try to be more specific about errors.
Rob
 
HughF said:
rob42 said:
Hi,

I'm trying to build and install this from the cloned git repo at https://github.com/AckmaniacSoftware/TSDZ2-Smart-EBike-compatible-with-original-VlCD6-display. Ive been through the various pages and explanations etc. setups and dev stuff. (I'm a developer, but usually in java)

Running on ubuntu 18.04, "make -f Makefile_linux all" I get an error :

stm8-size main.elf -A
make: stm8-size: Command not found

Sure enough I dont have that or `stm8-objcopy` which follows in the script.

Ive googled all afternoon, and I'm at a loss, where do I get those utilities?

Thanks
Rob
Hi Rob, sorry I can't help (I've tried googling and seem to end up at the same brick wall as you have), but do you have a windows machine you could use for this task? I know it is admitting defeat, but sometimes you just have to use what delivers the results unfortunately. It's a trait of the electronics industry that they tend to favour Windows with their toolchains, we get it with the Ti DSP assembler we use at work, Windows only.

After faffing about with SDCC the Java Configurator works well for me and I can at least quickly and easily build and test the various motor options.

Hugh

I've just compiled the FW on OSX with the same dependency issues. It's actually pretty easy to solve.

- The makefile uses stm8-size to show the file size of the compiled binary, purely optional.
- The makefile uses stm8-objcopy to strip debug info and reformat the .elf file to a .hex file. This can be done by the SDCC compiler without these additional dependencies.

TLDR; What I'd recommend is to use this makefile:
https://github.com/AckmaniacSoftware/TSDZ2-Smart-EBike-compatible-with-original-VlCD6-display/blob/master/TSDZ2_Controller_vM0.19.C_and_TSDZ2_Configurator_0.3.7_con_codice_0.19_Stable/src/controller/Makefile_ihx_windows

IMHO the best idea would be to make that Makefile default, not separate between linux/OSX, strip other build cruft and then upstream this in Git. TBH I need to understand a bit more about all the repo's, stakehoders, the italian forums and who is who before I put any effort into this.
 
Thanks for that, I found another option too. In linux (ubuntu 18.04 with SDCC 3.8 I have some related commands

sdasstm8 - -plosgffw main //manipulates symbols etc
sdldstm8 -nf main.lk //linker

I found it all worked by just running `sdldstm8 -nf main.lk` in the src/controller dir after the make process errored. Gave me a main.ihx file which flashed and worked.
 
rob42 said:
Thanks for that, I found another option too. In linux (ubuntu 18.04 with SDCC 3.8 I have some related commands

sdasstm8 - -plosgffw main //manipulates symbols etc
sdldstm8 -nf main.lk //linker

I found it all worked by just running `sdldstm8 -nf main.lk` in the src/controller dir after the make process errored. Gave me a main.ihx file which flashed and worked.

Sweet, glad to hear you have a working solution.
 
Mbrusa released his code for the 0.20 in the italian forum (sadly as zip-file in the forum, not as repo at github) now. Thank you mbrusa! The GUI is still missing, you have to edit the config.h manually at the moment. I wonder if all 111 (!!!) :shock: parameters need to be adjusted by the "standard user". I suggest to keep only parameters that have to be adjusted by most users in the config.h and move the "advanced settings" to the main.h (e.g.)
With about 20 parameters it would be much faster to build the adapted GUI!

regards
stancecoke
 
stancecoke said:
Mbrusa released his code for the 0.20........ The GUI is still missing, you have to edit the config.h manually at the moment. ...........
Thanks to mbrusa we have the possibility to try the v.020 beta1 for default displays.
Yes, it is without a Java Gui, so you must edit config.h
Most parameters are already useable, so edit the configurations you have to change (tyre-size, speed, battery capacity etc.)
For compiling and programming you can use the xxx_20.bat files. Hopefully Marcoq or someone else will make a Java gui later too.

For the ones that want to edit the parameters inside config.h
I have made an English Google translation of the Italian guides inside the "mb.20beta1.A" firmware file (manuals directory).

View attachment EN-Configuration-guides-TSDZ2-mb.20beta1.A.zip
 
How does it work with the vlcd6? It doesn't have a light button. To turn on the lights you have keep press up bottom.
 
Nfer said:
How does it work with the vlcd6? .....
The release is just published and only tested by two users (mbrusa and chr27.5)
So every feedback will be welcome if you want to try this release.
I presume that in that case you must "press up" for confirmation of different modes.
This was the same with mbrusa v0.19C data additions too.
I advice to read at the Italian jobike forum too.
 
Elinx said:
The release is just published

I've moved most parameters to the file advanced.h and started a GUI:
https://github.com/stancecoke/TSDZ2-Smart-EBike

The GUI is not working yet, it will take two more hours of work, I think...

regards
stancecoke

GUI.PNG
 
Elinx said:
Nfer said:
How does it work with the vlcd6? .....
The release is just published and only tested by two users (mbrusa and chr27.5)
So every feedback will be welcome if you want to try this release.
I presume that in that case you must "press up" for confirmation of different modes.
This was the same with mbrusa v0.19C data additions too.
I advice to read at the Italian jobike forum too.

Hi Nfer,
with vlcd6 the light button and the down button.
Attention to work well you have to hold for about two seconds.
if you need help I can make a video.
 
stancecoke said:
Elinx said:
The release is just published

I've moved most parameters to the file advanced.h and started a GUI:
https://github.com/stancecoke/TSDZ2-Smart-EBike

The GUI is not working yet, it will take two more hours of work, I think...

regards
stancecoke

GUI.PNG

Hi Stancecoke,
I agree with you that fewer parameters are put into the Gui, the simpler it is to use for less experienced users, but to do a good job all the parameters present in config.h should be put, exactly as mBrusa did.
Thanks in advance for your contribution.
 
Elinx said:
Nfer said:
How does it work with the vlcd6? .....
The release is just published and only tested by two users (mbrusa and chr27.5)
So every feedback will be welcome if you want to try this release.
I presume that in that case you must "press up" for confirmation of different modes.
This was the same with mbrusa v0.19C data additions too.
I advice to read at the Italian jobike forum too.


Hi Elinx,
we have been testing this new version since December, I can tell you that the work done by mBrusa is exceptional, for my part I can say that I struggle to choose which mode to use between:
Pawer assist
Torque assist
eMtb mode
because both are fine.
I can't wait to try this version and give your feedbak.
 
Veramente sono 111? Non li avevo contati…
La scelta di quali parametri mettere in main.h e quali in config.h l’ho fatta e il risultato è questo!
Una GUI è comoda ma la caratteristica più importante del firmware open source è mantenere la possibilità di personalizzazione, può essere anche ibrida come stai già facendo, una scheda per i parametri indispensabili e una scheda per i parametri delle modalità di guida (6x4=24), gli altri rimanenti possono essere modificati in un file. Buon lavoro e grazie.
Io in questo momento ho poco tempo, riprenderò lo sviluppo tra 2/3 settimane.

Google translator

Hi stanceckoke, are they really 111? I hadn't counted them ...
The choice of which parameters to put in main.h and which in config.h I made and the result is this!
A GUI is convenient but the most important feature of the open source firmware is to maintain the possibility of customization, it can also be hybrid as you are already doing, a tab for the indispensable parameters and a tab for the riding mode parameters (6x4 = 24) , the rest of them can be edited in a file. Good job and thank you.
I currently have little time, I will resume development in 2/3 weeks.
 
mbrusa said:
The choice of which parameters to put in main.h and which in config.h I made and the result is this!
You are right, mixing the advanced parameters in the main.h is not a good idea. Therefore I moved them to the advanced.h. I plan to use the second button in the GUI to open the advanced.h with notepad.
If someone gets bored, he can make the advanced parameters available in the GUI :wink:

mbrusa said:
Good job and thank you.
You are welcome!

regards
stancecoke
 
stancecoke said:
mbrusa said:
The choice of which parameters to put in main.h and which in config.h I made and the result is this!
..... Therefore I moved them to the advanced.h. I plan to use the second button in the GUI to open the advanced.h with notepad.
If it is always possible to edit all functions and seperate them in "basic" and "advanced" configurations, then there should be no problem for everyone.

Till there is a working Gui I have made configuration sections in the English Google translation and improve the layout a bit.
View attachment EN-Parameter-Config.h-guide-TSDZ2-mb.20beta1.A.pdf
 
Elinx said:
Till there is a working Gui

Here you are!

The configurator works now for the basic settings. I think it is mostly self explanatory.
https://github.com/stancecoke/TSDZ2-Smart-EBike


GUI_working.PNG


For people who want to bring the advanced settings into the GUI:
You'll need approximatly 5 minutes for each advanced parameter to port.
At the moment you can set 14 parameters of 111 with the GUI :wink:
Use the netbeans IDE for development, the sourcefiles are placed in the tools-folder.

If there are very important parameters that should be in the basic settings, please tell me.

regards
stancecoke
 
mbrusa said:
there is a problem in the config.h file

I just fixed the bugs , see the last commit :)
Please report, if it works now!


famichiki said:
When are the .ini files saved, upon compiling & flashing? Are they saved in JSON format or something proprietary?
The .ini files are just simple text files. They content the values of the textfields and true/false for the radio buttons in the same order as in the config.h. They are written at the same time as the config.h

With the start of the GUI, the newest .ini file in the proven settings folder is loaded. So if you are satisfied with a setup, just rename the .ini file in the experimental settings folder and copy it into proven settings.

To add a new parameter to the GUI you have to
1. Install NetBeans
2. fork my repo at github, then open Netbeans and import the project from github with -->team-->git-->clone
3. double-click on TSDZ2_Configurator.java in the project explorer
4. go to the Design Tab (2)
5. Place a text field via drag and drop in the GUI (3). With right click on the new text field you can edit the default text and the variable name. Add a label for the text field by drag and drop (4).
6. switch to the source tab (2)
7. add the new parameter to the load settings function (line 101...) in the same syntax as the existing parameters
Code:
TF_MAX_SPEED.setText(in.readLine());
8. add the new parameter to the action performed function (line 241...) in the same syntax as the existing parameters
Code:
text_to_save = "#define WHEEL_MAX_SPEED " + TF_MAX_SPEED.getText();
iWriter.println(TF_MAX_SPEED.getText()); //writes .ini file
pWriter.println(text_to_save);  // writes config.h
TF_MAX_SPEED is the variable name in this example.

Make sure, that the parameters are in the same order in both functions!

NetbeansGUI.PNG

To build the .jar file, right click on the project name in the project explorer and click Build. The .jar file is saved in the /dist folder

regards
stancecoke
 
Does anyone know if it's possible to add a brake sensor to a controller which has only the 6-pin display cable? Perhaps soldering a wire on the controller and connecting that to the sensor?
 
ilu said:
Does anyone know if it's possible to add a brake sensor to a controller which has only the 6-pin display cable? Perhaps soldering a wire on the controller and connecting that to the sensor?

You may want to move this over to the other main thread but its already wired, its only the throttle wires which are missing. look at https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Wire-SW102-to-TSDZ2 for the pinouts.
 
For some reason I'm really struggling to get the GUI to operate correctly on my PC, its probably me :) . Is there anyway we could just get one of you guys to just compile a file for the motor and make it public, sort of what Buba and Co did. It would save a lot of pain for the less computer literate who can program the motor but struggle with the GUI.
 
Back
Top