Search found 26 matches

by Nick
Apr 24 2019 5:23pm
Forum: Motor Technology
Topic: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app
Replies: 45
Views: 1142

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

I was trying to use bigger fonts than the available on ugui but I could not use any tool to generate them, if you know how to do it, please tell me. I am using this sizes: #define TITLE_TEXT_FONT FONT_16X26 #define MEDIUM_NUMBERS_TEXT_FONT FONT_24X40 #define BIG_NUMBERS_TEXT_FONT FONT_32X53 #define...
by Nick
Apr 23 2019 5:29pm
Forum: Motor Technology
Topic: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app
Replies: 45
Views: 1142

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

One more for discussion: uGUI implements its own font with different sizes. It uses a full set of 255 ASCII chars as you can see here: ascii-tabelle.jpg As you can see there are plenty of chars we never use which nonetheless uses (plenty of) flash space. For instance, the full set font 24x40 uses ~3...
by Nick
Apr 21 2019 5:26am
Forum: Motor Technology
Topic: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app
Replies: 45
Views: 1142

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

I'm considering reducing the SPI transfer complexity by just do a standard blocking transfer call. I don't see any benefit of IRQ transfer because of those issues I addressed so we can reduce code size (library usage) and complexity (risks of nested IRQ /race conditions / ...).
by Nick
Apr 21 2019 5:12am
Forum: Motor Technology
Topic: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app
Replies: 45
Views: 1142

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Some news from the SW102 development: The SW102 LCD is driven by hardware SPI which transfers data to the LCD byte by byte. Thus, the CPU is able to do some "important" stuff while one byte is transferred to the LCD. Once a transfer is completed, an IRQ needs the attention of the CPU to setup the ne...
by Nick
Apr 18 2019 2:30am
Forum: Motor Technology
Topic: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app
Replies: 45
Views: 1142

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Sure you can update pixel by pixel on SW102 also. But you have a huge overhead then. Before you can write pixel data you have to set page and pixel address by a 3 byte command. So, 4 bytes per pixel plus the code overhead of the SPI transaction manager to initiate a transfer! --> for a complete LCD ...
by Nick
Apr 17 2019 4:11pm
Forum: Motor Technology
Topic: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app
Replies: 45
Views: 1142

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

I updated the SW102_LCD_Bluetooth repository with my working copy (as suggested by casainho). SPI transfers are now implemented none-blocking by SPI transaction manager. For now, LCD gets refreshed every 50 ms by a timer. Software delay loops suffer from slow-downs especially if you further reduce t...
by Nick
Apr 17 2019 9:36am
Forum: Motor Technology
Topic: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app
Replies: 45
Views: 1142

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

casainho wrote:
Apr 17 2019 9:13am
Why take the risk while there are already 2 sellers negotiating with the manufacturer to flash on production our own bootloader on SW102?

One of that sellers is already selling online TSDZ2 and KT-LCD3 flashed with our firmware. Why not trust them?
Yes, thats the official way to go! I agree!
by Nick
Apr 17 2019 9:34am
Forum: Motor Technology
Topic: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app
Replies: 45
Views: 1142

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

Once anyone update the bootloader with a different encryption keys and forget them by a mistake or simple flash a no working version of bootloader, the SW102 will be locked forever and will be useless... I didn't dive into the nrf5 bootloader concept but a bootloader which can destroy itself by any...
by Nick
Apr 17 2019 7:56am
Forum: Motor Technology
Topic: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app
Replies: 45
Views: 1142

Re: Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

nieles wrote:
Apr 17 2019 6:11am
do you have one that still has the stock firmware?

if so, you can read the memory content even if its protected:
https://www.pentestpartners.com/securit ... -a-how-to/
NICE!

I hace one orig in spare and will try to dump the firmware.
by Nick
Apr 16 2019 4:23am
Forum: Motor Technology
Topic: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor
Replies: 2197
Views: 91436

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Great!!! Now I advice you to follow the 850C firmware structure about receiving and sending data. At least on 850C, updating the display is so slow that I was missing communication packages. SW102 has DMA to transfer data to LCD but 850C can't use DMA so it makes the processor busy when driving the...
by Nick
Apr 13 2019 3:39pm
Forum: Motor Technology
Topic: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor
Replies: 2197
Views: 91436

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Just a short update from SW102 development:
IMG_20190413_223021_k.jpg
This looks broken but it's a proof of concept that we can initialize the LCD controller and show (some garbage) data.

Greetings
Nick
by Nick
Apr 11 2019 12:25pm
Forum: Motor Technology
Topic: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor
Replies: 2197
Views: 91436

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

I used some free time to do some reverse engineering on the SW102 PCBs. I updated the Wiki with my findings: https://github.com/OpenSource-EBike-firmware/Color_LCD/wiki/Bafang-LCD-SW102 In addition, I created a circuit diagram with the most important pin assignments: https://github.com/OpenSource-EB...
by Nick
Apr 09 2019 4:31pm
Forum: Motor Technology
Topic: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor
Replies: 2197
Views: 91436

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

So we have two very different displays SW102 and 850C, this is good. IMHO the SW102 should be the Small&Simple approach with some basic setting menus and just some data on the main screen you can choose of. I (and as far as I know many other users) demand this simple approach and just don't need enh...
by Nick
Apr 09 2019 3:22pm
Forum: Motor Technology
Topic: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor
Replies: 2197
Views: 91436

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

So lets say 128k left for application data. This feels not that bad if you take into account this will be a small device and we don't need high sophisticated graphic charts but "only" some text & menues. How much is the memory on the LCD3 display? 32k I think, correct me if I'm wrong. So this is 4x ...
by Nick
Apr 09 2019 10:59am
Forum: Motor Technology
Topic: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor
Replies: 2197
Views: 91436

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Thanks for the great instructions That will really help. I am still waiting on my SW102 to be delivered, but in the mentime I had a thought. Do you think it may be possible to drill 4 small holes through the plastic cover.... I think this is a matter of taste and IMHO the way to go is to open it on...
by Nick
Apr 06 2019 8:07am
Forum: Motor Technology
Topic: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor
Replies: 2197
Views: 91436

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

If I have to guess, I miss the command 0xAF (display ON) at the end of your init code ... Can you try it? You can copy from the DSView logic analyzer recorded files: https://github.com/OpenSource-EBike-firmware/Color_LCD/tree/master/Bafang_LCD_SW102/DSLogic_save_files_LCD_data_signals I will set up...
by Nick
Apr 05 2019 4:56pm
Forum: Motor Technology
Topic: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor
Replies: 2197
Views: 91436

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Although I got the sequence, I may be doing something wrong on the code... Maybe you can look at it. Look at 850C init code to compare, as it is similar idea. By guessing I mean try to find other codes where init codes are similar. So after some digging on the internet I think we have an SH1107 con...
by Nick
Apr 05 2019 12:48pm
Forum: Motor Technology
Topic: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor
Replies: 2197
Views: 91436

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

We really need to know the controller in use or this will be a torture :wink: As far as I can see this is a 64x128 resolution and SPI interface? So maybe something like this? http://www.customlcddisplay.com/oled/monochrome-oled/64x128-oled-display-0-96-inch-oled-display.html SH1107 Controller seems ...
by Nick
Apr 04 2019 3:06pm
Forum: Motor Technology
Topic: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor
Replies: 2197
Views: 91436

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Hi everyone, I really like those SW102 displays because do be honest I think the LCD3 is far from a modern good looking display and the 850c is way to big. But opening this little diva is really a pain! Here are my findings to get at least to the debug pins without destroying too much: 1) Remove Up/...
by Nick
Jan 29 2019 4:04pm
Forum: Motor Technology
Topic: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor
Replies: 2197
Views: 91436

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

perryscope wrote:
Jan 29 2019 10:31am
Nick wrote:
Jan 29 2019 10:08am
...
Is there maybe a interest of sharing this virtual machine? ...
I would be interested in giving that a try. :)
Everybody else who has interest just leave me a PM.

@v18.0.0 Address out of range error:
Same for me. There seems to be some "garbage" at the end of the hex file?
by Nick
Jan 29 2019 10:08am
Forum: Motor Technology
Topic: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor
Replies: 2197
Views: 91436

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Hello everyone, what a fast paced devlopment :D. I finally could get version 17 up and running and it feels great! Thank you very much for this nice piece of project. BTW: I set up a dev environment with Eclipse/SDCC/openOCD/STM8 binutils in a Xubuntu 18.04 virtual machine. Although I am quite exper...
by Nick
Jan 26 2019 10:55am
Forum: Motor Technology
Topic: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor
Replies: 2197
Views: 91436

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Hello everyone,

speaking about the KT-LCD3, for me, the button input doesn't feel very "snappy". It seems to be a bit laggy and it sometimes misses inputs. Is this a hardware/performance issue or is there maybe some room for code optimizations?

Greetings
Niklas
by Nick
Jan 22 2019 5:20am
Forum: Motor Technology
Topic: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor
Replies: 2197
Views: 91436

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Hey Gals, I faced some hurdles programming the open source software to the motor... I have seen similar intermittent behavior on the data tab as well... I hardly can read any tab while powered with 5V. I never tried programming while battery powered. Such a high amperage supply just doesn't feel go...
by Nick
Jan 21 2019 12:18pm
Forum: Motor Technology
Topic: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor
Replies: 2197
Views: 91436

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Hey Gals, I faced some hurdles programming the open source software to the motor. LCD was flawless following the instructions on the wiki. But flashing the motor shows several errors and only with every like 10th try I was able to read the option bytes. I use a ST-LINK clone and short wires. The sol...