Page 1 of 2

[STM32L432 - NUCLEO 32]

Posted: Fri Nov 23, 2018 7:41 pm
by mroussel
I have not found any ports to this Nucleo board STM32L432KC and i googled all over

the board in question:https://www.st.com/content/st_com/en/pr ... 432kc.html

is there something that is blocking or incompatible with micropython?

128k flash / 64 k ram / cpu clock @ 80MHz

what am i missing ?
this looks like a perfect fit for micropython so why no ports exist?

i am willing to do the port , i need to understand the possible pitfalls?

martin

Re: [STM32L432 - NUCLEO 32]

Posted: Fri Nov 23, 2018 8:34 pm
by dhylands
While you should be able to make micropython fit in 128K, it will be rather tight and you'll need to turn off lots of features including the filesystem to make things fit.

Re: [STM32L432 - NUCLEO 32]

Posted: Fri Nov 23, 2018 10:18 pm
by mroussel
David , (thanks for quick response)

good news after re checking the spec. I see that we have
256 KB Flash
64 KB SRAM

so double the flash as stated above

so then , correct me if I am wrong, this is a possible candidate for mPY?

I remember reading the porting guide somewhere , but that was a long time ago , can someone point me in the right direction

or if someone as done the port already please point me there

thanks

martin

Re: [STM32L432 - NUCLEO 32]

Posted: Tue Nov 27, 2018 5:22 pm
by boochow
This tiny board is cute. I got one for me today and have been trying to port uPy.
I made board configuration files and tried to build it then found that STM32L432 lacks some commonly used peripherals TIM3 and SPI2 so it seems that we have to modify some stm32 port sources.

Re: [STM32L432 - NUCLEO 32]

Posted: Thu Nov 29, 2018 3:20 pm
by boochow
Finally, I have succeeded to got REPL.
I referred the F091 settings to determine which feature to be enabled and the file size of firmware.bin became 235024 bytes (with no flash file system).

Code: Select all

MicroPython v1.9.4-691-g4f25a8b-dirty on 2018-11-30; NUCLEO-L432KC with STM32L432KC
Type "help()" for more information.
>>> help('modules')
__main__          heapq             re                ujson
_onewire          io                select            umachine
array             json              struct            uos
binascii          lcd160cr          sys               urandom
builtins          lcd160cr_test     time              ure
cmath             machine           ubinascii         uselect
collections       math              ucollections      ustruct
dht               micropython       uctypes           utime
errno             onewire           uerrno            utimeq
framebuf          os                uhashlib          uzlib
gc                pyb               uheapq            zlib
hashlib           random            uio
Plus any modules on the filesystem
>>> import gc
>>> gc.mem_free()
39536
>>>

Re: [STM32L432 - NUCLEO 32]

Posted: Fri Nov 30, 2018 1:02 am
by shaoziyang
It is great!

Re: [STM32L432 - NUCLEO 32]

Posted: Fri Nov 30, 2018 4:45 am
by mroussel
Great indeed

(I am new to the micropython code base)

Boochow
your bin is 235024 bytes out of 256K of flash so that leaves ~ 21 K free in on board flash

21k is not much to add a file system (data + driver)

Boochow do you think a flash file system DRIVER could be added with the place left in on board flash?

We could add a quad spi serial eeprom lets say 2 GB for the file system data

picture showing what i propose
small.png
small.png (128.94 KiB) Viewed 9262 times
It would be a PCB that would slip on to the pins on top side of nucleo-32 l432
and would reserve pins PA2-PA3-PA6-PA7-PB0-PB1 for QSPI interface , the rest of the pins would stay as is

does MPY support QSPI?

Do you use DFU or STlink to load firmware?

Does the REPL use the STlink Virtual com port?

regards

Martin

Re: [STM32L432 - NUCLEO 32]

Posted: Fri Nov 30, 2018 4:52 am
by mroussel
the STM32L432 - NUCLEO 32 board goes for ~25$

FYI just found this (no price announced)
have a look at this board coming soon it is a micro-MONSTER
viewtopic.php?f=19&t=4957&hilit=qspi

Re: [STM32L432 - NUCLEO 32]

Posted: Fri Nov 30, 2018 11:56 am
by boochow
mroussel wrote:
Fri Nov 30, 2018 4:45 am
Boochow do you think a flash file system DRIVER could be added with the place left in on board flash?

does MPY support QSPI?

Do you use DFU or STlink to load firmware?

Does the REPL use the STlink Virtual com port?
mroussel,

Enabling VfsFat module results 248952 bytes of firmware.bin, which fits in the L432's flash.

I don't know about QSPI but it seems that STM32 port provides accessing QSPI-connected internal flash but no support for QSPI peripheral.
Maybe you can use SPI to connect SD card for an external storage.
Or, you can add your own module for block device using QSPI connected serial EEPROM.

I am using STMicro's ST-Link Utility to flash the firmware.

REPL is routed to USART2, which is connected to STLink VCP.

Re: [STM32L432 - NUCLEO 32]

Posted: Sat Dec 01, 2018 2:44 am
by boochow