[STM32L432KC] Getting MicroPython on to an STM32L432KC?

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
dwculp
Posts: 12
Joined: Wed Jul 13, 2016 6:43 pm

[STM32L432KC] Getting MicroPython on to an STM32L432KC?

Post by dwculp » Fri May 14, 2021 2:09 am

I have been experimenting with a variety of Nucleo and Discovery boards and have been able to get MicroPython on to all of them except this little Nucelo L432KC board: https://www.st.com/en/evaluation-tools/ ... 432kc.html

On all the others I simply connect BOOT0 to 3.3v and use dfu-util under Linux to upload the .dfu file.

The problem is, this board doesnt seem to have an exposed BOOT0 pin. So, how do I get MicroPython on to it?

Thanks!
Last edited by dwculp on Fri May 14, 2021 1:27 pm, edited 1 time in total.

Online
User avatar
mattyt
Posts: 354
Joined: Mon Jan 23, 2017 6:39 am

Re: Getting MicroPython on to an STM32L432KC?

Post by mattyt » Fri May 14, 2021 11:48 am

I believe BOOT0 is exposed as a solder bridge on the underside of that board - "SB12". See UM1956 pg12.

dwculp
Posts: 12
Joined: Wed Jul 13, 2016 6:43 pm

Re: [STM32L432KC] Getting MicroPython on to an STM32L432KC?

Post by dwculp » Fri May 14, 2021 1:54 pm

I can see on my board that SB12 is bridged through a tiny SMT resistor. I can remove that resistor quite easily and unbridle the connection. If the resistor has to be put back in place though, I have no easy way to do it.

I will give it a try tonight though and see what happens!

chrismas9
Posts: 151
Joined: Wed Jun 25, 2014 10:07 am

Re: [STM32L432KC] Getting MicroPython on to an STM32L432KC?

Post by chrismas9 » Sat May 15, 2021 3:29 pm

I use the built in STLINK interface with stmcubeprog software. It doesn't need boot0 jumpered.

dwculp
Posts: 12
Joined: Wed Jul 13, 2016 6:43 pm

Re: [STM32L432KC] Getting MicroPython on to an STM32L432KC?

Post by dwculp » Wed May 19, 2021 2:18 am

chrismas9 wrote:
Sat May 15, 2021 3:29 pm
I use the built in STLINK interface with stmcubeprog software. It doesn't need boot0 jumpered.
I got it downloaded via the stmcubeprog software and can connect and pull up a REPL.

I cannot get the PYBOARD internal filesystem to show up so I can actually read and write .py files to it. Any help there?

Online
User avatar
mattyt
Posts: 354
Joined: Mon Jan 23, 2017 6:39 am

Re: [STM32L432KC] Getting MicroPython on to an STM32L432KC?

Post by mattyt » Wed May 19, 2021 3:13 am

The board definitions for the STM32L432KC disable the internal filesystem - though there is a small section allocated for a filesystem in the linker script.

256KB flash is large enough that you can carve out a chunk for a filesystem - but you'll need to change the board definitions to do so. The starting point would be to define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE as 1 instead of 0 in mpconfigboard.h (if you edit the file you can just remove that line since it defaults to 1 for the stm32 port).

That may be enough to get it to work though I'm afraid I don't have a board to test it on (can confirm that it builds cleanly).

Post Reply