This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:tech:tradfri_mod [2021/01/19 06:15] – created bullar | en:tech:tradfri_mod [2022/09/26 09:58] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======TRÅDFRI Module===== | + | =====TRÅDFRI Module===== |
- | under preparation... | + | In an earlier [[en: |
+ | * TRÅDFRI socket | ||
+ | * TRÅDFRI gateway | ||
+ | * TRÅDFRI repeater | ||
+ | * TRÅDFRI motion detector | ||
+ | * FYRTUR blind | ||
+ | |||
+ | The function of the pins is then accordingly. Here is an overview: | ||
+ | |||
+ | ^ TRÅDFRI Pin ^ Lamp \\ white ^ Lamp \\ white spectrum ^ Power Plug ^ FYRTUR ^ | ||
+ | | PA0 | open | open | Button | ||
+ | | PA1 | open | VCC | NTC | LED | | ||
+ | | PA12 | - | PWM2 | Relay | TxD | | ||
+ | | PA13 | PWM | PWM1 | LED | RxD | | ||
+ | | PC10 | - | - | - | Down Button | ||
+ | |||
+ | The module is controlled by an EFR32MG1PXXXF256 controller from Silicon Labs. He has a debug interface that is also available on the module. This is ARM's Serial Wire Debug (SWD) interface with 2 wires. | ||
+ | |||
+ | ==== Debugger ==== | ||
+ | A debugger is required to be able to read or write to the FLASH. An inexpensive variant is again available from [[https:// | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | The 4 wires of the debugger are to connect to the module as follows: | ||
+ | |||
+ | ^ JLINK ^ TRÅDFRI Modul ^ | ||
+ | | VCC | VCC | | ||
+ | | SWDIO | PF1 | | ||
+ | | SWCLK | PF0 | | ||
+ | | GND | GND | | ||
+ | |||
+ | In addition, the module must be supplied with 3.3V. J-Link from [[https:// | ||
+ | |||
+ | ==== Read out ==== | ||
+ | |||
+ | In the terminal window we then enter the following command (adapt path): | ||
+ | |||
+ | ''< | ||
+ | |||
+ | The '' | ||
+ | < | ||
+ | J-Link> | ||
+ | Device " | ||
+ | |||
+ | Found SWD-DP with ID 0x2BA01477 | ||
+ | Found Cortex-M4 r0p1, Little endian. | ||
+ | FPUnit: 6 code (BP) slots and 2 literal slots | ||
+ | CoreSight components: | ||
+ | ROMTbl 0 @ E00FF000 | ||
+ | ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB00C SCS | ||
+ | ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 003BB002 DWT | ||
+ | ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 002BB003 FPB | ||
+ | ROMTbl 0 [3]: FFF01000, CID: B105E00D, PID: 003BB001 ITM | ||
+ | ROMTbl 0 [4]: FFF41000, CID: B105900D, PID: 003BB923 TPIU-Lite | ||
+ | Cortex-M4 identified. | ||
+ | </ | ||
+ | |||
+ | The Cortex-M4 of the TRÅDFRI module has four FLASH areas that we have to consider: | ||
+ | |||
+ | ^ Area ^ ADDR ^ Size ^ | ||
+ | | MAIN | '' | ||
+ | | USER | '' | ||
+ | | LOCK | '' | ||
+ | | CHIP | '' | ||
+ | |||
+ | To read out and save, we enter the following commands: | ||
+ | |||
+ | < | ||
+ | J-Link> | ||
+ | Opening binary file for writing... [/ | ||
+ | Reading 262144 bytes from addr 0x00000000 into file...O.K. | ||
+ | |||
+ | J-Link> | ||
+ | J-Link> | ||
+ | J-Link> | ||
+ | </ | ||
+ | |||
+ | With the command '' | ||
+ | Fortunately, | ||
+ | If we collect all four files, we can now reprogram any module and thus obtain the desired function. In my case I took the TRÅDFRI modules out of the repeater and converted them into blind modules and used them [[en: | ||
+ | |||
+ | ==== Programming ==== | ||
+ | |||
+ | Programming is just as easy as reading out with the following commands: | ||
+ | |||
+ | < | ||
+ | J-Link> | ||
+ | Downloading file [TRADFRI_blind_main_2_2_009]...Comparing flash | ||
+ | Erasing flash | ||
+ | Programming flash [100%] Done. | ||
+ | Verifying flash | ||
+ | J-Link: Flash download: Flash programming performed for 1 range (188416 bytes) | ||
+ | J-Link: Flash download: Total time needed: 6.193s (Prepare: 0.112s, Compare: 0.298s, Erase: 2.700s, Program: 2.931s, Verify: 0.143s, Restore: 0.007s) | ||
+ | O.K. | ||
+ | |||
+ | J-Link> | ||
+ | J-Link> | ||
+ | J-Link> | ||
+ | </ | ||
+ | |||
+ | ==== TRÅDFRI on/off switch ==== | ||
+ | |||
+ | The same procedure can also be used for other TRÅDFRI devices that do not use this module. The circuit structure is always the same. All you have to do is find the four connections on the circuit board. These are always available as pads for the module test and are therefore easily accessible. \\ | ||
+ | For the [[en: | ||
+ | |||
+ | {{: | ||
+ | {{: | ||
+ | |||
+ | How to open the button is [[http:// | ||
+ | ^ JLINK ^ TRÅDFRI Taster | ||
+ | | VCC | VCC | | ||
+ | | SWDIO | TMS | | ||
+ | | SWCLK | CLK | | ||
+ | | GND | GND | | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ==== Update ==== | ||
+ | |||
+ | All TRÅDFRI components support Over-The-Air (OTA) updates. You don't need to worry about that, as it takes place in the background, for example through the gateway. However, if we want to flash the current firmware while reprogramming, | ||
+ | |||
+ | However, only the MAIN area of the FLASH is updated. The USER, LOCK and CHIP areas do not change and are therefore not online either. If you want to reprogram a module with a different functionality, | ||
+ | |||
+ | The loaded data is encapsulated in an exotic format with the abbreviation NGIS. Here again some work was necessary to decrypt the format and extract the binary file. The program [[https:// | ||
+ | |||
+ | {{: | ||
+ | |||
+ | For extracting I wrote a Python script that is also in the download area. In the previous tests, the extracted version was binary identical to the one that was read out. \\ | ||
+ | |||
+ | ==== Downloads ==== | ||
+ | |||
+ | * {{: | ||
+ | * {{: | ||
+ | |||
+ | ==== Donate ==== | ||
+ | |||
+ | If you like my articles feel to donate a cappuccino or so... | ||
+ | |||
+ | < | ||
+ | |||
+ | <form action=" | ||
+ | <input type=" | ||
+ | <input type=" | ||
+ | <img alt="" | ||
+ | </ | ||
+ | |||
+ | </ |