Page 1 of 1

Impossible to upload, save or create program on stm32l432kc

Posted: Fri Apr 12, 2019 12:20 pm
by gbergero
Hi,
Im pretty new to the micropython environment and ive managed to flash my stm32 using st-link stm32 utility and an .hex file. I can use putty and write micropython code and it seems to be working fine.
Here's the issue: I want to run a program on the device that I can save on it (like "main.py" or "boot.py" but I can't figure out how to do it. The device doesn't seem to have any file in its memory because when I write "os.listdir()" i get "[]". Ive tryed using ampy or rshell to upload a file that says "hello world" but I get an error everytime, I tryed creating a file on the stm32 using the command " os.mkdir('test.py')" or "os.open('test.py','w')" but that failed too. I read somewhere that there might be no file system on the device due to its small memory size. If that is the case, how do i upload or save a program on the board?
Thanks in advance

Re: Impossible to upload, save or create program on stm32l432kc

Posted: Fri Apr 12, 2019 3:16 pm
by dhylands
The NUCLEO_L432KC board doesn't have an internal file system. All python code needs to be included in the firmware as frozen modules.

Re: Impossible to upload, save or create program on stm32l432kc

Posted: Fri Apr 12, 2019 3:39 pm
by gbergero
Hi Dave,
So is there anyway to edit the existing frozen module without having to re make the hex file I used to flash the device? The hex file was given to me by a co-worker so im not sure how he made it.
Thank you

Re: Impossible to upload, save or create program on stm32l432kc

Posted: Fri Apr 12, 2019 6:43 pm
by dhylands
Unfortunately - no. You'll need to rebuild the firmware with your new frozen module.

What I would probably do in a case like this is to pick a part with a larger flash and do your development on that, and then deploy on the smaller device, especially while you're learning. The NUCLEO-L476RG is also supported by micropython and it has lots of flash for an internal filesystem.

Re: Impossible to upload, save or create program on stm32l432kc

Posted: Mon Apr 15, 2019 1:13 pm
by gbergero
Hi Dave, thanks for your previous response.
I would love to try the NUCLEO-L476RG but I would much prefer to do it straight up with the stm32l432kc because time is an issue in my situation. Do you have any tips on how to build my own firmware? I have no clue where to start as this is all pretty new to me.
Thank you

Re: Impossible to upload, save or create program on stm32l432kc

Posted: Mon Apr 15, 2019 2:33 pm
by dhylands
What platform will you be building on? Linux is probably the easiest.

Re: Impossible to upload, save or create program on stm32l432kc

Posted: Mon Apr 15, 2019 2:33 pm
by gbergero
Windows 10 but i could use a raspberry pi with raspbian installed on it if needed.

Update : I managed to build the source code using this tutorial : http://hardytek.com/flashing-micropytho ... -nucleo/ and inserting the correct board name.