Electronics > Microcontrollers

Has anyone used the Telink TC32 CPU? (e.g. in the TLSR8232)

(1/1)

david.given:
I've just done a project which is a deep dive of a $3 AliExpress smartwatch built around a Telink TLSR8232. (<plug> Spoiler: it runs Micropython just fine. </plug>)

The really interesting thing about it is the CPU, which is a proprietary Telink thing called the TC32. It looks very much like ARM Cortex-M0.


--- Code: ---tc32.o:     file format elf32-littletc32

00000000 <SETIC>:
   0:   0910            tloadr  r1, [pc, #64]   ; (44 <DAT0+0x18>)
   2:   0813            tloadr  r0, [pc, #76]   ; (50 <DAT0+0x24>)
   4:   4008            tstorerb        r0, [r1, #0]
   6:   b001            tadds   r0, #1
   8:   4048            tstorerb        r0, [r1, #1]
   a:   0905            tloadr  r1, [pc, #20]   ; (20 <DATA_I>)
   c:   0a05            tloadr  r2, [pc, #20]   ; (24 <DATA_I+0x4>)
   e:   0b06            tloadr  r3, [pc, #24]   ; (28 <DATA_I+0x8>)
00000010 <COPY_DATA>:
  10:   029a            tcmp    r2, r3
  12:   ca04            tjge    1e <COPY_DATA_END>
  14:   5808            tloadr  r0, [r1, #0]
  16:   5010            tstorer r0, [r2, #0]
  18:   b104            tadds   r1, #4
  1a:   b204            tadds   r2, #4
  1c:   87f8            tj      10 <COPY_DATA>
0000001e <COPY_DATA_END>:
  1e:   46c0            tstorerb        r0, [r0, #27]

--- End code ---

Very, very much like it. Compare the opcodes with the Thumb equivalent...


--- Code: ---thumb.o:     file format elf32-littlearm

00000000 <SETIC>:
   0:   4910            ldr     r1, [pc, #64]   @ (44 <DAT0+0x18>)
   2:   4813            ldr     r0, [pc, #76]   @ (50 <DAT0+0x24>)
   4:   7008            strb    r0, [r1, #0]
   6:   3001            adds    r0, #1
   8:   7048            strb    r0, [r1, #1]
   a:   4905            ldr     r1, [pc, #20]   @ (20 <DATA_I>)
   c:   4a05            ldr     r2, [pc, #20]   @ (24 <DATA_I+0x4>)
   e:   4b06            ldr     r3, [pc, #24]   @ (28 <DATA_I+0x8>)
00000010 <COPY_DATA>:
  10:   429a            cmp     r2, r3
  12:   da04            bge.n   1e <COPY_DATA_END>
  14:   6808            ldr     r0, [r1, #0]
  16:   6010            str     r0, [r2, #0]
  18:   3104            adds    r1, #4
  1a:   3204            adds    r2, #4
  1c:   e7f8            b.n     10 <COPY_DATA>
0000001e <COPY_DATA_END>:
  1e:   46c0            nop                     @ (mov r8, r8)

--- End code ---

I'm guessing what they've done is used a third-party Cortex core, and then adjusted the instruction names and encodings enough that they don't have to get an ARM license.

Has anyone here worked with these, who might be able to provide any more context? Also, if you have, did you have any problems with their compiler (a binary-only gcc port which is clearly the ARM port with some search-and-replacement done --- if you e.g. put `.code 32` at the top of the assembly file, you get `attempt to use an ARM instruction on a Thumb-only processor` errors!). I found one horrible bug where switch statement jump tables were produced incorrectly.

SiliconWizard:
No, I haven't. The datasheet is there in case you haven't downloaded it already, or for those curious: http://wiki.telink-semi.cn/doc/ds/DS_TLSR8232-E_Datasheet%20for%20Telink%20BLE%20SoC%20TLSR8232.pdf

They claim a better performance/power ratio than a Cortex-M0, although I don't know if they can back up that claim.

Regarding the compiler, if it's GCC, then they should have released the source code. If they haven't, people should pressure them until they do. Note that it's really not uncommon for chinese vendors to do exactly this. They often use open-source tools, modify them and are very reluctant to release the modified source code. It's very, very often like this. Not that this is gratuitous bashing: just something that I have noticed again and again: they seem to take foreign IP and open-source licenses very "liberally", while being very secretive of their own IP. Oh well. But let us know if you find any source code for the toolchain!

david.given:
Re gcc: yes, agreed. Feel free to chime in on my topic thread on their website: https://developers.telink-semi.cn/topic/3156

It's a nice chip, actually. Relatively well-documented (although with some big holes; like the CPU debug interface) with lots of features. This one seems to be obsolete and they're phasing it out, which is no doubt one reason why these watches are so cheap. For a basic BLE controller you could do a lot worse. Their more expensive models use RISC-V and have more memory, presumably at a correspondingly increased price.

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod