Bafang 850C color LCD, currently working for TSDZ2 motor -- Flexible OpenSource firmware

I just connected the 850c and flashed my motor with the latest firmware.

Everything was turning on, and I could even get the walk assist to work, but I couldn't get any motor power or readings for human power.

Any ideas on what I should do?

Thanks
 
hobbbes said:
I just connected the 850c and flashed my motor with the latest firmware.

Everything was turning on, and I could even get the walk assist to work, but I couldn't get any motor power or readings for human power.

Any ideas on what I should do?

Thanks
Make sure you did flash correctly and with the correctly firmware versions. Go to the wiki and follow again the instructions.
 
h27 said:
casainho said:
You are correct, I forgot to implement the save variable so it will never make any difference at startup. I will finish that as also make the system reset automatically every time the user changes that configuration.
Great, thanks.
This time is done and I was able to test on my 850C. And I saw that is ugly/hard to find the option when the LCD is inverted. I need to put more time to figure out how to correctly detect the LCD version.

850C_v0.4.2: https://github.com/OpenSource-EBike-firmware/Color_LCD/releases/tag/850C_v0.4.2
 
casainho said:
h27 said:
casainho said:
You are correct, I forgot to implement the save variable so it will never make any difference at startup. I will finish that as also make the system reset automatically every time the user changes that configuration.
Great, thanks.
This time is done and I was able to test on my 850C. And I saw that is ugly/hard to find the option when the LCD is inverted. I need to put more time to figure out how to correctly detect the LCD version.

850C_v0.4.2: https://github.com/OpenSource-EBike-firmware/Color_LCD/releases/tag/850C_v0.4.2
Thanks again for you work. Is this the bootloader version? And if not: Would you be kind enough to also produce the bootloader version (or tell me how to do it)?
By the way: Last weekend I finally could take my first ride on the new bike with versions 0.4.1 and 0.19.0. It was a great experience and it all worked well. The display was still inverse but I got used to read backwards after a while (the settings were more difficult to achieve).
Great job!
I will try the new version in the next days and report
 
h27 said:
Thanks again for you work. Is this the bootloader version? And if not: Would you be kind enough to also produce the bootloader version (or tell me how to do it)?
Done. Seems there was an error when I did attach on the release the bootloader version file.
 
Got new file from github

"NOTE: this versions was developed for TSDZ2 motor controller firmware v0.19.0.

Corrected the LCD vertical flip."

Still inverted - do i need to change any setting for the flip ?
 
bennyschudo said:
Got new file from github

"NOTE: this versions was developed for TSDZ2 motor controller firmware v0.19.0.

Corrected the LCD vertical flip."

Still inverted - do i need to change any setting for the flip ?
Yes, on configurations, the option display -> LCD vertical flip. I need to put this on wiki.
 
That worked :) - need to flash the motor now

btw anyone knows the name of those connectors they use on the tsdz2 (no brake and throttle version) and or where to buy them
 
casainho said:
h27 said:
Thanks again for you work. Is this the bootloader version? And if not: Would you be kind enough to also produce the bootloader version (or tell me how to do it)?
Done. Seems there was an error when I did attach on the release the bootloader version file.
Thanks for version 0.4.2., casainho. Works perfectly. The immediade reset after a change of the setting is a very nice extra!
 
just a idea instead of detecting the display - cant you read the "counter" value thats displayed in the flash tool

If thats = 0 then = first init = ask for inverted or regular
 
Hi Guys,

I'm trying to get a 850c screen to run with the "OpenSource-EBike-firmware/Color_LCD" firmware.
Flashing the 850c wasn't a problem, I opened the screen and soldered an upload/flash cable to the pins and closed the case again.

The thing is I wasn't sure which file to use. Either the "850C_v0.4.2-bootloader.bin" or the "850C_v0.4.2.bin" file. In the end I read in the Wiki on Github the you should use the "bootloader" version for SWD.
I tried both of the files, but none of them will boot the screen.

If I use the 850C-v0.4.2.bin:
- grey screen after flashing
- power toggle:
* 24V on battery pin
* white screen
* No action after any button press

If I use the 850C-v0.4.2-bootloader.bin:
- black screen after flashing
- power toggle:
* 24V on battery pin
* black screen
* No action after any button press

The question for me now is which file to use?
Because the one I shouldn't use is giving me at least a white screen. (Based on "White screen of death" threads, I did get a recent version from pswpower.com)

Another basic question I have is if the screen will boot as a standalone device. I just hooked up the "Battery" and "GND" pins. Or is it mandatory to connect to a TSDZ2 with the "OpenSource-EBike-firmware/TSDZ2-Smart-EBike" firmware? Reading the source code didn't reveal an obvious init blocking.


Just a quick question about the method to flash. I'm using the JTAG SWD method with ST-Link USB. At the moment I used Windows and the STM32-ST-LINK Utility software to flash the *.bin files.
On the wiki page I read the linux is also possible and somewhere on the forum I read that the active coders (casainho and geeksville) are using Linux, Eclipse and OpenOCD. I'm a linux user, so for me it would be really helpful if the wiki could be extended to include more information about this setup. I guess GCC toolchain for ARM is also needed, and reading the eclipse site they mention GNC-MCU and a node.js method with a xpm version of OpenOCD.
Would you guys want to elaborate on the method of flashing, is this via command line or via eclipse tools? Which version of linux, Debian is giving met the Eclipse version 3.8, fairly old I discovered.

And before I forget, I need the thank the coders and community the make this all possible. Many thanks!

Regards,
LVX
 
lvx_xvl said:
Hi Guys,

I'm trying to get a 850c screen to run with the "OpenSource-EBike-firmware/Color_LCD" firmware.
Flashing the 850c wasn't a problem, I opened the screen and soldered an upload/flash cable to the pins and closed the case again.

The thing is I wasn't sure which file to use. Either the "850C_v0.4.2-bootloader.bin" or the "850C_v0.4.2.bin" file. In the end I read in the Wiki on Github the you should use the "bootloader" version for SWD.
I tried both of the files, but none of them will boot the screen.

If I use the 850C-v0.4.2.bin:
- grey screen after flashing
- power toggle:
* 24V on battery pin
* white screen
* No action after any button press

If I use the 850C-v0.4.2-bootloader.bin:
- black screen after flashing
- power toggle:
* 24V on battery pin
* black screen
* No action after any button press

The question for me now is which file to use?
Because the one I shouldn't use is giving me at least a white screen. (Based on "White screen of death" threads, I did get a recent version from pswpower.com)

Another basic question I have is if the screen will boot as a standalone device. I just hooked up the "Battery" and "GND" pins. Or is it mandatory to connect to a TSDZ2 with the "OpenSource-EBike-firmware/TSDZ2-Smart-EBike" firmware? Reading the source code didn't reveal an obvious init blocking.


Just a quick question about the method to flash. I'm using the JTAG SWD method with ST-Link USB. At the moment I used Windows and the STM32-ST-LINK Utility software to flash the *.bin files.
On the wiki page I read the linux is also possible and somewhere on the forum I read that the active coders (casainho and geeksville) are using Linux, Eclipse and OpenOCD. I'm a linux user, so for me it would be really helpful if the wiki could be extended to include more information about this setup. I guess GCC toolchain for ARM is also needed, and reading the eclipse site they mention GNC-MCU and a node.js method with a xpm version of OpenOCD.
Would you guys want to elaborate on the method of flashing, is this via command line or via eclipse tools? Which version of linux, Debian is giving met the Eclipse version 3.8, fairly old I discovered.

And before I forget, I need the thank the coders and community the make this all possible. Many thanks!

Regards,
LVX
I need to make the wiki more clear about the versions. If you soldered and wires, then it is the regular version without ¨bootloader¨.

Please try the previous versions, just in case.

If you still have the white screen, did you confirm that is the same microcontroller GD32xxx???

About the linux, maybe someone can write a wiki page about it.
 
Hi Casainho,

Thank you for your fast reply.

The chip is a GD32F103.



I've tried the "850C_v0.4.1.bin" with the same result a white screen after flashing and a power cycle.
Here is an image of the chip status form the STM32-ST-LINK Utility:

The "Bafang_LCD_850C_firmware-v0.4.0.bin" shows the same result up to the power toggle, but when I pressed the power button for a longer time it flipped to grey.
Just to be sure I didn't mess up the 0.4.1, I retried and indeed after 3+ seconds of holding the power button it also flips the screen to grey. Off course I then retried the 0.4.2 and there I now have the same result, after 3+ seconds it flips the screen to grey.

But it never boots to a working screen. Just to be sure I did already ask, is the firmware capable off booting without a TSDZ2 connected?

regards,
LVX
 
lvx_xvl said:
Hi Casainho,

Thank you for your fast reply.

The chip is a GD32F103.



I've tried the "850C_v0.4.1.bin" with the same result a white screen after flashing and a power cycle.
Here is an image of the chip status form the STM32-ST-LINK Utility:

The "Bafang_LCD_850C_firmware-v0.4.0.bin" shows the same result up to the power toggle, but when I pressed the power button for a longer time it flipped to grey.
Just to be sure I didn't mess up the 0.4.1, I retried and indeed after 3+ seconds of holding the power button it also flips the screen to grey. Off course I then retried the 0.4.2 and there I now have the same result, after 3+ seconds it flips the screen to grey.

But it never boots to a working screen. Just to be sure I did already ask, is the firmware capable off booting without a TSDZ2 connected?

regards,
LVX
So the microcontroller is the same.

Yes, it will show main screen image even without communicating with the 850C.

I would say your 850C was damaged or you have a different LCD controller, even different from the other 2 that firmware recognizes right now.

If I was you, I would take out the LCD from the 850C and I would try with another working LCD from another 850C unit. I think is possible that the LCD is damaged or has another controller inside. Or the main board is fault in part. With another working 850C unit, should be possible to test both.
 
Then I think I need a new display...damn...

I think it might blew on me when connecting the main cable at the back to an extension cable. The colouring of these wires is everything but what you expect, black isn't ground, red isn't power.... so it might be that at one point I switched the wires around.

For anyone reading this, be careful.
My extension cable had these colouring:
GND -> Red
Vin -> Yellow
Bat -> Blue
Rx -> Black
Tx -> Green

regards,
LVX
 
Hi, I paint pinout 850C plug:

cc7fdba67a33b131.jpg


143bbe1ecfb740e9.jpg


So, now cable colours isnt necessary.

Chip USB-UART + DC-DC converter works excellent

c28deee0fd4c9b89.jpg


df7ac90c86817f18.jpg


Thank You casainho for Your hard work !

Regards
redwater
 
Hello everyone!
First of all I must thank you for all your work I just hope I will be able to help in the future.

I'm thinking of flashing this firmware on my 850c display and TSDZ2 motor but I was curious if the throttle works.
Also if I find that it dose not work for me do you know if I can rollback the firmware to the original version?

Thanks you in advance!
 
genuev said:
1. I'm thinking of flashing this firmware on my 850c display and TSDZ2 motor but I was curious if the throttle works.
2. Also if I find that it dose not work for me do you know if I can rollback the firmware to the original version?
1. yes.
2. No.
 
I am trying to set up the environment to compile the 850C firmware under windows 8.
I have some virtual linux machines, but they are all 32 bit. arm-none-eabi-gcc wasn't available for 32 bit debian and compiling it from sources resulted in a large number of dependencies.
I followed the instructions on the site:
https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Development

I didn't change any proposed "\program Files(x86)\xxx file during install.
I had a bit of trouble downloading the eclipse installer. After some experiments the danish mirror server worked for me.
I skipped the step that installs openocd as I hope to use the buildin bootloader. It's not that I am afraid of a bit of soldering work, but after reclosing it for the 10th time, it will probably fall apart on a bumpy road. I understand that openocd is very helpfull in debugging, but never before had that luxury on embedded systems. I also assume the firmware has reached a state that sending debug info over the serial port is a valid option as well.
I hadn't installed the tsdz2 yet. Due to that, eclipse couldn't locate a make. After I pointed it to the tsdz2/tools/cygwin folder, things started to work (a little)
I removed SW102 from the build process as it pointed to some linux location for it's tools and I was focussing on the 850C.
I got a number of missing header file errors. I fixed them by pointing to the file in the folder relative to the file that had the missing header file.

#ifndef SW102
#include "../../850C/src/main.h"
#else
#include "main.h"
#endif

I assume some of the header files for the SW102 build have a different location. With my solution, it will still generate a "missing header file" error on that build. So, no harm done (I think)

Previous information is mostly for people trying to replicate steps.

This brings me to my problem. The linker is reporting 2 unresolved externals in the startup_stm32f10x_md.o file.
That file is generated from an assembly file (same name with .s extension)
It's having problems with
bl SystemInit
and
bl main.
The first can be found in CMSIS/system_stm32f10x.c and the second in main.c
I doubt this problem is due to windows. I assume the labels have to be defined external in the s file, or maybe they get an underscore in front of their name when they are made public. I have no experience with the arm processor family assembly.

So, anyone has a clue why that s file can't find the c functions?

The make clean process isn't working either under windows. It can't locate the rm command (which is linux)
As a temporary fix, I created a .bat file in the 850C src folder with the clean instructions:

del *.o
del ..\..\common\src\*.o
del .\spl\src\*.o
del .\spl\CMSIS\*.o

I haven't checked the map file yet to see how the labels main and SystemInit are represented there.
(I temporary removed the bl SystemInit and bl main from the s file. It compiles and links fine without them (obvious won't run, I know.)
 
obcd said:
I am trying to set up the environment to compile the 850C firmware under windows 8.

I haven't checked the map file yet to see how the labels main and SystemInit are represented there.
(I temporary removed the bl SystemInit and bl main from the s file. It compiles and links fine without them (obvious won't run, I know.)
Today I did many builds and debug with OpenOCD and I did a few commits. All working for me on Linux.
 
Thanks for the reply.

I just noticed that the 850C/src folder c files aren't compiled and linked under windows.
So, it's an issue with make not finding those files.
I'll see if the tsdz2 makefile differences between windows and linux are any helpfull.

In case I'll switch to linux, what version are you using?
 
Adding the needed c files manually to the makefile SOURCES did the trick. It's compiling and linking under windows now.
 
I've managed to flash 850c display with 850C_v0.5.0-beta.1 firmware and TSDZ2 motor controller firmware v0.19.0 (current stable version).
It seems to be all good but the throttle that I can not seem to make it work.
I've checked all the settings that I can find in display and all I can find is Motor temperature that in sub-menu feature I find three options:
1. disable
2. throttle
3. temperature

If I set it to throttle I get a temperature warning when I push the throttle.
Is there a setting that I've missed?

Thanks
 
Also in the Technical screen when I push on the throttle I see 0 value on 'ADC throttle sensor' but 'Throttle sensor' seems to show the correct values from 0 to 255 based on how I push the throttle.

So it seems that the throttle is read but it is just ignored.
I get the feeling that there is a setting that I've missed. :-|
 
genuev said:
Also in the Technical screen when I push on the throttle I see 0 value on 'ADC throttle sensor' but 'Throttle sensor' seems to show the correct values from 0 to 255 based on how I push the throttle.

So it seems that the throttle is read but it is just ignored.
I get the feeling that there is a setting that I've missed. :-|
I will look at it. I think there is an issue when enabling the throttle.
 
Back
Top