Tellstick duo. Custom firmware ?

Moderator: Telldus

micke.prag
Site Admin
Posts: 2233
Joined: Thu Jan 18, 2018 11:08 am
Location: Lund
Contact:

Re: Tellstick duo. Custom firmware ?

Post by micke.prag » Thu Jan 18, 2018 11:08 am

TellStick Duo contains a bootloader.
If anyone ports the code for another compiler, just make sure you don't put any code in the bootloader area since there is no check in the bootloader for this! I will see if I can publish a flasher utility that will work under Linux.
Micke Prag
Software
Telldus Technologies

micke.prag
Site Admin
Posts: 2233
Joined: Thu Jan 18, 2018 11:08 am
Location: Lund
Contact:

Re: Tellstick duo. Custom firmware ?

Post by micke.prag » Thu Jan 18, 2018 11:08 am

Just pushed a flasher utility. It is an early software we used internally before making the graphical one. You need to comment and uncomment some variables in the code for switching between TellStick and TellStick Duo flashing.
http://developer.telldus.com/browser/Te ... uo/flasher
Micke Prag
Software
Telldus Technologies

jkp
Posts: 42
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick duo. Custom firmware ?

Post by jkp » Thu Jan 18, 2018 11:08 am

Thanks - but seems that I'm missing a required FTD2XX library (#include "ftd2xx.h" in main.cpp and cmake error message below), how to solve that?

Code: Select all

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
FTD2XX_LIBRARY
    linked by target "tellstickduo-flasher" ...

Edit: perhaps using libftdi?

Code: Select all

diff --git a/flasher/CMakeLists.txt b/flasher/CMakeLists.txt
index d7e34bd..49da17a 100644
--- a/flasher/CMakeLists.txt
+++ b/flasher/CMakeLists.txt
@@ -8,9 +8,9 @@ ADD_EXECUTABLE(tellstickduo-flasher
   ${SRCS}
 )
 
-FIND_LIBRARY(FTD2XX_LIBRARY ftd2xx)
+FIND_LIBRARY(FTDI_LIBRARY ftdi)
 
 TARGET_LINK_LIBRARIES(tellstickduo-flasher
-       ${FTD2XX_LIBRARY}
+       ${FTDI_LIBRARY}
 )
 
diff --git a/flasher/main.cpp b/flasher/main.cpp
index 6ca0838..9d8972a 100644
--- a/flasher/main.cpp
+++ b/flasher/main.cpp
@@ -1,7 +1,7 @@
 #ifndef _WINDOWS
        #include "WinTypes.h"
 #endif
-#include "ftd2xx.h"
+#include <ftdi.h>
 
 #include <stdio.h>
 #include <string.h>

After that change, the next error is missing WinTypes.h:

..tellstick/duo-src/tellstick-duo/flasher/main.cpp:2:23: fatal error: WinTypes.h: Tiedostoa tai hakemistoa ei ole (translated: no such file or dir)

jkp
Posts: 42
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick duo. Custom firmware ?

Post by jkp » Thu Jan 18, 2018 11:08 am

OK, now I got it to compile. Took the library from http://www.ftdichip.com/Drivers/D2XX.htm and ftd2xx.h & WinTypes.h from http://developer.telldus.com/browser/te ... 9cdef3bea5 and tweaked cmake-produced scripts to use libftd2xx.so

Flashing seems to actually work, too:

Code: Select all

./tellstickduo-flasher  ~jkp/TellStickDuo.hex
Reboot TellStick...Done
Waiting for TellStick Duo Bootloader.
Uploading hex-file
100%
100%
Rebooting TellStick
Firmware updated!
Also checked with fw4 that it really flashes, and it works. Big thanks for the free software & tools!

micke.prag
Site Admin
Posts: 2233
Joined: Thu Jan 18, 2018 11:08 am
Location: Lund
Contact:

Re: Tellstick duo. Custom firmware ?

Post by micke.prag » Thu Jan 18, 2018 11:08 am

Great that you got it working. Just want to clearify one thing once more. If you switch compiler make sure you keep the region of the bootloader free. We do it in our cmake script like this:

Code: Select all

LIST(APPEND CMAKE_EXE_LINKER_FLAGS "--ROM=default,-7A00-7FFF")
The bootloader code does not depend on the current firmware. There is external hardware for rebooting into the bootloader so even if the firmware is faulty you should be able to flash it again. If you overwrite the bootloader you are screwed though :wink:

If anyone has a PicKit2 (from Microchip) there is pads in the pcb to reprogramming the cpu. To get to them you need to break the plastic since it is unfortunately not openable.
Attachments
20110530_005.jpg
20110530_005.jpg (64.69 KiB) Viewed 11632 times
Micke Prag
Software
Telldus Technologies

jkp
Posts: 42
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick duo. Custom firmware ?

Post by jkp » Thu Jan 18, 2018 11:08 am

Thanks, this is good to know and remember. To clarify, a couple of questions:

- with the pickit reference, are you saying that if the device is bricked, PicKit2 can be used for unbricking?

- is the area 7A00-7FFF that where the bootloader resides, which must be avoided?

jkp
Posts: 42
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick duo. Custom firmware ?

Post by jkp » Thu Jan 18, 2018 11:08 am

Have you considered an area for firmware development, protocol code development and the like? Maybe named "Development"?

I suspect talking much bit & hex codes & encoding talk on Hardware forum might make the forum a bit too far out for people interested in just the end result.

I know there's http://developer.telldus.com/ and tickets & wiki can be a good place to post stuff like instructions, protocol analysis etc. But using those those requires some closer involvment & getting to know the tools (wiki & particular ticket system) than using a forum, so perhaps a forum for development could also have a niche.

micke.prag
Site Admin
Posts: 2233
Joined: Thu Jan 18, 2018 11:08 am
Location: Lund
Contact:

Re: Tellstick duo. Custom firmware ?

Post by micke.prag » Thu Jan 18, 2018 11:08 am

jkp wrote:- with the pickit reference, are you saying that if the device is bricked, PicKit2 can be used for unbricking?
Yes
jkp wrote:- is the area 7A00-7FFF that where the bootloader resides, which must be avoided?
Correct
jkp wrote:Have you considered an area for firmware development, protocol code development and the like? Maybe named "Development"?
Feel free to use the Wiki at http://developer.telldus.com for these kind of things. We will think about a separate forum for development...
Micke Prag
Software
Telldus Technologies

jkp
Posts: 42
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick duo. Custom firmware ?

Post by jkp » Thu Jan 18, 2018 11:08 am

Thanks for the answers. I added some comments in the ticket system, at http://developer.telldus.com/ticket/90

tingo
Posts: 31
Joined: Thu Jan 18, 2018 11:08 am
Location: Oslo, Norway

Re: Tellstick duo. Custom firmware ?

Post by tingo » Thu Jan 18, 2018 11:08 am

jkp wrote:OK, now I got it to compile. Took the library from http://www.ftdichip.com/Drivers/D2XX.htm and ftd2xx.h & WinTypes.h from http://developer.telldus.com/browser/te ... 9cdef3bea5 and tweaked cmake-produced scripts to use libftd2xx.so
A very old thread, but still.
I'm guessing that since the library from D2XX isn't source, it is not going to work on a Banana Pi?
(my Banana Pi is currently running Bananian 15.10 aka Debian 7 "wheezy", with telldus-core 2.1.2 and a TellStick Duo - batch 13062)
Torfinn

Post Reply