Hey everyone,
I recently got a STM32 Nucleo-L073RZ board and want to run MicroPython on it.
I am using rshell and repl does work, but when I enter for example 'cp boot.py /pyboard' I get the error message: "timed out or error in transfer to remote: b'F'". Does someone of you have an idea, how I can fix this?
Here some further details:
I am using Manjaro Linux.
I installed micropython by cloning the micropython git, making the unix submodule and running the "$ make BOARD=NUCLEO_L073RZ deploy-stlink" command. Since this resulted in the error message "ValueError: No DFU device found" I installed the 'firmware.bin' file using STM32CubeProgrammer.
STM32 Nucleo-L073RZ uploading files doesn't work
Re: STM32 Nucleo-L073RZ uploading files doesn't work
The NUCLEO-L073 only has 192K of flash, so there is only room for a stripped down version of MicroPython and no room for a filesystem.
So all of the code you want to run needs to be included as frozen files.
So all of the code you want to run needs to be included as frozen files.
Re: STM32 Nucleo-L073RZ uploading files doesn't work
Thanks a lot for this fast answer!
Can you tell me where to put my boot.py file? I tried copying it into micropython/ports/stm32/ and then run 'make BOARD=NUCLEO_L073RZ', but this didn't seem to work.
Can you tell me where to put my boot.py file? I tried copying it into micropython/ports/stm32/ and then run 'make BOARD=NUCLEO_L073RZ', but this didn't seem to work.
Re: STM32 Nucleo-L073RZ uploading files doesn't work
You can
1. put the file into a directory of your choice like my_modules in the stm32 directory
2. create a manifest.py file with the content:
freeze("$(PORT_DIR)/my_modules")
The argument of freeze() is the path of the directory containing your modules.
3. Build you binary with
make BOARD=NUCLEO_L073RZ FROZEN_MANIFEST=<path to manifest.py>
1. put the file into a directory of your choice like my_modules in the stm32 directory
2. create a manifest.py file with the content:
freeze("$(PORT_DIR)/my_modules")
The argument of freeze() is the path of the directory containing your modules.
3. Build you binary with
make BOARD=NUCLEO_L073RZ FROZEN_MANIFEST=<path to manifest.py>
Re: STM32 Nucleo-L073RZ uploading files doesn't work
Thanks for the help Roberthh!
Now I created a my_modules folder and created a function test.py, which just prints out some text.
After building the binary I can find a file called "frozen_content.c" in my "build-NUCLEO_L073RZ" folder. As I understood the docs I should be able to import the function by calling "import test" in the REPL. However that resultet in an ImportError: no module named 'test'.
Do you have any ideas how to fix that?
And is there a way to automatically start a program at boot?
Now I created a my_modules folder and created a function test.py, which just prints out some text.
After building the binary I can find a file called "frozen_content.c" in my "build-NUCLEO_L073RZ" folder. As I understood the docs I should be able to import the function by calling "import test" in the REPL. However that resultet in an ImportError: no module named 'test'.
Do you have any ideas how to fix that?
And is there a way to automatically start a program at boot?