[NUCLEO-L432KC] MPY: can't mount flash

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
LAurent_B
Posts: 5
Joined: Sun Apr 03, 2016 3:15 pm

[NUCLEO-L432KC] MPY: can't mount flash

Post by LAurent_B » Tue Sep 14, 2021 11:30 am

Hello,

With a nucleo board L432KC and the micropython v1.17 the message following
message is promt at boot time.

Code: Select all

>>> MPY: can't mount flash
MicroPython v1.17 on 2021-09-14; NUCLEO-L432KC with STM32L432KC
and

Code: Select all

>>> import os
>>> os.listdir()
[]
>>> import sys 
>>> sys.path
['']

This is the same for previous releases : 1.17 / 1.16 / 1.15
For older releases, no message but

Code: Select all

>>> import os
>>> os.listdir()
[]

>>> import sys 
>>> sys.path
['']
For comparaison, on an other nucleoboard :

Code: Select all

>>> MicroPython v1.13-103-gb137d064e on 2020-10-09; NUCLEO-F401RE with STM32F401xE
Type "help()" for more information.
>>> import os
>>> os.listdir()
['boot.py', 'xxxxxx.py', 'xxxxx.py']
>>> import sys
>>> sys.path
['', '/flash', '/flash/lib']
>>>
Could someone help me to understand what's wrong ?
Thanks in advance for help

The board is flashed like that :

Code: Select all

git clone https://github.com/micropython/micropython.git
cd micropython
git submodule update --init
make -C mpy-cross
cd ports/stm32
git checkout v1.17
st-flash reset
st-flash erase
make BOARD=NUCLEO_L432KC deploy-stlink
On this computer :
5.11.0-34-generic / #36~20.04.1-Ubuntu / x86_64
st-flash 1.6.0

bc-109
Posts: 1
Joined: Sun Nov 28, 2021 7:54 pm

Re: [NUCLEO-L432KC] MPY: can't mount flash

Post by bc-109 » Sun Nov 28, 2021 8:01 pm

Hi,

The following page talks about flash filesystems :
https://docs.micropython.org/en/latest/ ... ystem.html

Anyway, it seems the only filesystem available on STM32L432 is LittleFS v1 (probably due to memory constraints on that tiny board).

Then, here's how I solved the problem :

Code: Select all

import os, pyb
os.VfsLfs1.mkfs(pyb.Flash(start=0))
os.mount(pyb.Flash(start=0), '/flash')
os.chdir('/flash')
Kind regards.

LAurent_B
Posts: 5
Joined: Sun Apr 03, 2016 3:15 pm

Re: [NUCLEO-L432KC] MPY: can't mount flash

Post by LAurent_B » Mon Nov 29, 2021 12:26 pm

Hello,

That's works for me
Thanks for help.

Post Reply