So, I want to get into microcontrollers, which one...
# kotlin-native
n
So, I want to get into microcontrollers, which ones can I use with kotlin?
j
n
Currently Kotlin Native requires a OS (Real Time OS's included) as part of the porting process to other platforms, which restricts the number of uCs it can run on bar performance requirements.
Currently the main uCs supported by Kotlin Native are determined by what uCs are supported by Zephyr ( https://docs.zephyrproject.org/latest/boards/boards.html ).
Would highly recommend going with a STM32 based uC (one based on a ARM 32 CPU) that is supported by Zephyr. The main reasons to go with a STM32 are the high value for money (good performance/hw features per buck), low cost, high availability, and comprehensive documentation/C libs.
Unfortunately the standard STM32 C libs are only accessible via bare metal on a STM32 uC 🙁. Kotlin Native doesn't have bare metal hardware support in its porting system 😢.
n
so that means i have no direct access or does that mean i need libraries to access the baremetal APIs ? whats the workaround or is there none ?
j
Native needs a runtime, most microcontrollers don't have the space for a runtime. Its not currently supported.
n
so if i want the full featureset maybe i would be better off with a raspberry pi or something ?
n
For low level hw access you are limited to what the Zephyr APIs provide ( https://docs.zephyrproject.org/latest/api/api.html ).
Keep in mind that the Raspberry Pi is a SBC (Single Board Computer) which runs a OS, and isn't a uC (Microcontroller - https://en.wikipedia.org/wiki/Microcontroller ). This post outlines the differences between a uC and a SBC: https://www.quora.com/What-are-the-differences-between-single-board-computer-and-microcontroller
n
what i need is pretty much just network access and control over the pins
pins are the GPIO api right ?
n
Yes (in most cases). Although it depends on the library that is used.