logo elektroda
logo elektroda
X
logo elektroda

Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

MrGenius 1263 123
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #31 21429936
    p.kaczmarek2
    Moderator Smart Home
    Interesting, what's that?

    I've tried to flash it:
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    Did it stuck?
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    Ok, now there is no log output at all... and even after disconnecting boot pin from ground it still works with flasher.
    I flashed back backup"
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research


    So no luck, it seems we need to try compiling samples from XR806 SDK
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #34 21430698
    p.kaczmarek2
    Moderator Smart Home
    Nothing on UART... maybe we should rather try this?
    https://xr806.docs.aw-ol.com/rtos/helloworld/
    Wait a second. It does work, but it prints on flashing UART, and not on the log one!
    I was checking wrong UART.
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #36 21430722
    p.kaczmarek2
    Moderator Smart Home
    Now you can try a WiFi sample or maybe AT commandline.
    Helpful post? Buy me a coffee.
  • #37 21430759
    divadiow
    Level 34  
    wifi demo posted earlier. AT fails at the moment
  • #39 21430773
    divadiow
    Level 34  
    Code: Text
    Log in, to see the code


    just trying to get the context so I can move stuff around to where it may be looking. also, dinner


    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
  • #40 21430793
    p.kaczmarek2
    Moderator Smart Home
    Probably wrong path or missing enable in makefile?

    Which wlan_demo did you compile? I am trying to get it to work, it has some kind of command line.


    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #41 21430797
    divadiow
    Level 34  
    ha. menuconfig to the rescue

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    building now it seems
  • #42 21430799
    p.kaczmarek2
    Moderator Smart Home
    How does one use menuconfig? I haven't seen it in action for LWIP yet.
    Helpful post? Buy me a coffee.
  • #43 21430800
    divadiow
    Level 34  
    >>21430793

    https://github.com/divadiow/xr806_sdk/tree/master/project/demo/wlan_demo

    but I may not have had the lwip/wlan/ap settings check in menuconfig for that build, but it didnt fail...

    Added after 3 [minutes]:

    im in wsl and at xr806_sdk root i run "make menuconfig" - I had some prereqs missing and maybe it complained about gcc location first too.

    prereqs were sorted with

    Code: Bash
    Log in, to see the code
  • #44 21430812
    p.kaczmarek2
    Moderator Smart Home
    Your WLAN demo is most likely missing crucial defines:
    - CONFIG_WLAN_AP
    - CONFIG_WLAN_STA
    - CONFIG_WLAN_MONITOR
    They are required to enable WiFi Commands:
    Code: C / C++
    Log in, to see the code

    You also need to define PRJCONF_NET_EN :
    Code: C / C++
    Log in, to see the code

    as it does not have yet net command...
    Helpful post? Buy me a coffee.
  • #45 21430847
    divadiow
    Level 34  
    ok.
    I guess I wrongly assumed the demos were standalone, ready to build, all that needed setting to make them work was already in place.

    at_demo takes ages. failed again but this time on some undefined ota file. I enabled ota in menuconfig and now it has finished
  • #46 21430862
    p.kaczmarek2
    Moderator Smart Home
    The increase is visible in the file size.
    Helpful post? Buy me a coffee.
  • #47 21430866
    divadiow
    Level 34  
    with lwip/ota/wlan whatever enabled still I am building wlan_demo again. it's taking longer too.

    I see mbedtls stuff at the moment

    Added after 1 [minutes]:

    I wonder if you can just point this menuconfig to the OBK project path and it'll build. just wild speculation
  • ADVERTISEMENT
  • #49 21430882
    p.kaczmarek2
    Moderator Smart Home
    This is the first time you've posted binary with wlan blobs:
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    In order to compile OBK, you must have this shared app:
    https://github.com/openshwprojects/OpenXR809/tree/master/project/oxr_sharedApp
    This is the OBK wrapper:
    https://github.com/openshwprojects/OpenXR809/blob/master/project/oxr_sharedApp/main.c
    Then you also need to make sure that platform define is set.
    https://github.com/search?q=repo%3Aopenshwprojects%2FOpenXR809%20PLATFORM_XR809&type=code
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    It is fairly possible that you could just use XR806 SDK with PLATFORM_XR809 SDK define and that it will work.

    let's consider OBK WiFi HAL for XR809:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/hal/xr809/hal_wifi_xr809.c
    Let's take random define from that - CTRL_MSG_TYPE_NETWORK .
    Is CTRL_MSG_TYPE_NETWORK also present in XR806 SDK? Are the headers the same?

    If the headers are the same, then porting should be fairly simple.

    Added after 10 [minutes]:

    With the previous wlan demo you've posted, the command line has changed. It's now AT command line. It takes standard AT commands, taken from ESP docs:
    Quote:



    AT+CWINIT: Initialize/Deinitialize Wi-Fi driver.

    AT+CWMODE: Set the Wi-Fi mode (Station/SoftAP/Station+SoftAP).

    AT+CWSTATE: Query the Wi-Fi state and Wi-Fi information.

    AT+CWJAP: Connect to an AP.

    AT+CWRECONNCFG: Query/Set the Wi-Fi reconnecting configuration.

    AT+CWLAPOPT: Set the configuration for the command AT+CWLAP.

    AT+CWLAP: List available APs.

    AT+CWQAP: Disconnect from an AP.

    AT+CWSAP: Query/Set the configuration of an ESP32 SoftAP.

    AT+CWLIF: Obtain IP address of the station that connects to an ESP32 SoftAP.

    AT+CWQIF: Disconnect stations from an ESP32 SoftAP.

    AT+CWDHCP: Enable/disable DHCP.

    AT+CWDHCPS: Query/Set the IPv4 addresses allocated by an ESP32 SoftAP DHCP server.

    AT+CWAUTOCONN: Connect to an AP automatically when powered on.

    AT+CWAPPROTO: Query/Set the 802.11 b/g/n protocol standard of SoftAP mode.

    AT+CWSTAPROTO: Query/Set the 802.11 b/g/n protocol standard of station mode.

    AT+CIPSTAMAC: Query/Set the MAC address of an ESP32 station.

    AT+CIPAPMAC: Query/Set the MAC address of an ESP32 SoftAP.

    AT+CIPSTA: Query/Set the IP address of an ESP32 station.

    AT+CIPAP: Query/Set the IP address of an ESP32 SoftAP.

    AT+CWSTARTSMART: Start SmartConfig.

    AT+CWSTOPSMART: Stop SmartConfig.

    AT+WPS: Enable the WPS function.

    AT+CWJEAP: Connect to a WPA2 Enterprise AP.

    AT+CWHOSTNAME: Query/Set the host name of an ESP32 station.

    AT+CWCOUNTRY: Query/Set the Wi-Fi Country Code.

    WiFi Scan works:
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    With AT join command, I can join to WiFi:
    
    wlan scan success
                                                                 
    en1: Associated with 28:87:ba:a0:f5:6d
                                             
    en1: WPA: Key negotiation completed with 28:87:ba:a0:f5:6d [PTK=CCMP GTK=CCMP]
     
    en1: CTRL-EVENT-CONNECTED - Connection to 28:87:ba:a0:f5:6d completed [id=0 id_s
    tr=]
                                                                               
    [net INF] msg <wlan connected>
                                                     
    [net INF] netif is link up
                                                         
    [net INF] start DHCP...
                                                            
    +EVT:2
                                                                             
    msg:0
                                                                             
    wlan connected
                                                                    
    WAR drop=1135, fctl=0x00d0.
                                                        
    WAR drop=1135, fctl=0x00d0.
                                                        
    [net INF] netif (IPv4) is up
                                                       
    [net INF] address: 192.168.0.155
                                                   
    [net INF] gateway: 192.168.0.1
                                                     
    [net INF] netmask: 255.255.255.0
                                                   
    [net INF] msg <network up>
                                                         
    +EVT:4
                                                                             
    msg:7
                                                                             
    network up
                                                                        
                
                                                                      
    OK
        
    
    
    Helpful post? Buy me a coffee.
  • #50 21430921
    divadiow
    Level 34  
    Cool cool. I need to stop for the eve and I need to get my head round what you've put above.

    Added after 10 [hours] 10 [minutes]:

    divadiow wrote:
    PB02/PB03 grounded✅✅


    divadiow wrote:
    looks like only PB02 needs to be pulled low to get XR806 into download mode, as opposed to PB02 and PB03 on XR809


    so, it seems I looked it up before for that Avatto SWT60

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    https://github.com/divadiow/xr806_sdk/tree/master/docs

    Added after 8 [hours] 45 [minutes]:

    >>21430882

    :/

    Added after 18 [minutes]:

    Im failing my homework 😭

    Code: Text
    Log in, to see the code


    am I linking up as if new - OpenXR806 or sticking to OpenXR809?

    this is set

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Should I maybe start again with openshwprojects/OpenXR809 and openshwprojects/OpenBK7231T_App forks and replacing the content in OpenXR809 with the 806 sdk files? is that a clearer way round? hmm.
  • #51 21432047
    p.kaczmarek2
    Moderator Smart Home
    I can help more if that's needed. Did you build menuconfig? So far I get:
    
    
    tester@DESKTOP-6SD9MUK:/mnt/w/GIT/OpenXR806$ make menuconfig
    make[1]: Entering directory '/mnt/w/GIT/OpenXR806/tools/config'
    HOSTLD build/mconf.o
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x48): undefined reference to `___chkstk_ms'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x2e2): undefined reference to `__getreent'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x302): undefined reference to `__getreent'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x316): undefined reference to `__getreent'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x496): undefined reference to `__getreent'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x4fa): undefined reference to `___chkstk_ms'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x669): undefined reference to `__getreent'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0xf8e): undefined reference to `__locale_ctype_ptr'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0xfe2): undefined reference to `__errno'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x1382): undefined reference to `___chkstk_ms'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x13cb): undefined reference to `__getreent'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x1541): undefined reference to `__getreent'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x209e): undefined reference to `__errno'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x82): undefined reference to `__errno'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x112): undefined reference to `__errno'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x15a): undefined reference to `__errno'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x18d): undefined reference to `__errno'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x1c9): undefined reference to `__locale_ctype_ptr'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x391): undefined reference to `__getreent'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x3d2): undefined reference to `__assert_func'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x619): undefined reference to `__getreent'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x6f1): undefined reference to `__getreent'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x9): undefined reference to `__getreent'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x299): undefined reference to `___chkstk_ms'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x4ae): undefined reference to `__errno'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x4ef): undefined reference to `__errno'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x771): undefined reference to `__errno'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x799): undefined reference to `__errno'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x7a7): undefined reference to `__errno'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0xf39): undefined reference to `__getreent'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0xf61): undefined reference to `__getreent'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x10f4): undefined reference to `__getreent'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x1375): undefined reference to `__getreent'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x14b6): undefined reference to `__getreent'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x20ac): more undefined references to `__getreent' follow
    /usr/bin/ld: build/parser.tab.o:parser.tab.c:(.text+0xe98): undefined reference to `__locale_ctype_ptr'
    /usr/bin/ld: build/parser.tab.o:parser.tab.c:(.text+0xf55): undefined reference to `__locale_ctype_ptr'
    /usr/bin/ld: build/parser.tab.o:parser.tab.c:(.text+0x1319): undefined reference to `__getreent'
    /usr/bin/ld: build/parser.tab.o:parser.tab.c:(.text+0x1352): undefined reference to `__getreent'
    /usr/bin/ld: build/parser.tab.o:parser.tab.c:(.text+0x1674): undefined reference to `__getreent'
    /usr/bin/ld: build/parser.tab.o:parser.tab.c:(.text+0x16c1): undefined reference to `__getreent'
    /usr/bin/ld: build/parser.tab.o:parser.tab.c:(.text+0x1709): undefined reference to `__getreent'
    /usr/bin/ld: build/parser.tab.o:parser.tab.c:(.text+0x172b): more undefined references to `__getreent' follow
    /usr/bin/ld: build/preprocess.o:preprocess.c:(.text+0x278): undefined reference to `__locale_ctype_ptr'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0xc0a): undefined reference to `__getreent'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x118a): undefined reference to `__locale_ctype_ptr'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x11c1): undefined reference to `__locale_ctype_ptr'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x122e): undefined reference to `__locale_ctype_ptr'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x2282): undefined reference to `__getreent'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x235a): undefined reference to `__getreent'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x2394): undefined reference to `__getreent'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x2493): undefined reference to `__getreent'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x24d7): undefined reference to `__getreent'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x2534): more undefined references to `__getreent' follow
    /usr/bin/ld: build/util.o:util.c:(.text+0x22a): undefined reference to `___chkstk_ms'
    /usr/bin/ld: build/util.o:util.c:(.text+0x2a4): undefined reference to `__getreent'
    /usr/bin/ld: build/util.o:util.c:(.text+0x2e4): undefined reference to `__getreent'
    /usr/bin/ld: build/util.o:util.c:(.text+0x344): undefined reference to `__getreent'
    /usr/bin/ld: build/util.o:util.c:(.text+0x384): undefined reference to `__getreent'
    collect2: error: ld returned 1 exit status
    chmod: cannot access 'mconf': No such file or directory
    make[1]: *** [Makefile:27: mconf] Error 1
    make[1]: Leaving directory '/mnt/w/GIT/OpenXR806/tools/config'
    /mnt/w/GIT/OpenXR806
    tools/config/mconf ./Kconfig
    make: tools/config/mconf: Command not found
    make: *** [Makefile:124: menuconfig] Error 127
    
    Helpful post? Buy me a coffee.
  • #52 21432060
    divadiow
    Level 34  
    I did not need to build menuconfig. straight into "make menuconfig" after sorting gcc and prereqs.

    I have this in linux home /tools

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    and this under sdk/tools

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Code: Bash
    Log in, to see the code
  • #53 21432197
    p.kaczmarek2
    Moderator Smart Home
    menuconfig is build from source on the first run, so it can be used to generate required header:
    
    ../../../include/xr_config.h:33:10: fatal error: generated/autoconf.h: No such file or directory
     #include "generated/autoconf.h"
    

    but for now, I can't get menuconfig to build, neither or WSL, nor Cygwin, nor MSys... I'm not sure what's wrong, maybe it's an issue with C library.

    Which command line are you using? WSL?
    Helpful post? Buy me a coffee.
  • #54 21432203
    divadiow
    Level 34  
    yes

    Linux 5.15.167.4-microsoft-standard-WSL2 x86_64

    Added after 23 [minutes]:

    would me zipping and giving you the SDK dir im working from now be of any use. in case there's something different I havent accounted for?
  • #55 21432260
    p.kaczmarek2
    Moderator Smart Home
    You can try zipping your sdk with build menuconfig and generated empty project. It seems that I have WSL1 and I can't install WSL2 due to Windows issue, I will most likely have to reinstall my OS.

    Added after 54 [minutes]:

    I am doing another attempt, from scratch:
    
    0. Introduction
    As mentioned in the previous article, building Unbuntu in Windows is not very user-friendly for novices. So I have been looking for a solution and found a very interesting solution. I hope it will be helpful to you.
    
    1. Environment Construction
    The core of the solution is Alibaba Cloud.
    The specific steps are as follows:
    step 1: Register. Log in to the development platform of Jishu Community .
    
    
    Setp2: Select a suitable cloud (free is the most important)
    
    Setp3: Configure the cloud server. Just follow the instructions, it doesn't cost money~~
    
    Pay attention to the system selection, choose Ubuntu 20 or 22
    
    and follow the instructions. Log in to the control interface through remote connection.
    
    
    Step 4: xr806 development configuration. When configuring, just follow the steps given by the boss:
    https://aijishu.com/a/1060000000432870
    
    SDK
    wget https://bbs.aw-ol.com/assets/uploads/files/1693988430633-xr806_sdk.tar.gz
    
    Unzip
    tar -zxvf 1693988430633-xr806_sdk.tar.gz
    
    Switch to tools and download toolchain
    cd xr806_sdk/tools
    wget https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2
    Unzip
    tar -xvf gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2
    Modify gcc.mk
    View the file structure in the same way as the folder
    
    ##First copy the path of gcc
    
    ##Open gcc.mk and modify
    
    
    2. Testing
    Execute the following two commands in the xr806_sdk directory:
    cp project/demo/hello\_demo/gcc/defconfig .config
    make menuconfig 
    As expected, there is a problem and a patch is needed.
    
    Install the plugin:
    sudo apt-get update 
    sudo apt-get install libncurses5-dev
    Then, rerun:
    cp project/demo/hello\_demo/gcc/defconfig .config
    make menuconfig 
    Great news! Finally succeeded!
    
    ##Click Save, then Exit. Then run:
    
    make build_clean
    make build -j$(nproc)
    3. Start enjoying XR806.
    Compiled results, can be downloaded and deleted.


    Added after 3 [minutes]:

    Got it futher?

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    Helpful post? Buy me a coffee.
  • #57 21432362
    p.kaczmarek2
    Moderator Smart Home
    Did you use the same SDK as me? Why the one downloaded via commandline worked and the one from Github didn't?

    Futher changed I did: gcc.mk , I changed path to toolchain from tools:
    
    #
    # Common rules for GCC Makefile
    #
    
    # ----------------------------------------------------------------------------
    # cross compiler
    # ----------------------------------------------------------------------------
    CC_DIR ?= /mnt/w/GIT/xr806_sdk/tools/gcc-arm-none-eabi-8-2019-q3-update/bin
    CC_PREFIX := $(CC_DIR)/arm-none-eabi-
    
    AS      := $(CC_PREFIX)as
    CC      := $(CC_PREFIX)gcc
    CPP     := $(CC_PREFIX)g++
    LD      := $(CC_PREFIX)ld
    NM      := $(CC_PREFIX)nm
    AR      := $(CC_PREFIX)ar
    

    Something is compiling:

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Added after 8 [minutes]:

    Maybe I was missing toolchain from tools dir
    Helpful post? Buy me a coffee.
  • #58 21432430
    divadiow
    Level 34  
    The SDK on GitHub is a fresh extraction of xr806_sdk.tar.gz from https://aijishu.com/a/1060000000426976 which I had in July. The SDK folder I have been compiling from was extracted in July but I dont think anything was changed until yesterday, I only used it to get newer PhoenixMC.
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    all the copies I have are identical. I did sort GCC first...

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Added after 1 [minutes]:

    have you flashed a successfully built OpenXR806??
  • #59 21432486
    p.kaczmarek2
    Moderator Smart Home
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Added after 6 [minutes]:

    Trying to compile:

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Added after 2 [minutes]:

    Few errors:
    
    ject/common/board/xr806_dig_ver  -o ../main.o ../main.c
    In file included from ../shared/src/new_common.h:231,
                     from ../shared/src/new_cfg.h:4,
                     from ../main.c:42:
    ../../../../include/net/lwip-2.1.2/lwip/sockets.h:690: error: "close" redefined [-Werror]
     #define close(s)                                  lwip_close(s)
    
    In file included from ../shared/src/new_cfg.h:4,
                     from ../main.c:42:
    ../shared/src/new_common.h:120: note: this is the location of the previous definition
     #define close lwip_close
    
    ../main.c: In function 'rtos_create_thread':
    ../main.c:59:24: error: passing argument 1 of 'OS_ThreadCreate' from incompatible pointer type [-Werror=incompatible-pointer-types]
      err = OS_ThreadCreate(thread,
                            ^~~~~~
    In file included from ../../../../include/kernel/os/os.h:34,
                     from ../../../../project/common/framework/sys_ctrl/publisher.h:35,
                     from ../../../../project/common/framework/sys_ctrl/sys_ctrl.h:36,
                     from ../../../../project/common/framework/net_ctrl.h:39,
                     from ../main.c:40:
    ../../../../include/kernel/os/os_thread.h:92:40: note: expected 'OS_Thread_t *' {aka 'struct OS_Thread *'} but argument is of type 'void **'
     OS_Status OS_ThreadCreate(OS_Thread_t *thread, const char *name,
                               ~~~~~~~~~~~~~^~~~~~
    ../main.c: In function 'rtos_delete_thread':
    ../main.c:70:29: error: passing argument 1 of 'OS_ThreadDelete' from incompatible pointer type [-Werror=incompatible-pointer-types]
         return OS_ThreadDelete( thread );
                                 ^~~~~~
    In file included from ../../../../include/kernel/os/os.h:34,
                     from ../../../../project/common/framework/sys_ctrl/publisher.h:35,
                     from ../../../../project/common/framework/sys_ctrl/sys_ctrl.h:36,
                     from ../../../../project/common/framework/net_ctrl.h:39,
                     from ../main.c:40:
    ../../../../include/kernel/os/os_thread.h:108:40: note: expected 'OS_Thread_t *' {aka 'struct OS_Thread *'} but argument is of type 'void **'
     OS_Status OS_ThreadDelete(OS_Thread_t *thread);
                               ~~~~~~~~~~~~~^~~~~~
    ../main.c: In function 'main':
    ../main.c:130:6: error: unused variable 'res' [-Werror=unused-variable]
      int res;
          ^~~
    At top level:
    ../main.c:74:20: error: 'g_helloworld_thread' defined but not used [-Werror=unused-variable]
     static OS_Thread_t g_helloworld_thread;
                        ^~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    make[1]: *** [../../../../gcc.mk:225: ../main.o] Error 1
    make[1]: Leaving directory '/mnt/w/git/xr806_sdk/project/demo/sharedApp/gcc'
    make: *** [../../../../project/project.mk:430: __all] Error 2
    


    Added after 8 [minutes]:

    Ok, silenced:
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Added after 7 [minutes]:

    What a restrictive compiler setup:
    
    ./shared/src/new_pins.c: In function 'PIN_SetPinRoleForPinIndex':
    ../shared/src/new_pins.c:977:8: error: variable 'channelValue' set but not used [-Werror=unused-but-set-variable]
        int channelValue;
            ^~~~~~~~~~~~
    cc1: all warnings being treated as errors
    

    I will just disable it

    Added after 13 [minutes]:

    Ok stuck for now:
    
    red/src/logging/logging.c
    ../shared/src/logging/logging.c:124:2: error: unknown type name 'SemaphoreHandle_t'
      SemaphoreHandle_t mutex;
      ^~~~~~~~~~~~~~~~~
    ../shared/src/logging/logging.c: In function 'addLogAdv':
    ../shared/src/logging/logging.c:282:2: error: unknown type name 'BaseType_t'; did you mean 'logType_t'?
      BaseType_t taken;
      ^~~~~~~~~~
      logType_t
    ../shared/src/logging/logging.c:365:16: error: 'pdTRUE' undeclared (first use in this function)
       if (taken == pdTRUE) {
                    ^~~~~~
    ../shared/src/logging/logging.c:365:16: note: each undeclared identifier is reported only once for each function it appears in
    ../shared/src/logging/logging.c:413:23: error: 'portTICK_RATE_MS' undeclared (first use in this function)
        timems = (((1000 / portTICK_RATE_MS) * len) / cps) + 2;
                           ^~~~~~~~~~~~~~~~
    ../shared/src/logging/logging.c: In function 'getData':
    ../shared/src/logging/logging.c:423:2: error: unknown type name 'BaseType_t'; did you mean 'logType_t'?
      BaseType_t taken;
      ^~~~~~~~~~
      logType_t
    ../shared/src/logging/logging.c:448:15: error: 'pdTRUE' undeclared (first use in this function)
      if (taken == pdTRUE) {
    

    I need to check if we have SemaphoreHandle_t in the SDK
    Helpful post? Buy me a coffee.
  • #60 21432558
    divadiow
    Level 34  
    Awesome stuff dude. I'm watching with keen interest

Topic summary

The discussion centers on the Tuya WXU module, specifically the XR806 SoC used in TRV heater devices, exploring firmware flashing, SDK usage, and custom firmware development. The XR806 differs from the XR809 notably by including WiFi and BLE capabilities and having 320 KB SRAM versus 288 KB in XR806 specs. Participants shared boot logs, teardown procedures, and hardware photos, confirming the XR806's WiFi presence and SDK version 1.2.2. Efforts to flash custom firmware such as OpenBK7231T_App and OpenXR806 were documented, with challenges including UART synchronization errors, thread creation failures, and unstable WiFi connections. The XR806 SDK was used for compiling demos like hello_demo and wlan_demo, with configuration via make menuconfig to enable WiFi features and FreeRTOS. Issues with missing headers, build environment setup (WSL, GCC toolchain), and SDK path configurations were addressed. A key breakthrough was identifying HTTP basic authentication enabled by default on XR806, blocking HTTP server responses, which was resolved by disabling or clearing the web password. Flash memory configuration was adjusted to a free offset (0x1FC000) to enable saving settings. Despite progress, WiFi stability and full TRV functionality remain under development. Community members sourced XR806 modules from various suppliers and shared open-source projects like TinyMaix-XR806 for reference. The discussion also touched on porting HAL code from XR809 to XR806 due to high similarity, and ongoing efforts to integrate XR806 support into OpenBK7231T_App with online builds. The overall progress marks the first successful custom firmware boot and HTTP server operation on XR806-based WXU modules, paving the way for further development and device control.
Summary generated by the language model.
ADVERTISEMENT