Kategorien
Hardware

Custom firmware on LKS32

Linko Semiconductor Co., LTD. is a privately held company specialized development of ICs for motion control, based in Nanjing (China). It produces cost-effective ICs with integrated MCU (motor control unit); the LKS32 comes with a 32bit MCU.

I’m interesting in running custom firmware on this chip because Xiaomi, more specifically Brightway, uses it in it’s latest electric scooters models. For experimentation, I ordered a few matching LKS32MC081 samples from a friendly seller on Alibaba.

One of the LKS32MC081 chips I bought

Programming the chip

All relevant documents and software for programming the LKS32MC08x chip can be found here: https://www.lksmcu.com/index.php/LKS08Series-en/.

Even though one should be able to manually program the chip using the flash controller registers, I found it more convenient to use the tools provided by Linkosemi.

I was able to compile and download a custom Blinky program (attached below) onto the chip.

Running Blinky on LKS32MC081

Attachment: Blinky program for LKS32MC08x

int main(void)
{
  Hardware_init();
  while (1)
  {
    GPIO_SetBits(GPIO0, GPIO_Pin_6);
    SoftDelay(0xFFFFF);
    GPIO_ResetBits(GPIO0, GPIO_Pin_6);
    SoftDelay(0xFFFFF);
  }
}