TSDZ2 OSF for all displays, VLCD5-VLCD6-XH18, LCD3, 860C-850C-SW102.

A bit of googling finds this page
https://mcu-eetrend-com.translate.goog/tag/mm32?_x_tr_sch=http&_x_tr_sl=zh-CN&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=sc
that mentions both STM32 and MM32 but I am not sure if what it says means that they are compatible or not.

This page
https://www.keil.com/dd2/
lists things that are compatible with their software packs (ARM Cortex) and includes both MM32 and STM32 but again I don't know if that means they are compatible or not.

If you know the systems better than I do (likely) then you might find confirmation (or otherwise) on those pages, if it is there.
 
Thank's, but the problem is that the code OSF for LCD3 is made for STM8 , not for STM32 or MM32, until someone rewrites the firmware for LCD3 it is not possible to install on the new LCD3, mine bought it on Aliexpress, another user it bought you PSWpower. :(
 
ginor61 said:
Thank's, but the problem is that the code OSF for LCD3 is made for STM8 , not for STM32 or MM32,
Well, I'm confused then why you'd ask if it was STM32 compatible, when what you need is STM8 compatible?
 
you're right, I just asked if MM32 was compatible with ST32 to understand if it was at least readable with STlink and STM32flash, out of curiosity and to warn that the new LCDs are not + programmable with the old firmware...... for now the use of the new LCD3 is impossible,if no one converts the code for the new micro.
Sorry for my english , but i'm Italian.
 
Good morning,

I am have trouble understanding the calibration process of this interesting firmware ( v20.1C.4-860C - thank you mbrusa ) and could use some clarification. I have a 48 volt TSDZ2 with 860c display, and prior to yesterday I had the OSF 1.0.0 firmware installed on my recumbent trike and running well. I have the temperature sensor+modifications installed, they work well. The calibration process is fairly different with that older firmware.

1. In the menu I made sure that Torque Sensor / Calibration is 'disabled'
2. I read the ADC values in the Technical page and found the “Pedal torque ADC offset” and “Pedal torque ADC max” values.
3. I went back to the Torque Sensor and entered those values in the fields.
4. I then set Calibration to 'enabled'.

Am I doing this correctly so far? If so, what is next? Should I leave the setting 'enabled' for some amount of time, then reset it to 'disabled'. Should I leave it 'enabled'? I'm just not sure of the process after inserting those ADC values.

In some riding tests yesterday I saw much lower motor assist levels than in my prior firmware. I saw a maximum of about 240 watts of motor power, and maximum motor current of 4.6 amps. Both of these are much lower than before, even though I have the motor watts set to 700 and battery max amps set to 16. Assist levels are 1 to 5, with 1/50 2/100 3/150 4/200 5/250.

Thanks for input and suggestions.
 
The calibration procedure is correct.
After entering the “Pedal torque ADC offset” and “Pedal torque ADC max” values, the calibration must always be enabled.
Regarding the limited assistance, you are probably trying in "Street mode", by default the power is limited to 250 W (disclaimer in EU).
Increase this limit or use "Offroad mode"
 
Thank you!

>>After entering the “Pedal torque ADC offset” and “Pedal torque ADC max” values, the calibration must always be enabled.
I will leave Calibration 'enabled' after entering these values.

Street Mode - ok, let me go look there. I didn't even set those things up. When I power on the system I have seen 'Power Assist' or Torque Assist' or "Hybrid Assist' on the bottom of the 860 screen. I've not seen Street Mode appear. Gonna go look now.

UPDATED
Done, and the result is magical! Motor is quieter at higher power/speeds, very responsive. Thanks very much.
 
I just upgrade my 860C and the TSDZ2 OSF V20.1C.3 to .4 and all is working great except when I try to configure
the "Street mode" the display blanks out and 0X2, 0X80060B2 is displayed and everything locks-up. It than requires a battery shut down to reset. All other functions will configure and save properly. The bike functions normal and everything, brakes, display, throttle, PAS seem to be working normally. This error only happens when I try to select the "Street Mode" from the configuration menu. I did reflash the display and motor twice, with .4, and I still get the error.
 
The problem you report is known, has always been present in all versions for 860C, randomly while navigating the configuration menu.
I still don't understand the cause, also because when it crashes, no debugging is possible.

In your case, does the problem occur even if you select "Street mode" as the first entry at login in the configuration menu?

I have tried and on no entry it crashes on first access.
Only by jumping from one menu item to another can it happen.
After accessing one menu item, if I need to access another, I exit the setup menu and re-entry.
I've never had any problems with this method.
 
mbrusa said:
The problem you report is known, has always been present in all versions for 860C, randomly while navigating the configuration menu.
I still don't understand the cause, also because when it crashes, no debugging is possible.

In your case, does the problem occur even if you select "Street mode" as the first entry at login in the configuration menu?

I have tried and on no entry it crashes on first access.
Only by jumping from one menu item to another can it happen.
After accessing one menu item, if I need to access another, I exit the setup menu and re-entry.
I've never had any problems with this method.

Thanks for your reply, I love your software. If I enter the menu and select the "Street Mode" first, I can get in with no problems to make changes. As a test, I selected the "Motor Temperature" mode first, exited to the menu, then selected the "Street Mode" and I get the 0X2 error again. This doesn't seem to be a major problem, but my only concern is that I just replaced a defective controller, which I believed failed due to me shutting off the battery first instead of the display first. Right now, I cringe when I have to shut off the battery to reset a locked-up system.
 
I just tried to flash my TSDZ2 (VLCD5), using the java configurator.
I pulled the master branch (based on v20.1C.2), and followed the manual.
but how can I confirm the flashing was successful, or debug a failed flash?
There is no need to flash the VLCD5 right?

I think the flash failed: When I connect the battery again and turn it on the display still shows the stock menu.
the JavaConfigurator closes the terminal after compilation & flashing, so not very useful to debug.

I did make a backup of all my tabs (when stock), using STVisualProgrammer, so I am connected correctly.
I used short cables from ST-LinkV2 to TSVD2 connector (and an usb extention cable from ST-LinkV2 to my pc.
I have the 'Old' controller( I measured 5V following this post)

Can anyone provide some information how to debug a failed flash? Or tell me what I can expect after a successful flash?
Thanks.

Edit: The wiki doesn't describe the flash procedure following the Java Configurator (only this method is described ).
I flashed with my battery disconnected, assuming it uses the 5V from my ST-LinkV2. is this correct?
 
washichi said:
I just tried to flash my TSDZ2 (VLCD5), using the java configurator.
I pulled the master branch (based on v20.1C.2), and followed the manual.
but how can I confirm the flashing was successful, or debug a failed flash?
There is no need to flash the VLCD5 right?

I think the flash failed: When I connect the battery again and turn it on the display still shows the stock menu.
the JavaConfigurator closes the terminal after compilation & flashing, so not very useful to debug.

I did make a backup of all my tabs (when stock), using STVisualProgrammer, so I am connected correctly.
I used short cables from ST-LinkV2 to TSVD2 connector (and an usb extention cable from ST-LinkV2 to my pc.
I have the 'Old' controller( I measured 5V following this post)

Can anyone provide some information how to debug a failed flash? Or tell me what I can expect after a successful flash?
Thanks.

Edit: The wiki doesn't describe the flash procedure following the Java Configurator (only this method is described ).
I flashed with my battery disconnected, assuming it uses the 5V from my ST-LinkV2. is this correct?

When flashing was successfull it just does what you describe - the CMD window closes.
When flashing did not work the window will remain open , state teh error and state "Press any key to close"
So you should be good.
Also, the display menue does not change with the updated firmware (how should it, as we do not flash the display?) But some of the entries have different meanings. You need to read the PDFs included in the manual subfolder of the pulled github branch
 
washichi said:
I just tried to flash my TSDZ2 (VLCD5), using the java configurator.....
....
I flashed with my battery disconnected,... is this correct?
You refer to the wrong wiki version
How to flash with Java configurator, you must use the mbrusa version.
Also you can read the first page of "EN-Parameter_configurator_guide-TSDZ2-v20.1C.2.pdf" which comes with the firmware.

You only need to flash the motor controller.
Do not connect the battery and use the Voltage from STlink
STVP and SDCC must be installed inside the root of hdd.
STVP can run with a graphical interface and with a command prompt.
The Java configurator start always the command prompt version, so be sure to close the graphical version, before you hit "compile and flash"
If the flashing starts you can read all the commands.
You can read also the errors if something went wrong.
 
Thank you guys, this explains everything. I'm positive it's flashed now, and will go for a test ride.
Because of the Forks the readme and links are a bit confusing.
The wiki you referenced is helpful!

Time to give it a test :D
 
Just got my TSDZ2 setup with v20.1C.2 for VLCD5. I can't compare to stock FW since I immediately flashed when I received it (I love to void warranties), but it feels pretty great to me! I just have some questions / bug reports I want to mention:

1. Does anyone know how to reset the odometer on the VLCD5? I've read on some manuals that you go to ODO on the display and hold down +,-,power all at the same time for 10 seconds but it doesn't seem to clear for me. My VLCD software version appears to be 5.1 from the hidden menu, not the 3.6 that I commonly see in manuals floating around the internet.

2.Data display for battery current does not seem to work. I've set it as Data 2 in the Java configurator and when the display cycles to it, it only reads 0. My only guess as to what's wrong is that I originally flashed some option bytes according to the upstream wiki from mbrusa's repo:

https://github.com/OpenSourceEBike/TSDZ2_wiki/wiki/Flash-the-firmware-on-TSDZ2

Code:
Erase protection:
echo "00 00 ff 20 df 00 ff 00 ff 00 ff 00 ff 00 ff" | xxd -r -p > option_bytes_pwm_n_channels_enabled.bin
stm8flash -c stlinkv2 -p stm8s105?6 -s opt -w option_bytes_pwm_n_channels_enabled.bin

Taking a glance at the stm8 datasheet mentions that bytes 20 df up there are for alternate function remapping (AFR) which I'm guessing is selecting different functions for the stm8's IO pins. Is it possible this remapped the pin that would normally have been used for current sensing? I don't know what the correct or stock option bytes to test with are.

3. I have both the Java configurator and VLCD5 set for MPH, most data displays correctly but the SOC% shows as 62.4% instead of 99.9%. There was some discussion recently about it as well:

https://endless-sphere.com/forums/viewtopic.php?f=30&t=110682&p=1713582&hilit=mph#p1713582

Really strange to me that SOC% doesn't display correctly, while everything else does. In the ebike_app.c, all the data uses the same "ui16_display_data_factor", which accounts for kilometers/miles units. There's nothing special about the data right? I'm guessing the stock display only expects "speedometer" data, but the OSF is using this channel to send out custom data to be displayed.

Anyways, none of these things are real dealbreakers, just wondering if anyone has any solutions. I love the firmware and am thankful for all the work that has been done.
 
So, let's go in order.

1 - ODO cannot be reset, only TRIP can.

2 - Motor current is not a given I use, but it should work. I'll check anyway.
Option byte must not be changed!
The correct values are these:
option_byte_osf.jpg

3 - Regarding SOC% which displays 62.4 instead of 99.9, it is very strange.
I use XH18 but these days I also have a VLCD5, I have tried and SOC% is as reported, 62.4 instead of 99.9, the other data is fine.
I'll try to understand why.
Probably 62.4 is the maximum value that can be displayed with VLCD5, when set in miles.

It's never over!
 
Thanks for the firmware and reply mbrusa.

mbrusa said:
2 - Motor current is not a given I use, but it should work. I'll check anyway.
Option byte must not be changed!
The correct values are these:
option_byte_osf.jpg

So I should be able to use the option_stock.ihx from the repo? I'm on Linux so I don't have STVP to verify the option bytes, could you paste the contents of your option_stock.ihx for me to review? Mine is:

Code:
$ cat option_stock.ihx
:0148000000B7
:0148010000B6
:01480300288C
:0148050000B2
:0148070000B0
:0148090000AE
:01480B0000AC
:01480D0000AA
:01487E000039
:00000001FF

I think this would be worth mentioning in the wiki instructions to explicitly use your option_stock.ihx.

mbrusa said:
3 - Regarding SOC% which displays 62.4 instead of 99.9, it is very strange.
I use XH18 but these days I also have a VLCD5, I have tried and SOC% is as reported, 62.4 instead of 99.9, the other data is fine.
I'll try to understand why.
Probably 62.4 is the maximum value that can be displayed with VLCD5, when set in miles.

It's never over!

Haha don't kill yourself over it! I'm going to try hardcoding data values in the ui16_data_value_array to 999 to test your hypothesis tomorrow.
 
If anyone is interested, https://www.electrifybike.com/ has many of the older versions of new old stock LCD3 displays available.
They are not on the website. If you are interested, let me know.
 
Hi everyone, I'm releasing an update to fix some small bugs.

TSDZ2 Open Source Firmware for stock displays XH18 - VLCD5 - VLCD6.
https://github.com/emmebrusa/TSDZ2-Smart-EBike-860C/releases/tag/v20.1C.4-860C-update-1
List of changes v20.1C.2 update 1
1 - Fixed "Startup assist" feature.
2 - Assist without pedaling, can also be activated with negative torque offset.
3 - E08 error speed sensor failure, disabled in Walk assist mode.
4 - E05 error motor check, monitoring time increased.

TSDZ2 Open Source Firmware v20.1C.4-860C for 860C display
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1/releases/tag/v20.1C.2-update-1
List of change v20.1C.4-860C update 1
1 - Fixed "Startup assist" feature.
2 - Assist without pedaling, can also be activated with torque offset <20.
3 - Disabled error E08 speed sensor failure, in Walk assist mode.
4 - Fixed "BRAKE" status message problem.
5 - Fixed problem with setting the odometer in miles.

I remember that this version was only tested with 860C and P860C displays (until May 2022).
With newer displays P860C, 850C, P850C, SW102, it may not work.
 
I have 860C display and 850C_v20.1C.4

I was driving yesterday when suddenly the assistance disappeared. I turned off the power and turned it on again. I was only able to drive for about 20 seconds when the assistance disappeared again. This was repeated many times. I also noticed that the speed did not appear on the display. No error messages were displayed.

Today I replaced the speed sensor and the motor works again.

Is there other signals than the speed passing between the speed sensor and the motor that interferes the operation of the motor. I had assist with error enabled.
 
The problem you reported is caused only by the faulty speed sensor.
After 12 seconds without receiving impulses, it goes into error and assistance is removed. It could be more than 12 seconds, because a pulse is enough to restart the time.
I need to understand why E08 Speed fault was not displayed.

dameri said:
...
Is there other signals than the speed passing between the speed sensor and the motor that interferes the operation of the motor. I had assist with error enabled.
Is it a question?
 
Okay I understood that failure was at speed sensor. And thanks for explaining.

My question was:
Is there other signals than the speed passing between the speed sensor and the motor that interferes the operation of the motor?
 
Thanks mbrusa for some great software. I see you have released some new versions addressing bugs recently.

I posted a question on the forum a while back about a potential minor bug in the KT LCD3 version of your software (v20.1C.3-LCD3), but no one posted a response. The bug I have noticed is that the icon for the brake sensors no longer shows on the LCD3 screen when the brakes are applied and the brake sensor is active. I can confirm the bug exists for me across 2 motors and 3 displays so is unlikely to be hardware related.

The brake sensors work and kill the motor power, it’s just that there is no visible icon on the screen. Version v20.1C-LCD3 shows the icon as expected. The only real problem with the bug is when setting up brake sensor magnet positions, I have to flash the older version onto the display and motor to position the sensors using the brake activation icon for guidance, then re-flash to the latest version.

All other aspects of the software are just awesome!
 
New to the Forum... Thank you OSF Developers. I love this motor…

I installed a new OSF TSDZ2 w/ 860C from Electrify Bike on my Trek 8.5DS. 860C firmware is 0.20.1c-4 and TSDZ2 firmware is 0.21.4.

I removed my Bafang 750W BBSO2 and kept the 48V 12.8Ah Mini Shark E-Bike Battery (Panasonic NCR18650BD Cells). The battery is capable of 30 Amps continuous discharge.

I’m riding in Power Assist Mode and can only get 500W max motor power. I’ve been tinkering with settings and graphing Motor Power, Motor Current, and Battery Current on the display to capture maximum values during a ride.

It looks like I’m getting close to 500 Watts of power with 19A at battery and 9A at the motor. 9 Amps at the motor x 54 Volts = 486 Watts. So, that makes sense….

What I’m trying to achieve is, not only more power (750W), but also less human effort required (lighter force on peddles).

Questions: Should I try a different Assist Mode? What variables should I change?

I can add motor temp sensing if necessary.

Thank you in advance….
 
dameri said:
Okay I understood that failure was at speed sensor. And thanks for explaining.

My question was:
Is there other signals than the speed passing between the speed sensor and the motor that interferes the operation of the motor?
There is only a relationship between the speed detected by the sensor and the motor.
The speed is used in the calculation of the acceleration and deceleration ramps.
Ramps are inversely proportional to speed.
Low speed, long ramp times.
High speed, short ramp times.
If the sensor is faulty, by enabling "Assist with error" the motor works, but the ramps are not calculated, they always have a long time.

I tried to disconnect the sensor, after 12 seconds there is "e 8 Speed fault", the message remains for 12 seconds.
This with the new version.
 
Back
Top