• why not use the HAL/CMSIS files generated by ST tools directly

    The main answer is Espruino is ~5 years old, and ST didn't have any of those tools available at that time. I uses what there was.

    But also I had a go at porting to the new libraries a while back and found that the 'new' ST HAL was horribly inefficient with memory, and also was totally not suited to interpreters. The library wants you to define up-front what peripherals you want to where, and in an interpreter you want to define them when you execute the code, not at compile time.

    Basically it is Ok for micropython because it targets MCUs with more memory, but I was just unable to target the 128kB/8kB MCUs with the new library that were fine with the old library, so I stopped trying. It seemed stupid to spend weeks porting to a new library just so Espruino could be slower, more buggy and use more memory.

    ST themselves did a port to STM32L4 heavily based off the existing STM32 port, but that uses the even newer LL low level libraries, not CubeMX as far as I know.

About

Avatar for Gordon @Gordon started