diff --git a/README.md b/README.md index fc229de..b7b3da8 100644 --- a/README.md +++ b/README.md @@ -41,15 +41,14 @@ If you have a Solo for Hacker, here's how you can load your own code on it. You git clone --recurse-submodules https://github.com/SoloKeysSec/solo cd solo -cd targets/stm32l442 +cd targets/stm32l432 make cbor make all-hacker python ../../tools/programmer.py solo.hex ``` If you forgot the `--recurse-submodules` when cloning, simply `git submodule update --init --recursive`. - -For example, if you want to turn off any blue light emission, you can edit [`led_rgb()`](https://github.com/SoloKeysSec/solo/blob/master/targets/stm32l442/src/led.c#L15) and force: +For example, if you want to turn off any blue light emission, you can edit [`led_rgb()`](https://github.com/SoloKeysSec/solo/blob/master/targets/stm32l432/src/led.c#L15) and force: ``` uint32_t b = 0; ``` diff --git a/docs/building.md b/docs/building.md index 0b498af..20740e7 100644 --- a/docs/building.md +++ b/docs/building.md @@ -5,7 +5,7 @@ There exists a development board [NUCLEO-L432KC](https://www.st.com/en/evaluatio # Prerequisites -Install the [latest ARM compiler toolchain](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads) for your system. +Install the [latest ARM compiler toolchain](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads) for your system. We recommend getting the latest compilers from ARM. You can also install the ARM toolchain using a package manage like `apt-get` or `pacman`, but be warned they might be out of date. Typically it will be called `gcc-arm-none-eabi binutils-arm-none-eabi`. @@ -21,7 +21,7 @@ To program your build, you'll need one of the following programs. Enter the `stm32l4xx` target directory. ``` -cd targets/stm32l442 +cd targets/stm32l432 ``` Build the cbor library. @@ -30,117 +30,131 @@ Build the cbor library. make cbor ``` -Now build the Solo bootloader. +Now build Solo. ``` -make clean -make boot -# Or to make a Solo Hacker build: -# make boot-hacker +make build-hacker ``` -Now build the Solo application. +The `build-hacker` recipe does a few things. First it builds the bootloader, with +signature checking disabled. Then it builds the Solo application with "hacker" features +enabled, like being able to jump to the bootloader on command. It then merges bootloader +and solo builds into the same binary. I.e. it combines `bootloader.hex` and `solo.hex` +into `all.hex`. + +If you're just planning to do development, please don't try to reprogram the bootloader, +as this can be risky if done often. Just use `solo.hex`. + +### Building with debug messages + +If you're developing, you probably want to see debug messages! Solo has a USB +Serial port that it will send debug messages through (from `printf`). You can read them using +a normal serial terminal like `picocom` or `putty`. + +Just add `DEBUG=1` or `DEBUG=2` to your build recipe, like this. ``` -make clean -make -# Or to make a Solo Hacker build: -# make all-hacker +make build-hacker DEBUG=1 ``` -Note that for hacker builds, the bootloader must be built using the `boot-hacker` recipe. +If you use `DEBUG=2`, that means Solo will not boot until something starts reading +it's debug messages. So it basically it waits to tether to a serial terminal so that you don't +miss any debug messages. -Merge the two files together. This script also patches a spot in memory to -allow the bootloader to boot the application. This memory spot is later used for -signed firmware updates. +We recommend using our `solotool.py` as a serial emulator since it will automatically +reconnect each time you program Solo. ``` -python merge_hex.py solo.hex bootloader.hex all.hex +python tools/solotool.py monitor ``` -You can now program Solo with `all.hex`. +### Building a Solo release -# Solo Hacker +If you want to build a release of Solo, we recommend trying a Hacker build first +just to make sure that it's working. Otherwise it may not be as easy or possible to +fix any mistakes. -A Solo Hacker build is more friendly for development. If you just want to test your -solo build or do any sort of development, you should start with this. +If you're ready to program a full release, run this recipe to build. -It is the same build as a production Solo, but it has extra commands available. +``` +make build-release-locked +``` -* Allows updates at any time without pressing button. -* Opens a USB emulated serial port for printing. -* Doesn't lock the flash or debugger at all. +Programming `all.hex` will cause the device to permanently lock itself. -You if build with Solo Hacker, you can always completely overwrite it and start over. -If it's not a hacker build, you cannot reprogram Solo as easily. - -* `all-hacker`: can be reprogrammed again over USB or via wire with a programmer. -* `all`: can be reprogrammed using only signed updates or via wire with a programmer. -* `all-locked`: Can only be reprogrammed via signed updates unless they are disabled. # Programming It's recommended to test a debug/hacker build first to make sure Solo is working as expected. Then you can switch to a locked down build, which cannot be reprogrammed as easily (or not at all!). +We recommend using our `solotool.py` to manage programming. It is cross platform. First you must +install the prerequisites: + +``` +pip3 install -r tools/requirements.txt +``` + +If you're on Windows, you must also install [libusb](https://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.6.0/). + +## Pre-programmed Solo Hacker + +If your Solo device is already programmed (it flashes green when powered), we recommend +programming it using the Solo bootloader. + +``` +python tools/solotool.py program solo.hex +``` + +Make sure to program `solo.hex` and not `all.hex`. Nothing bad would happen, but you'd +see errors. + +If something bad happens, you can always boot the Solo bootloader by doing the following. + +1. Unplug device. +2. Hold down button. +3. Plug in device while holding down button. +4. Wait about 2 seconds for flashing yellow light. Release button. + +If you hold the button for an additional 5 seconds, it will boot to the ST DFU (device firmware update). +Don't use the ST DFU unless you know what you're doing. + ## ST USB DFU -If your Solo has never been programmed, it will boot the ST USB DFU. You can program -it via USB. After you program it, it will still be in ST USB DFU mode. You additionally -need to supply a command to tell the DFU program to "detach" and boot the application. +If your Solo has never been programmed, it will boot the ST USB DFU. The LED is turned +off and it enumerates as "STM BOOTLOADER". -If you power cycle Solo, it will return to DFU mode so you can reprogram it. If you don't -want it to do this, you must set the option bytes bit `nBOOT0=1`. Now it will always boot the application. - -Example using STM32CubeProg. +You can program it by running the following. ``` -# Program all.hex -STM32_Programmer_CLI -c port=usb1 -halt -d all.hex - -# If you want it to always boot application, set nBOOT0=1 -STM32_Programmer_CLI -c port=usb1 -ob nBOOT0=1 +python tools/solotool.py program all.hex --use-dfu --detach ``` -If Solo has been programmed with a hacker build, you can return it to ST DFU mode using just USB. +Make sure to program `all.hex`, as this contains both the bootloader and the Solo application. -``` -# Use our programmer script +If all goes well, you should see a slow-flashing green light. -# Makes it boot to ST DFU once -python tools/programmer.py --st-dfu - -# OR -# Make it boot to ST DFU every boot (initial state basically) -python tools/programmer.py --enter-bootloader -python tools/programmer.py --st-dfu -``` - -## Solo / Solo Hacker updates - -To program a Solo Hacker device, run the following. Note you should only specify the application -firmware, not the combined bootloader+application! I.e. not `all.hex` from above. - -```bash -python tools/programmer.py target/stm32l442/solo.hex -``` +## Solo Hacker vs Solo A Solo hacker device doesn't need to be in bootloader mode to be programmed, it will automatically switch. -If the application gets bricked, you can hold down the button for 2 seconds while -plugging it in the token make it stay in the bootloader. Holding the button an additional 5 seconds -will return it to the ST DFU. + +Solo (locked) needs the button to be held down when plugged in to boot to the bootloader. + +A locked Solo will only accept signed updates. + +## Signed updates If this is not a device with a hacker build, you can only program signed updates. ``` -python tools/programmer.py /path/to/firmware.json +python tools/solotool.py program /path/to/firmware.json ``` If you've provisioned the Solo bootloader with your own secp256r1 public key, you can sign your firmware by running the following command. ``` -python tools/sign_firmware.py /path/to/signing-key.pem /path/to/solo.hex /output-path/to/firmware.json +python tools/solotool.py sign /path/to/signing-key.pem /path/to/solo.hex /output-path/to/firmware.json ``` If your Solo isn't locked, you can always reprogram it using a debugger connected directly @@ -151,13 +165,9 @@ to the token. If you plan to be using your Solo for real, you should lock it permanently. This prevents someone from connecting a debugger to your token and stealing credentials. -To do this, build the non-hacker bootloader and locked version of the firmware. +To do this, build the locked release firmware. ``` -make clean -make boot -make clean -make all-locked -python merge_hex.py solo.hex bootloader.hex all.hex +make build-release-locked ``` Now when you program `all.hex`, the device will lock itself when it first boots. You can only update it @@ -166,6 +176,6 @@ with signed updates. If you'd like to also permanently disable signed updates, plug in your programmed Solo and run the following: ``` -# No more signed updates. +# WARNING: No more signed updates. python tools/programmer.py --disable ``` diff --git a/docs/contributing.md b/docs/contributing.md index d171608..a200f01 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -2,11 +2,11 @@ We are very open to contributions! [Currently](https://github.com/solokeyssec/solo/issues), most work will go towards -* implementing STM32L442 +* implementing STM32L432 * implementing NFC * adding documentation and improving accessability of the code -In the future, we would love to see creative plugins/extensions, putting the TRNG and other features of the STM32L442 to good use! +In the future, we would love to see creative plugins/extensions, putting the TRNG and other features of the STM32L432 to good use! Feel free to send a [pull request](https://github.com/SoloKeysSec/solo/pulls) at any time, we don't currently have a formal contribution process. diff --git a/docs/signed-updates.md b/docs/signed-updates.md index 38b15ac..86dba1d 100644 --- a/docs/signed-updates.md +++ b/docs/signed-updates.md @@ -2,7 +2,7 @@ Solo has a bootloader that's fixed in memory to allow for signed firmware updates. It is not a built-in bootloader provided by the chip manufacturer, it is our own. We plan to use Ed25519 signatures, which have [efficient constant-time implementations on Cortex-M4 chips](http://www.cs.haifa.ac.il/~orrd/LC17/paper39.pdf). -On the STM32L442, there is 256 KB of memory. The first 14 KB of memory is reserved for the bootloader. +On the STM32L432, there is 256 KB of memory. The first 14 KB of memory is reserved for the bootloader. The bootloader is the first thing that boots, and if the button of the device is not held for 2 seconds, the application is immediately booted. diff --git a/targets/stm32l442/.ycm_extra_conf.py b/targets/stm32l432/.ycm_extra_conf.py similarity index 100% rename from targets/stm32l442/.ycm_extra_conf.py rename to targets/stm32l432/.ycm_extra_conf.py diff --git a/targets/stm32l442/Makefile b/targets/stm32l432/Makefile similarity index 76% rename from targets/stm32l442/Makefile rename to targets/stm32l432/Makefile index 23accff..6463634 100644 --- a/targets/stm32l442/Makefile +++ b/targets/stm32l432/Makefile @@ -22,14 +22,29 @@ debugboot-boot: LDSCRIPT=linker/bootloader_stm32l4xx_extra.ld EXTRA_DEFINES='-DAPPLICATION_START_PAGE=16 -DSOLO_HACKER' boot-sig-checking: - $(MAKE) -f bootloader.mk -j8 bootloader.hex + $(MAKE) -f bootloader.mk -j8 bootloader.hex DEBUG=0 boot-no-sig: - $(MAKE) -f bootloader.mk -j8 bootloader.hex EXTRA_DEFINES='-DSOLO_HACKER' + $(MAKE) -f bootloader.mk -j8 bootloader.hex EXTRA_DEFINES='-DSOLO_HACKER' DEBUG=0 + +build-release-locked: clean2 boot-sig-checking clean all-locked + $(merge_hex) solo.hex bootloader.hex all.hex + rm -f solo.hex bootloader.hex # don't program solo.hex ... + +build-release: clean2 boot-sig-checking clean all + $(merge_hex) solo.hex bootloader.hex all.hex + +build-hacker: clean2 boot-no-sig clean all-hacker + $(merge_hex) solo.hex bootloader.hex all.hex clean: $(MAKE) -f application.mk clean $(MAKE) -f bootloader.mk clean +clean2: + rm -f solo.hex bootloader.hex all.hex + $(MAKE) -f application.mk clean + $(MAKE) -f bootloader.mk clean + flash: solo.hex bootloader.hex $(merge_hex) solo.hex bootloader.hex all.hex diff --git a/targets/stm32l442/Makefile.test.mk b/targets/stm32l432/Makefile.test.mk similarity index 96% rename from targets/stm32l442/Makefile.test.mk rename to targets/stm32l432/Makefile.test.mk index 402b2d1..88a02ab 100644 --- a/targets/stm32l442/Makefile.test.mk +++ b/targets/stm32l432/Makefile.test.mk @@ -24,10 +24,8 @@ CFLAGS= $(INC) TARGET=solo HW=-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -# Nucleo board -#CHIP=STM32L432xx -# Solo -CHIP=STM32L442xx +# Solo or Nucleo board +CHIP=STM32L432xx DEFINES = -D$(CHIP) -DAES256=1 -DUSE_FULL_LL_DRIVER DEFINES += -DTEST_SOLO_STM32 -DTEST diff --git a/targets/stm32l442/README.md b/targets/stm32l432/README.md similarity index 100% rename from targets/stm32l442/README.md rename to targets/stm32l432/README.md diff --git a/targets/stm32l442/application.mk b/targets/stm32l432/application.mk similarity index 97% rename from targets/stm32l442/application.mk rename to targets/stm32l432/application.mk index 33f899c..cb6edf2 100644 --- a/targets/stm32l442/application.mk +++ b/targets/stm32l432/application.mk @@ -36,10 +36,8 @@ CFLAGS= $(INC) TARGET=solo HW=-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -# Nucleo board -#CHIP=STM32L432xx -# Solo -CHIP=STM32L442xx +# Solo or Nucleo board +CHIP=STM32L432xx ifndef DEBUG DEBUG=0 diff --git a/targets/stm32l442/bootloader.mk b/targets/stm32l432/bootloader.mk similarity index 97% rename from targets/stm32l442/bootloader.mk rename to targets/stm32l432/bootloader.mk index e8ca05f..7e4ba3d 100644 --- a/targets/stm32l442/bootloader.mk +++ b/targets/stm32l432/bootloader.mk @@ -34,10 +34,8 @@ CFLAGS= $(INC) TARGET=bootloader HW=-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -# Nucleo board -#CHIP=STM32L432xx -# Solo -CHIP=STM32L442xx +# Solo or Nucleo board +CHIP=STM32L432xx ifndef DEBUG DEBUG=0 diff --git a/targets/stm32l442/bootloader/bootloader.c b/targets/stm32l432/bootloader/bootloader.c similarity index 100% rename from targets/stm32l442/bootloader/bootloader.c rename to targets/stm32l432/bootloader/bootloader.c diff --git a/targets/stm32l442/bootloader/bootloader.h b/targets/stm32l432/bootloader/bootloader.h similarity index 100% rename from targets/stm32l442/bootloader/bootloader.h rename to targets/stm32l432/bootloader/bootloader.h diff --git a/targets/stm32l442/bootloader/main.c b/targets/stm32l432/bootloader/main.c similarity index 100% rename from targets/stm32l442/bootloader/main.c rename to targets/stm32l432/bootloader/main.c diff --git a/targets/stm32l442/cubeconfig_stm32l442.ioc b/targets/stm32l432/cubeconfig_stm32l442.ioc similarity index 100% rename from targets/stm32l442/cubeconfig_stm32l442.ioc rename to targets/stm32l432/cubeconfig_stm32l442.ioc diff --git a/targets/stm32l442/lib/stm32_hal_legacy.h b/targets/stm32l432/lib/stm32_hal_legacy.h similarity index 100% rename from targets/stm32l442/lib/stm32_hal_legacy.h rename to targets/stm32l432/lib/stm32_hal_legacy.h diff --git a/targets/stm32l442/lib/stm32l4xx_hal.h b/targets/stm32l432/lib/stm32l4xx_hal.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_hal.h rename to targets/stm32l432/lib/stm32l4xx_hal.h diff --git a/targets/stm32l442/lib/stm32l4xx_hal_conf.h b/targets/stm32l432/lib/stm32l4xx_hal_conf.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_hal_conf.h rename to targets/stm32l432/lib/stm32l4xx_hal_conf.h diff --git a/targets/stm32l442/lib/stm32l4xx_hal_def.h b/targets/stm32l432/lib/stm32l4xx_hal_def.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_hal_def.h rename to targets/stm32l432/lib/stm32l4xx_hal_def.h diff --git a/targets/stm32l442/lib/stm32l4xx_hal_pcd.c b/targets/stm32l432/lib/stm32l4xx_hal_pcd.c similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_hal_pcd.c rename to targets/stm32l432/lib/stm32l4xx_hal_pcd.c diff --git a/targets/stm32l442/lib/stm32l4xx_hal_pcd.h b/targets/stm32l432/lib/stm32l4xx_hal_pcd.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_hal_pcd.h rename to targets/stm32l432/lib/stm32l4xx_hal_pcd.h diff --git a/targets/stm32l442/lib/stm32l4xx_hal_pcd_ex.c b/targets/stm32l432/lib/stm32l4xx_hal_pcd_ex.c similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_hal_pcd_ex.c rename to targets/stm32l432/lib/stm32l4xx_hal_pcd_ex.c diff --git a/targets/stm32l442/lib/stm32l4xx_hal_pcd_ex.h b/targets/stm32l432/lib/stm32l4xx_hal_pcd_ex.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_hal_pcd_ex.h rename to targets/stm32l432/lib/stm32l4xx_hal_pcd_ex.h diff --git a/targets/stm32l442/lib/stm32l4xx_ll_bus.h b/targets/stm32l432/lib/stm32l4xx_ll_bus.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_bus.h rename to targets/stm32l432/lib/stm32l4xx_ll_bus.h diff --git a/targets/stm32l442/lib/stm32l4xx_ll_cortex.h b/targets/stm32l432/lib/stm32l4xx_ll_cortex.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_cortex.h rename to targets/stm32l432/lib/stm32l4xx_ll_cortex.h diff --git a/targets/stm32l442/lib/stm32l4xx_ll_crs.h b/targets/stm32l432/lib/stm32l4xx_ll_crs.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_crs.h rename to targets/stm32l432/lib/stm32l4xx_ll_crs.h diff --git a/targets/stm32l442/lib/stm32l4xx_ll_gpio.c b/targets/stm32l432/lib/stm32l4xx_ll_gpio.c similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_gpio.c rename to targets/stm32l432/lib/stm32l4xx_ll_gpio.c diff --git a/targets/stm32l442/lib/stm32l4xx_ll_gpio.h b/targets/stm32l432/lib/stm32l4xx_ll_gpio.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_gpio.h rename to targets/stm32l432/lib/stm32l4xx_ll_gpio.h diff --git a/targets/stm32l442/lib/stm32l4xx_ll_iwdg.h b/targets/stm32l432/lib/stm32l4xx_ll_iwdg.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_iwdg.h rename to targets/stm32l432/lib/stm32l4xx_ll_iwdg.h diff --git a/targets/stm32l442/lib/stm32l4xx_ll_pwr.c b/targets/stm32l432/lib/stm32l4xx_ll_pwr.c similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_pwr.c rename to targets/stm32l432/lib/stm32l4xx_ll_pwr.c diff --git a/targets/stm32l442/lib/stm32l4xx_ll_pwr.h b/targets/stm32l432/lib/stm32l4xx_ll_pwr.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_pwr.h rename to targets/stm32l432/lib/stm32l4xx_ll_pwr.h diff --git a/targets/stm32l442/lib/stm32l4xx_ll_rcc.c b/targets/stm32l432/lib/stm32l4xx_ll_rcc.c similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_rcc.c rename to targets/stm32l432/lib/stm32l4xx_ll_rcc.c diff --git a/targets/stm32l442/lib/stm32l4xx_ll_rcc.h b/targets/stm32l432/lib/stm32l4xx_ll_rcc.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_rcc.h rename to targets/stm32l432/lib/stm32l4xx_ll_rcc.h diff --git a/targets/stm32l442/lib/stm32l4xx_ll_rng.c b/targets/stm32l432/lib/stm32l4xx_ll_rng.c similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_rng.c rename to targets/stm32l432/lib/stm32l4xx_ll_rng.c diff --git a/targets/stm32l442/lib/stm32l4xx_ll_rng.h b/targets/stm32l432/lib/stm32l4xx_ll_rng.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_rng.h rename to targets/stm32l432/lib/stm32l4xx_ll_rng.h diff --git a/targets/stm32l442/lib/stm32l4xx_ll_system.h b/targets/stm32l432/lib/stm32l4xx_ll_system.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_system.h rename to targets/stm32l432/lib/stm32l4xx_ll_system.h diff --git a/targets/stm32l442/lib/stm32l4xx_ll_tim.c b/targets/stm32l432/lib/stm32l4xx_ll_tim.c similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_tim.c rename to targets/stm32l432/lib/stm32l4xx_ll_tim.c diff --git a/targets/stm32l442/lib/stm32l4xx_ll_tim.h b/targets/stm32l432/lib/stm32l4xx_ll_tim.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_tim.h rename to targets/stm32l432/lib/stm32l4xx_ll_tim.h diff --git a/targets/stm32l442/lib/stm32l4xx_ll_usart.c b/targets/stm32l432/lib/stm32l4xx_ll_usart.c similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_usart.c rename to targets/stm32l432/lib/stm32l4xx_ll_usart.c diff --git a/targets/stm32l442/lib/stm32l4xx_ll_usart.h b/targets/stm32l432/lib/stm32l4xx_ll_usart.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_usart.h rename to targets/stm32l432/lib/stm32l4xx_ll_usart.h diff --git a/targets/stm32l442/lib/stm32l4xx_ll_usb.c b/targets/stm32l432/lib/stm32l4xx_ll_usb.c similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_usb.c rename to targets/stm32l432/lib/stm32l4xx_ll_usb.c diff --git a/targets/stm32l442/lib/stm32l4xx_ll_usb.h b/targets/stm32l432/lib/stm32l4xx_ll_usb.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_usb.h rename to targets/stm32l432/lib/stm32l4xx_ll_usb.h diff --git a/targets/stm32l442/lib/stm32l4xx_ll_utils.c b/targets/stm32l432/lib/stm32l4xx_ll_utils.c similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_utils.c rename to targets/stm32l432/lib/stm32l4xx_ll_utils.c diff --git a/targets/stm32l442/lib/stm32l4xx_ll_utils.h b/targets/stm32l432/lib/stm32l4xx_ll_utils.h similarity index 100% rename from targets/stm32l442/lib/stm32l4xx_ll_utils.h rename to targets/stm32l432/lib/stm32l4xx_ll_utils.h diff --git a/targets/stm32l442/lib/usbd/usbd_cdc.c b/targets/stm32l432/lib/usbd/usbd_cdc.c similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_cdc.c rename to targets/stm32l432/lib/usbd/usbd_cdc.c diff --git a/targets/stm32l442/lib/usbd/usbd_cdc.h b/targets/stm32l432/lib/usbd/usbd_cdc.h similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_cdc.h rename to targets/stm32l432/lib/usbd/usbd_cdc.h diff --git a/targets/stm32l442/lib/usbd/usbd_cdc_if.c b/targets/stm32l432/lib/usbd/usbd_cdc_if.c similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_cdc_if.c rename to targets/stm32l432/lib/usbd/usbd_cdc_if.c diff --git a/targets/stm32l442/lib/usbd/usbd_cdc_if.h b/targets/stm32l432/lib/usbd/usbd_cdc_if.h similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_cdc_if.h rename to targets/stm32l432/lib/usbd/usbd_cdc_if.h diff --git a/targets/stm32l442/lib/usbd/usbd_composite.c b/targets/stm32l432/lib/usbd/usbd_composite.c similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_composite.c rename to targets/stm32l432/lib/usbd/usbd_composite.c diff --git a/targets/stm32l442/lib/usbd/usbd_composite.h b/targets/stm32l432/lib/usbd/usbd_composite.h similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_composite.h rename to targets/stm32l432/lib/usbd/usbd_composite.h diff --git a/targets/stm32l442/lib/usbd/usbd_conf.c b/targets/stm32l432/lib/usbd/usbd_conf.c similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_conf.c rename to targets/stm32l432/lib/usbd/usbd_conf.c diff --git a/targets/stm32l442/lib/usbd/usbd_conf.h b/targets/stm32l432/lib/usbd/usbd_conf.h similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_conf.h rename to targets/stm32l432/lib/usbd/usbd_conf.h diff --git a/targets/stm32l442/lib/usbd/usbd_core.c b/targets/stm32l432/lib/usbd/usbd_core.c similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_core.c rename to targets/stm32l432/lib/usbd/usbd_core.c diff --git a/targets/stm32l442/lib/usbd/usbd_core.h b/targets/stm32l432/lib/usbd/usbd_core.h similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_core.h rename to targets/stm32l432/lib/usbd/usbd_core.h diff --git a/targets/stm32l442/lib/usbd/usbd_ctlreq.c b/targets/stm32l432/lib/usbd/usbd_ctlreq.c similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_ctlreq.c rename to targets/stm32l432/lib/usbd/usbd_ctlreq.c diff --git a/targets/stm32l442/lib/usbd/usbd_ctlreq.h b/targets/stm32l432/lib/usbd/usbd_ctlreq.h similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_ctlreq.h rename to targets/stm32l432/lib/usbd/usbd_ctlreq.h diff --git a/targets/stm32l442/lib/usbd/usbd_def.h b/targets/stm32l432/lib/usbd/usbd_def.h similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_def.h rename to targets/stm32l432/lib/usbd/usbd_def.h diff --git a/targets/stm32l442/lib/usbd/usbd_desc.c b/targets/stm32l432/lib/usbd/usbd_desc.c similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_desc.c rename to targets/stm32l432/lib/usbd/usbd_desc.c diff --git a/targets/stm32l442/lib/usbd/usbd_desc.h b/targets/stm32l432/lib/usbd/usbd_desc.h similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_desc.h rename to targets/stm32l432/lib/usbd/usbd_desc.h diff --git a/targets/stm32l442/lib/usbd/usbd_hid.c b/targets/stm32l432/lib/usbd/usbd_hid.c similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_hid.c rename to targets/stm32l432/lib/usbd/usbd_hid.c diff --git a/targets/stm32l442/lib/usbd/usbd_hid.h b/targets/stm32l432/lib/usbd/usbd_hid.h similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_hid.h rename to targets/stm32l432/lib/usbd/usbd_hid.h diff --git a/targets/stm32l442/lib/usbd/usbd_ioreq.c b/targets/stm32l432/lib/usbd/usbd_ioreq.c similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_ioreq.c rename to targets/stm32l432/lib/usbd/usbd_ioreq.c diff --git a/targets/stm32l442/lib/usbd/usbd_ioreq.h b/targets/stm32l432/lib/usbd/usbd_ioreq.h similarity index 100% rename from targets/stm32l442/lib/usbd/usbd_ioreq.h rename to targets/stm32l432/lib/usbd/usbd_ioreq.h diff --git a/targets/stm32l442/linker/bootloader_stm32l4xx.ld b/targets/stm32l432/linker/bootloader_stm32l4xx.ld similarity index 100% rename from targets/stm32l442/linker/bootloader_stm32l4xx.ld rename to targets/stm32l432/linker/bootloader_stm32l4xx.ld diff --git a/targets/stm32l442/linker/bootloader_stm32l4xx_extra.ld b/targets/stm32l432/linker/bootloader_stm32l4xx_extra.ld similarity index 100% rename from targets/stm32l442/linker/bootloader_stm32l4xx_extra.ld rename to targets/stm32l432/linker/bootloader_stm32l4xx_extra.ld diff --git a/targets/stm32l442/linker/stm32l4xx.ld b/targets/stm32l432/linker/stm32l4xx.ld similarity index 100% rename from targets/stm32l442/linker/stm32l4xx.ld rename to targets/stm32l432/linker/stm32l4xx.ld diff --git a/targets/stm32l442/linker/stm32l4xx_extra.ld b/targets/stm32l432/linker/stm32l4xx_extra.ld similarity index 100% rename from targets/stm32l442/linker/stm32l4xx_extra.ld rename to targets/stm32l432/linker/stm32l4xx_extra.ld diff --git a/targets/stm32l442/requirements.txt b/targets/stm32l432/requirements.txt similarity index 100% rename from targets/stm32l442/requirements.txt rename to targets/stm32l432/requirements.txt diff --git a/targets/stm32l442/src/app.h b/targets/stm32l432/src/app.h similarity index 100% rename from targets/stm32l442/src/app.h rename to targets/stm32l432/src/app.h diff --git a/targets/stm32l442/src/attestation.c b/targets/stm32l432/src/attestation.c similarity index 100% rename from targets/stm32l442/src/attestation.c rename to targets/stm32l432/src/attestation.c diff --git a/targets/stm32l442/src/cmsis/arm_common_tables.h b/targets/stm32l432/src/cmsis/arm_common_tables.h similarity index 100% rename from targets/stm32l442/src/cmsis/arm_common_tables.h rename to targets/stm32l432/src/cmsis/arm_common_tables.h diff --git a/targets/stm32l442/src/cmsis/arm_const_structs.h b/targets/stm32l432/src/cmsis/arm_const_structs.h similarity index 100% rename from targets/stm32l442/src/cmsis/arm_const_structs.h rename to targets/stm32l432/src/cmsis/arm_const_structs.h diff --git a/targets/stm32l442/src/cmsis/arm_math.h b/targets/stm32l432/src/cmsis/arm_math.h similarity index 100% rename from targets/stm32l442/src/cmsis/arm_math.h rename to targets/stm32l432/src/cmsis/arm_math.h diff --git a/targets/stm32l442/src/cmsis/cmsis_armcc.h b/targets/stm32l432/src/cmsis/cmsis_armcc.h similarity index 100% rename from targets/stm32l442/src/cmsis/cmsis_armcc.h rename to targets/stm32l432/src/cmsis/cmsis_armcc.h diff --git a/targets/stm32l442/src/cmsis/cmsis_armcc_V6.h b/targets/stm32l432/src/cmsis/cmsis_armcc_V6.h similarity index 100% rename from targets/stm32l442/src/cmsis/cmsis_armcc_V6.h rename to targets/stm32l432/src/cmsis/cmsis_armcc_V6.h diff --git a/targets/stm32l442/src/cmsis/cmsis_gcc.h b/targets/stm32l432/src/cmsis/cmsis_gcc.h similarity index 100% rename from targets/stm32l442/src/cmsis/cmsis_gcc.h rename to targets/stm32l432/src/cmsis/cmsis_gcc.h diff --git a/targets/stm32l442/src/cmsis/core_cm0.h b/targets/stm32l432/src/cmsis/core_cm0.h similarity index 100% rename from targets/stm32l442/src/cmsis/core_cm0.h rename to targets/stm32l432/src/cmsis/core_cm0.h diff --git a/targets/stm32l442/src/cmsis/core_cm0plus.h b/targets/stm32l432/src/cmsis/core_cm0plus.h similarity index 100% rename from targets/stm32l442/src/cmsis/core_cm0plus.h rename to targets/stm32l432/src/cmsis/core_cm0plus.h diff --git a/targets/stm32l442/src/cmsis/core_cm3.h b/targets/stm32l432/src/cmsis/core_cm3.h similarity index 100% rename from targets/stm32l442/src/cmsis/core_cm3.h rename to targets/stm32l432/src/cmsis/core_cm3.h diff --git a/targets/stm32l442/src/cmsis/core_cm4.h b/targets/stm32l432/src/cmsis/core_cm4.h similarity index 100% rename from targets/stm32l442/src/cmsis/core_cm4.h rename to targets/stm32l432/src/cmsis/core_cm4.h diff --git a/targets/stm32l442/src/cmsis/core_cm7.h b/targets/stm32l432/src/cmsis/core_cm7.h similarity index 100% rename from targets/stm32l442/src/cmsis/core_cm7.h rename to targets/stm32l432/src/cmsis/core_cm7.h diff --git a/targets/stm32l442/src/cmsis/core_cmFunc.h b/targets/stm32l432/src/cmsis/core_cmFunc.h similarity index 100% rename from targets/stm32l442/src/cmsis/core_cmFunc.h rename to targets/stm32l432/src/cmsis/core_cmFunc.h diff --git a/targets/stm32l442/src/cmsis/core_cmInstr.h b/targets/stm32l432/src/cmsis/core_cmInstr.h similarity index 100% rename from targets/stm32l442/src/cmsis/core_cmInstr.h rename to targets/stm32l432/src/cmsis/core_cmInstr.h diff --git a/targets/stm32l442/src/cmsis/core_cmSimd.h b/targets/stm32l432/src/cmsis/core_cmSimd.h similarity index 100% rename from targets/stm32l442/src/cmsis/core_cmSimd.h rename to targets/stm32l432/src/cmsis/core_cmSimd.h diff --git a/targets/stm32l442/src/cmsis/core_sc000.h b/targets/stm32l432/src/cmsis/core_sc000.h similarity index 100% rename from targets/stm32l442/src/cmsis/core_sc000.h rename to targets/stm32l432/src/cmsis/core_sc000.h diff --git a/targets/stm32l442/src/cmsis/core_sc300.h b/targets/stm32l432/src/cmsis/core_sc300.h similarity index 100% rename from targets/stm32l442/src/cmsis/core_sc300.h rename to targets/stm32l432/src/cmsis/core_sc300.h diff --git a/targets/stm32l442/src/cmsis/stm32l432xx.h b/targets/stm32l432/src/cmsis/stm32l432xx.h similarity index 100% rename from targets/stm32l442/src/cmsis/stm32l432xx.h rename to targets/stm32l432/src/cmsis/stm32l432xx.h diff --git a/targets/stm32l442/src/cmsis/stm32l442xx.h b/targets/stm32l432/src/cmsis/stm32l442xx.h similarity index 100% rename from targets/stm32l442/src/cmsis/stm32l442xx.h rename to targets/stm32l432/src/cmsis/stm32l442xx.h diff --git a/targets/stm32l442/src/cmsis/stm32l4xx.h b/targets/stm32l432/src/cmsis/stm32l4xx.h similarity index 100% rename from targets/stm32l442/src/cmsis/stm32l4xx.h rename to targets/stm32l432/src/cmsis/stm32l4xx.h diff --git a/targets/stm32l442/src/cmsis/system_stm32l4xx.h b/targets/stm32l432/src/cmsis/system_stm32l4xx.h similarity index 100% rename from targets/stm32l442/src/cmsis/system_stm32l4xx.h rename to targets/stm32l432/src/cmsis/system_stm32l4xx.h diff --git a/targets/stm32l442/src/crypto.c b/targets/stm32l432/src/crypto.c similarity index 100% rename from targets/stm32l442/src/crypto.c rename to targets/stm32l432/src/crypto.c diff --git a/targets/stm32l442/src/device.c b/targets/stm32l432/src/device.c similarity index 100% rename from targets/stm32l442/src/device.c rename to targets/stm32l432/src/device.c diff --git a/targets/stm32l442/src/fifo.c b/targets/stm32l432/src/fifo.c similarity index 100% rename from targets/stm32l442/src/fifo.c rename to targets/stm32l432/src/fifo.c diff --git a/targets/stm32l442/src/fifo.h b/targets/stm32l432/src/fifo.h similarity index 100% rename from targets/stm32l442/src/fifo.h rename to targets/stm32l432/src/fifo.h diff --git a/targets/stm32l442/src/flash.c b/targets/stm32l432/src/flash.c similarity index 100% rename from targets/stm32l442/src/flash.c rename to targets/stm32l432/src/flash.c diff --git a/targets/stm32l442/src/flash.h b/targets/stm32l432/src/flash.h similarity index 100% rename from targets/stm32l442/src/flash.h rename to targets/stm32l432/src/flash.h diff --git a/targets/stm32l442/src/init.c b/targets/stm32l432/src/init.c similarity index 100% rename from targets/stm32l442/src/init.c rename to targets/stm32l432/src/init.c diff --git a/targets/stm32l442/src/led.c b/targets/stm32l432/src/led.c similarity index 100% rename from targets/stm32l442/src/led.c rename to targets/stm32l432/src/led.c diff --git a/targets/stm32l442/src/led.h b/targets/stm32l432/src/led.h similarity index 100% rename from targets/stm32l442/src/led.h rename to targets/stm32l432/src/led.h diff --git a/targets/stm32l442/src/main.c b/targets/stm32l432/src/main.c similarity index 100% rename from targets/stm32l442/src/main.c rename to targets/stm32l432/src/main.c diff --git a/targets/stm32l442/src/memory_layout.h b/targets/stm32l432/src/memory_layout.h similarity index 100% rename from targets/stm32l442/src/memory_layout.h rename to targets/stm32l432/src/memory_layout.h diff --git a/targets/stm32l442/src/redirect.c b/targets/stm32l432/src/redirect.c similarity index 100% rename from targets/stm32l442/src/redirect.c rename to targets/stm32l432/src/redirect.c diff --git a/targets/stm32l442/src/rng.c b/targets/stm32l432/src/rng.c similarity index 100% rename from targets/stm32l442/src/rng.c rename to targets/stm32l432/src/rng.c diff --git a/targets/stm32l442/src/rng.h b/targets/stm32l432/src/rng.h similarity index 100% rename from targets/stm32l442/src/rng.h rename to targets/stm32l432/src/rng.h diff --git a/targets/stm32l442/src/script.ld b/targets/stm32l432/src/script.ld similarity index 100% rename from targets/stm32l442/src/script.ld rename to targets/stm32l432/src/script.ld diff --git a/targets/stm32l442/src/startup_stm32l432xx.s b/targets/stm32l432/src/startup_stm32l432xx.s similarity index 100% rename from targets/stm32l442/src/startup_stm32l432xx.s rename to targets/stm32l432/src/startup_stm32l432xx.s diff --git a/targets/stm32l442/src/system_stm32l4xx.c b/targets/stm32l432/src/system_stm32l4xx.c similarity index 100% rename from targets/stm32l442/src/system_stm32l4xx.c rename to targets/stm32l432/src/system_stm32l4xx.c