first impressions of the Lego smart brick, before I do any actual tearing down: wow, I forgot how good they are at working with plastic. the injecton molding remains impeccable, at least for this specific piece (I know about their recent QC issues elsewhere)

it's hard for me to look at the positively microscopic (I am literally using a microscope to look at it) "Li-Ion" lettering and think of anything but "showing off!"

(treehouse doesn't let me attach the full size images, you can grab them here: front, side)

on the side, there are microscopic openings for the speaker to move air through. I would have really liked to be a fly on the wall in a meeting with the mold engineer who had to make this happen

original

I'm not yet sure how I'll open it up. I don't have a hacksaw (somehow... I should fix that), so my options are somewhat limited: it's either cracking or melting plastic. from what others have done I know I there's plastic welding all around the joined region.

okay I've decided on an idea: I will heat up the plastic to make it pliable and then cut it with a knife

as a knfe girl, this is my professional obligation.

here's a video that shows in more detail the moldwork in the transparent plastic part
if you've never heard of anybody opening welded plastic this way, i can now tell you why: because it's a bad idea. until you heat ABS to the point where it flows (which you don't want here, as it'll make later teardown even worse), it acts rubbery. imagine cutting hot rubber. doesn't work

it did however let me lop off the top of it easily

this is I think a 2.4G antenna?

next step is sanding

yep that did the thing. probably should've started with sanding at the beginning.

it was somewhat more destructively than i wanted, but that's ok: i was trying to challenge my (incorrect) belief that sanding is always a tedious pan in the arse

took it apart. there's a sort of a plastic "carrier" that gets manufacured first, then inserted into the final package that's welded shut
okay, i've extracted the firmware-bearing parts. this is a tiny 45 mAh battery. (part of the lettering was torn off by the glue it was attached with)

close-ups of the component side (well, the side with more components)

originals: 1 2

EM9305 is an em|bleu microcontroller in QFN
@whitequark Calling an ARC CPU industry standard is very funny to me
@ldcd @whitequark
It is quite widespread, even if not visible to end users.
Being in most Intel CPU's and all that.

@ftg @whitequark yeah that's why it's kind of funny, it is simultaneously a very common CPU and a very obscure CPU (ie it's hard to get comprehensive documentation, the devkit is literally an FPGA, etc)

Like they're not lying but they're trying to imply it's a normal CPU to use and be able to program which isn't really true

@ldcd @ftg @whitequark I have yet to come across any SoC with an ARC core where the docs weren't partially or fully NDA'd, or at least gated behind a sales call.
@gsuberland @ftg @whitequark This is my industry standard very normal CPU core (no you cannot look at)

@ldcd @ftg @whitequark in fact most of the time it's not even a case of NDA, it's a completely custom SoC ASIC with ARC core IP inside and the only way to get docs is to work at the company. I'd say "or contract with them" but generally even then you won't get full docs for the ARC core IP without a first-party NDA with the IP vendor.

AIUI there's more use of COTS ARC SoCs around in the automotive space (primarily ECUs) but the detailed documentation and SDK/BSP tends to be NDA'd there too.

@ldcd @ftg @whitequark definitely a weird architecture to run into in anything not hyper specialised. I'd be very surprised to stumble across it in an IoT device for example.
@gsuberland @ftg @whitequark It's also pretty common inside memory controllers afaict (the STM32MP2 and some RKs that use Synopsys DDR IP use it). I would be surprised if its not embedded in a lot of Synopsys IP
@ldcd @ftg @whitequark Synopsys definitely uses ARC core IP a bunch.
@gsuberland @ftg @whitequark its at least less unhinged than the hard microblazes that show up in a bunch of xilinx parts
@ldcd @ftg @whitequark I'm still hoping to run into Parallax Propeller hiding out in an IoT device somewhere. such a weird architecture, I can't recall ever seeing it in something IRL.
@gsuberland @ldcd @whitequark
So how do you rate it being in a Lego brick?
@ftg @ldcd @whitequark surprising but almost not surprising? it's weird but also one of those applications where I bet they had very specific requirements around hardware FPU/DSP capabilities, communications peripherals, power management, and physical size, where meeting them all at the same time required treading more unusual paths. the integrated DC-DC in that chip was probably a major selling point.
@gsuberland @ftg @ldcd this specific chip has directionfinding btw. and a "LOG2 accelerator" whatever the fuck that is
@whitequark @gsuberland @ftg from what i understand one of the big selling points of ARC is that they let you add ~whatever instructions you want and they make it relatively easy to use those instructions from C, so that might be whats going on there?
@ldcd @whitequark @ftg almost certainly a hardware log2 instruction bolted on. I wonder if they're using it for FFT or something.
@gsuberland @ldcd @ftg well yes they call it a log2() accelerator but why
@whitequark @gsuberland @ldcd @ftg ...are you sure it's not just CLZ?
@wren6991 @whitequark @gsuberland @ldcd @ftg ceil(log2(n+1)) is clz, and is somewhat often defined as such so wouldn't surprise me (I doubt it would actually have floating point log)
@ignaloidas @gsuberland @ldcd @ftg @wren6991 i have literally never seen clz implemented that way
@whitequark @gsuberland @ldcd @ftg @wren6991 jpeg xl uses the log2 way in it's spec (it took me a bit of thinking to reverse it)

(wait, now that I'm re-thinking, that's not clz but bitsize minus clz but basically same)
@ignaloidas @gsuberland @ldcd @ftg @whitequark (implements XOR instruction) Galois Field Addition Accelerator 😎
@whitequark @ldcd @ftg hmm, seems to be hardware log2p0 and log2p1 intrinsics. weird.
@gsuberland @ldcd @ftg what is the p0/p1?
@whitequark @ldcd @ftg log2p0 is plain integer log base 2 (I think with always round down behaviour?) and log2p1 is the same but add 1 after. the latter is used to calculate how many bits are needed to store a given number. I know the latter gets used in some AV compression algorithms, idk about the decompression algorithms though.
@gsuberland @ldcd @ftg i found an ARC in a ThindPad once
@gsuberland @ldcd @ftg in the keyboard controller no less!
@whitequark @gsuberland @ftg excuse me thats where 8051s are supposed to live; thats an invasive species
@ldcd @whitequark @gsuberland @ftg i wonder if anyone has done a mips based keyboard controller
@azonenberg @ldcd @whitequark @gsuberland
I'll mention this to a MIPS loving friend who's currently working on a keyboard project.
But I think it would have to then be based on something like PIC32.
@ftg @ldcd @whitequark @gsuberland I'm pretty sure i saw a digilent fpga board that had a pic32 on it in usb host mode that presented a ps/2 mouse and keyboard interface to the FPGA if you plugged in a usb one
@azonenberg @ftg @whitequark @gsuberland Yes the Genesys 2 has this; it's very funny (but makes sense in an education setting if you want to keep your PS2 mouse lab without keeping the mouses)
@ftg @ldcd @whitequark @gsuberland i used to be big on mips. I remember being very disappointed when i discovered BFC00000 was not a valid license plate in my state
@whitequark @ldcd @ftg hah, weird. that's an odd choice of architecture for a keyboard controller, unless it was doing audio or touchpad stuff too I suppose.
@gsuberland @ldcd @ftg no it's just the EC. from Microchip
@whitequark @gsuberland @ftg maybe its a rebranded automotive part
@ldcd @gsuberland @ftg when have you last seen an automotive part with an LPC target controller
@whitequark @gsuberland @ftg cursed thought: pentium based ECU
@ldcd @whitequark @ftg "why did you crash your car?" "F00F bug, your honour"
@whitequark @gsuberland @ldcd @ftg huh I thought microchip ECs were mostly arm based