Periodic Report: August 2016

rLoop

vgp4oeo4bzm6nrxiuvki

I’m involved in the rLoop team, we are building a 1/3 scale Hyperloop Pod for the competition hosted by SpaceX. Learn more about it here: https://www.indiegogo.com/projects/help-build-rloop-s-pod-for-spacex-hyperloop-comp

Our team is sponsored by TE Connectivity (formerly Tyco Electronics), and they’ve temporarily given us a building to work in, including access to complete machine shops and other fabrication facilities. I am on the elec team and the maker team since I live so close to the TE building, every day after work I go do a bit of work on any part of the pod that involves electricity.

This team is insane. We have people travelling across the world to join. We have camera crews for PR, our lovely HR can house 8 people into one AirBnB with zero notice, we are registered as a non-profit and we can literally hand out Visas so we can get talent from all over the globe.

I got invited by a new friend who I met at RoboGames 2016. I have zero free time now but zero regrets.

C.H.I.P. $9 Computer Review

I got a Kickstarter edition of NextThingCo CHIP. This thing is amazing, smaller than a Raspberry Pi, cheaper, and in my opinion, it is much better designed for physical circuitry. It’s unbrickable due to how the first stage bootloader works. Out of the box, you can terminal into it with just a USB cable, and getting on WiFi is just a one line command.

I’ve got three projects lined up for it but I am kind of busy with rLoop.

Dumb Problems

I can’t spill too much details here for legal reasons.

Now I’ve done plenty of projects solo but I got to pick the parts every single time. This project I am on for my employer did not give me such liberties, firstly, due to it being an upgrade of an existing circuit, secondly, everything I want would’ve been slightly more expensive by pennies.

So a company sold my bosses on a new headset audio DSP/DAC/AMP chip with fancy features and no other product on the market is using this chip yet. They did it by giving us some glorious sound samples with before and after, they give me a huge evaluation board and some config files so I can replicate the results. They promised that everything inside can be tuned specifically for us and they’ll do that for us using their laboratories. My bosses were happy and we moved forward with this chip.

Then weird shit started to happen. The documentation isn’t complete and lacking a lot of timing information. I discovered that if I sent the first I2C transactions too soon after power rise, a lot of settings did not take effect even though the writes completed and could be verified. Asking their engineers, they told me the I2C registers are hardware and should be ready to write immediately after DVDD rises. This is just bullshit… but at the time, I was also working on a preboot routine that would have delayed all I2C transactions by more than a second so it wasn’t worth my time arguing since that long of a pause definitely fixed this problem.

Then once we were at the stage when they were tuning for our physical product, they dropped a bombshell on me, that is… their tuning isn’t just some parameters, it’s actually entire chunks of DSP binary code, and their DSP has 32KB of this in writable RAM when you write specific I2C sequences.

I pointed out a few problems with this:

  1. They never mentioned that the size requirement was so large, but they replied that they will optimize it and promised it’ll fit in the end
  2. Why the fuck isn’t this data stored in NVM instead of RAM? If a company required to customize all 32KB through their I2C, it’ll take like 5 seconds to load, do you want to wait 5 seconds before your headset starts working?

Thirdly, they provided the data in this format:

F4 01
F0 83
F1 37
F2 2D
F3 1E
F4 00
F4 01
F0 4A
F1 CC
F2 B6
F3 4E
F4 00
repeat

where the register 0xF4 when written like that, will “clock” in the 4 bytes placed into 0xF0 to 0xF3. All of this is a part of their documentation, not just me seeing patterns and extrapolating. In reality, I am only writing “83 37 2D 1E 4A CC B6 E4”, and the rest of the data is redundant. We’ll call this the “compact format”.

I asked their engineers for the compact format instead of the two column table. They had no idea how to give it to me that way… Dafuq?

It took me only a few minutes to script something to parse their two column table and spit out just the compacted binary. It worked at the start, I even managed to speed it up by taking advantage of I2C register auto-increment. Otherwise we’d end up with a headset that takes 5 seconds just to boot.

And upon learning that I am storing data this way, even though I’ve proven it works, every single problem I asked them about was bounced back to me first, no matter how trivial.

This was my biggest mistake made during this project, I took the initiative, and impressed my superiors. Perhaps next time I should just take a step back, bounce the problem back saying we have no memory left, and either force my bosses to change my MCU or change the DSP.

Dumb Problems 2

The Spansion 8FX family of microcontroller needs to die in hell fire, if they are not dead already. Toolchain is Windows only. The compiler does NOT optimize even with the highest optimization level enabled, it can’t remove unused functions, or turn two consecutive immediate logic OR/AND into just one. The debugger is finicky as hell, and I can’t even find one for sale anymore, we have to ask our factory partner for them. The SPI peripheral doesn’t even support all 4 major SPI modes. The flash controller can only do erase all, not by pages. There isn’t a PLL lock indicator that’s reliable, only a “a few clock cycles passed, assume it’s locked” bit. I can complain on and on…

Leave a Reply

Your email address will not be published. Required fields are marked *