Change boot.py on firmware

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
lucapearce
Posts: 1
Joined: Wed Jul 31, 2019 7:37 am

Change boot.py on firmware

Post by lucapearce » Wed Jul 31, 2019 7:38 am

Hello guys. How to change the boot.py file sent when giving the MAKE. I want to send a program ready at the moment of passing the firmware.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Change boot.py on firmware

Post by jimmo » Wed Jul 31, 2019 9:02 am

The easiest way to do this is probably to make boot.py a frozen module in your firmware. I'm not sure if all ports support this though. Which board are you using?

The other option is to build a filesystem into your firmware -- see viewtopic.php?f=16&t=6677&p=38028 for some hints.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Change boot.py on firmware

Post by jimmo » Wed Jul 31, 2019 9:05 am

I guess another even easier option is to add another target to the makefile to use "pyboard.py -f cp" to copy the file over the UART once the firmware finishes flashing.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Change boot.py on firmware

Post by jimmo » Wed Jul 31, 2019 9:06 am

Or (sorry, last one), find the code that generates the default boot.py and modify that.

Post Reply