Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Hey all I'm pretty confused about what version works with what. Should the latest hex for TSDZ2 work with Alpha 0.19.12? I see you all are talking about higher versions, but for the life of me I can't find them. The link in the wiki goes here: https://github.com/OpenSource-EBike-firmware/SW102_LCD_Bluetooth/releases/

But if you click that repo name it says that project is deprecated. The reason I ask is I am getting a "motor not connected?" error on the SW102 (flashing it went fine) but I don't think it's my soldering.
 
Aquakitty said:
Hey all I'm pretty confused about what version works with what. Should the latest hex for TSDZ2 work with Alpha 0.19.12? I see you all are talking about higher versions, but for the life of me I can't find them. The link in the wiki goes here: https://github.com/OpenSource-EBike-firmware/SW102_LCD_Bluetooth/releases/

But if you click that repo name it says that project is deprecated. The reason I ask is I am getting a "motor not connected?" error on the SW102 (flashing it went fine) but I don't think it's my soldering.
You need the latest stable version of TSDZ2 firmware, v0.19.x.
 
casainho said:
Aquakitty said:
Hey all I'm pretty confused about what version works with what. Should the latest hex for TSDZ2 work with Alpha 0.19.12? I see you all are talking about higher versions, but for the life of me I can't find them. The link in the wiki goes here: https://github.com/OpenSource-EBike-firmware/SW102_LCD_Bluetooth/releases/

But if you click that repo name it says that project is deprecated. The reason I ask is I am getting a "motor not connected?" error on the SW102 (flashing it went fine) but I don't think it's my soldering.
You need the latest stable version of TSDZ2 firmware, v0.19.x.

Thank you.
 
The the latest sw102 firmware is here. You want 0.19.17: https://github.com/OpenSource-EBike-firmware/Color_LCD/releases

It has many improvements vs that old tree.

And you may be using a 0.19 version of the motor firmware. If you are using 0.20 motor firmware all of the current sw102 releases will show that message.
 
I currently have an SW102 display within an existing system and was hoping there was a way to get it functioning with a new KT controller upgrade that I recently purchased. Is this something that is possible given the open firmware available?
 
NoClassic said:
I currently have an SW102 display within an existing system and was hoping there was a way to get it functioning with a new KT controller upgrade that I recently purchased. Is this something that is possible given the open firmware available?
Would be possible if the developers of the OpenSource firmware for KT, would want to support the SW102 running our OpenSource firmware -- please ask on the KT firmware thread.
 
Hello,

As mentioned in the early posts of this thread, there is a way to backup the original firmware before tinkering with the device.
The method (also described here: https://blog.includesecurity.com/2015/11/NordicSemi-ARM-SoC-Firmware-dumping-technique.html in a way that I found clearer) involves locating a load instruction and looping on it.

To save time for those interested in backing up their unit, there is a such a load instruction at address 0x6B2.
Then, the dump script should be:
base = 0
loop on 256k
- set R3 = base
- set PC = 0x6B3
- step the core
- get value of R3 and save it (this is the word value @ base)
- base += 4
(I'm not using open ODC, so I cannot reproduce the actual commands, just the pseudo-script)

Sorry if this has been covered in a previous post, I somehow missed the updates here. It will take me time to read them through and I only planned for a quick visit today.

I'm also working on this display for my project (I plan to code a controller as well as the display) so I will make sure not to miss updates anymore.

Cheers,

Stephane
 
Is there currently a problem with the SW102 firmware version 19.17 and using the throttle?

I assumed a problem with the throttle would be in the drive controller firmware, but others have it working it seems.

In the technical menu, I see the ADC values change with the throttle, but the motor does not spin. It does spin with walk assist, so the motor and controller are working. My bike is still on the build rack so I can't quite ride it yet...

Someone else mentioned it could be overvotlage cutoff. I charge to 58.8V, but the display shows 59.6V Is there a way to adjust the cutoff or the adc calibration in the display or should I look to fix it in the code?

Thanks!
 
Btw I made this article into a tool I used when I was doing the solderless update work: https://github.com/geeksville/nrf51-extractor

Steph said:
Hello,

As mentioned in the early posts of this thread, there is a way to backup the original firmware before tinkering with the device.
The method (also described here: https://blog.includesecurity.com/2015/11/NordicSemi-ARM-SoC-Firmware-dumping-technique.html in a way that I found clearer) involves locating a load instruction and looping on it.

To save time for those interested in backing up their unit, there is a such a load instruction at address 0x6B2.
Then, the dump script should be:
base = 0
loop on 256k
- set R3 = base
- set PC = 0x6B3
- step the core
- get value of R3 and save it (this is the word value @ base)
- base += 4
(I'm not using open ODC, so I cannot reproduce the actual commands, just the pseudo-script)

Sorry if this has been covered in a previous post, I somehow missed the updates here. It will take me time to read them through and I only planned for a quick visit today.

I'm also working on this display for my project (I plan to code a controller as well as the display) so I will make sure not to miss updates anymore.

Cheers,

Stephane
 
gatorsean said:
Is there currently a problem with the SW102 firmware version 19.17 and using the throttle?

I assumed a problem with the throttle would be in the drive controller firmware, but others have it working it seems.

In the technical menu, I see the ADC values change with the throttle, but the motor does not spin. It does spin with walk assist, so the motor and controller are working. My bike is still on the build rack so I can't quite ride it yet...

Someone else mentioned it could be overvotlage cutoff. I charge to 58.8V, but the display shows 59.6V Is there a way to adjust the cutoff or the adc calibration in the display or should I look to fix it in the code?

Thanks!
Look at git log recent commits, I did enable throttle on 850C, see if the same need to be done on SW102.

It would be very strange your motor controller to measure such wrong value of 59.6V when it is 58.8V. I also charge my 3 ebikes with 58.8V and all the 3 motor controllers measure well.
And I don't remember if the motor controller is limiting due to high voltage, if so, we need to make an error code for that situation and show to user on display.
 
casainho said:
gatorsean said:
Is there currently a problem with the SW102 firmware version 19.17 and using the throttle?

I assumed a problem with the throttle would be in the drive controller firmware, but others have it working it seems.

In the technical menu, I see the ADC values change with the throttle, but the motor does not spin. It does spin with walk assist, so the motor and controller are working. My bike is still on the build rack so I can't quite ride it yet...

Someone else mentioned it could be overvotlage cutoff. I charge to 58.8V, but the display shows 59.6V Is there a way to adjust the cutoff or the adc calibration in the display or should I look to fix it in the code?

Thanks!
Look at git log recent commits, I did enable throttle on 850C, see if the same need to be done on SW102.

It would be very strange your motor controller to measure such wrong value of 59.6V when it is 58.8V. I also charge my 3 ebikes with 58.8V and all the 3 motor controllers measure well.
And I don't remember if the motor controller is limiting due to high voltage, if so, we need to make an error code for that situation and show to user on display.

It looks like this should be the line of code to change to enable throttle? &1 is for temp, &3 is for throttle?
case 8:
// motor temperature limit function or throttle
ui8_g_usart1_tx_buffer[5] =
l2_vars.ui8_temperature_limit_feature_enabled & 3;
 
gatorsean said:
casainho said:
gatorsean said:
Is there currently a problem with the SW102 firmware version 19.17 and using the throttle?

I assumed a problem with the throttle would be in the drive controller firmware, but others have it working it seems.

In the technical menu, I see the ADC values change with the throttle, but the motor does not spin. It does spin with walk assist, so the motor and controller are working. My bike is still on the build rack so I can't quite ride it yet...

Someone else mentioned it could be overvotlage cutoff. I charge to 58.8V, but the display shows 59.6V Is there a way to adjust the cutoff or the adc calibration in the display or should I look to fix it in the code?

Thanks!
Look at git log recent commits, I did enable throttle on 850C, see if the same need to be done on SW102.

It would be very strange your motor controller to measure such wrong value of 59.6V when it is 58.8V. I also charge my 3 ebikes with 58.8V and all the 3 motor controllers measure well.
And I don't remember if the motor controller is limiting due to high voltage, if so, we need to make an error code for that situation and show to user on display.

It looks like this should be the line of code to change to enable throttle? &1 is for temp, &3 is for throttle?
case 8:
// motor temperature limit function or throttle
ui8_g_usart1_tx_buffer[5] =
l2_vars.ui8_temperature_limit_feature_enabled & 3;
3 options there: temperature, throttle and all disabled. Yes, must be the &3 and not &1 as was previously.
 
I bought the SW102 but I am not sure if there is a way to flash with the Bluetooth for the first time without open it. Is it safe? I read some post a while ago
 
Nfer said:
I bought the SW102 but I am not sure if there is a way to flash with the Bluetooth for the first time without open it. Is it safe? I read some post a while ago
Follow the wiki.
 
casainho said:
Nfer said:
I bought the SW102 but I am not sure if there is a way to flash with the Bluetooth for the first time without open it. Is it safe? I read some post a while ago
Follow the wiki.

I see. The wiki only describes the open method. I wish I can help you guys to develop and test the bluetooth metod but I have no clue of anything related to this stuff.
https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Flash-the-bootloader-and-firmware-on-SW102-using-SWD

Edit: I found the no-need-to-open discussion. It is still under development
https://github.com/OpenSource-EBike-firmware/SW102_LCD_Bluetooth/issues/35
 
Nfer said:
casainho said:
Nfer said:
I bought the SW102 but I am not sure if there is a way to flash with the Bluetooth for the first time without open it. Is it safe? I read some post a while ago
Follow the wiki.

I see. The wiki only describes the open method. I wish I can help you guys to develop and test the bluetooth metod but I have no clue of anything related to this stuff.
https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Flash-the-bootloader-and-firmware-on-SW102-using-SWD

Edit: I found the no-need-to-open discussion. It is still under development
https://github.com/OpenSource-EBike-firmware/SW102_LCD_Bluetooth/issues/35

I tried to open the sw102 cutting the glue at sides of the keypad and I killed the down button contact. It was my fault, instructions are good.
Is it possible to use the display without the down button?
 
Nfer said:
I tried to open the sw102 cutting the glue at sides of the keypad and I killed the down button contact. It was my fault, instructions are good. Is it possible to use the display without the down button?

The Down button is critical for the configuration process, as well as adjusting the Assist Level, so, I'd say no. Can you solder in a wire or something to bridge the break? (I know it is tight working, as I hope to never have to mess about inside my SW102 again.)
 
Hi ya'll,

The 0.19.17 was pretty solid, but I released it for the gang before I was on a long hiking trip. This new release pulls in the great work by @casainho and @lowPerformer. Note: I've switched to the naming system they constructed for versions, so this new version is 0.5.0-beta-4. It is what we recommend if you have a SW102. Currently we do releases on a per device basis, but it is fairly likely that soon releases will include both SW102 and 850C binaries for each release build.

Major changes in this release:

* SOC calculations now work! (kudos @lowPerformer)
* Automatic power off interval is now correct (kudos @lowPerformer)

A full list of changes is [here](https://github.com/OpenSource-EBike-firmware/Color_LCD/compare/0.19.17...0.5.0-beta-4)

The initial install (mainly getting access to the programming pins) is a bit of a hassle but we've written [instructions](https://github.com/OpenSource-EBike-firmware/Color_LCD/wiki/Initial-SW102-firmware-install) to make it easier. Every installation after that is very painless via our bluetooth bootloader software-update.

If you are upgrading from a previous release, you can upgrade over bluetooth. The procedure is:

* Install "nRF Connect" from your appstore of choice (Google Play or whatever)
* Download our [sw102-otauptdate-xxx.zip](https://github.com/OpenSource-EBike-firmware/Color_LCD/releases) file onto your phone (do not unzip)
* Press and hold the M key on the SW102, then press and hold the power button. Keep both buttons pressed down for at least eight seconds. You can then release the buttons. You will know you are in the bootloader if the screen stays dark.
* Run the "nRF Connect" app. You should see "SW102 DFU" list, click on Connect
* On this new pane you will see a small DFU icon in the upper right of the screen. Click on it.
* Select our "application bundle" and our zip file.
* The update should start and show progress as it progresses
* After the upload completes turn your bike completely off
* Then start your new SW102 load as normal (a long press on the power button)

Future releases will include release notes, but for now here's a link to our [TODO list](https://github.com/OpenSource-EBike-firmware/Color_LCD/blob/master/firmware/TODO.md). If you encounter bugs please open as issue [here](https://github.com/OpenSource-EBike-firmware/Color_LCD/issues). Make sure you mention you were using a SW102 and include as much information as possible.

We look forward to your reports of great success (or failure, ahem) in this [thread](https://endless-sphere.com/forums/viewtopic.php?f=30&t=99698).
 
geeksville said:
This new release ...

Thanks all for the work this represents.

Can you confirm that the ability remains to revert to 0.19.17 via bluetooth should we encounter a disabling condition with 0.5.0-beta-4?
 
alas - the bootloaders that we have out in the field now can't go backwards (there are various pros cons to letting that happen). So I can't change that choice we made without pushing out new bootloaders (which I'm loathe to do without a really good reason). Historically our releases have been pretty good (though the .13ish era was a bit rough because I was testing sans bike). I've been using this build on my bike for a couple of days and it seems pretty good (and the SOC stuff is great).

If there is a big problem with this release I'll quickly push out a new build (even if it means just bumping the version number from an old source tree).
 
windburner said:
Nfer said:
I tried to open the sw102 cutting the glue at sides of the keypad and I killed the down button contact. It was my fault, instructions are good. Is it possible to use the display without the down button?

The Down button is critical for the configuration process, as well as adjusting the Assist Level, so, I'd say no. Can you solder in a wire or something to bridge the break? (I know it is tight working, as I hope to never have to mess about inside my SW102 again.)

If you do need to fix your button, you can try removing the PCB (it comes out with a little connector on the back - just flip the black tab up to release the cable). This should give you better access to plug in a jumper. But if that won't work, yeah you'll need to plunk down another $35.
 
Hello, i've sucesfully flashed my SW102.
I did it in quite clean way so i want to share some photos with You.
I just cut small hole at side panel..
After this operation, all should be still waterproof.
SW102-proces.jpg


Key to sucesfull solder thin wires is to make thin soldering iron tip.
I did it from one single wire from 10mm2 cable.
After all i glued it with hot gun glue.
Excessive gluea i removed by cutting it.
You can use heat gun at the end or lighter to "polish" cutted hot gun glue.

You can download bigger photos from here: http://bikel.pl/pliki/TSDZ2/SW102/sw102-proces.zip

What do you think?
 
Back
Top