Custom Firmware on Pyboard with Micropython Makefiles

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
giacomoalbe
Posts: 9
Joined: Thu Dec 22, 2016 10:15 pm

Custom Firmware on Pyboard with Micropython Makefiles

Post by giacomoalbe » Thu Nov 30, 2017 11:58 am

Hi all guys!

I'm a very happy Pyboard user!

Btw, I need to try (at least) to program the pyboard (which has an STM32F4) with a custom firmware written in C, since we have strict requirements on timing for an automotive application we are developing right now.

My main develoment environment is Linux, and my workflow heavily depens on CLI, so I'm interested in using the Makefile you provide togheter with the Micropython repo.

My question is: how can I modify the project in order to create my custom firmware and still use the tools you provide with Micropython for compiling, linking and flashing? I tried to compile some dummy projects (like the blinky one I found there) and to use the solution proposed at the beginning of this thread for .dfu files generation from .isr_routine and .text section of the bin file but with no success.

The pyboard doesn't seem to respond, or to change its behaviour. I've also tried to delve into the makefiles of the micropython repo in order to find what to remove in order to get my firmware loaded, but with no luck (it is something I'm not really able to do myself, given that I'm not really an expert in embedded programming and in makefiles too, even if I like them very much, to me they're very clever).

I think it is possible to do that, but I need some help in getting this thing done on the pyboard.

Also, it would be nice to find a way to also debug a running pyboard (with a custom firmware too) by using GDB or any similar debugger through the USB serial connection. I don't know anything about the feasibility of this solution, do you?

So if you can provide any hints, it would be undoubtedly helpful!

In the end if this would be possibile, I'd like to write some documentation in the wiki in order to make this useful thing available for others, too!

Thank you very much!
Giacomo

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: Custom Firmware on Pyboard with Micropython Makefiles

Post by SpotlightKid » Mon Dec 04, 2017 11:14 pm

I'm struggling to understand what it is exactly that you are after.

Am I correct in understanding that you are trying to use the Makefiles from the micropython stm32 port to build and deploy your own firmware, which is otherwise independent from the Micropython code?

Why don't you use one of the many examples on how to use STM32 Cube on the web as a project template? Or maybe libopencm3 or mbed are worth a look too?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Custom Firmware on Pyboard with Micropython Makefiles

Post by dhylands » Tue Dec 05, 2017 12:41 am

You can debug over JTAG/SWD using a variety of JTAG debuggers.

I picked up a Black Magic Probe, and I've done a board definition file for the 1Bitsy which is an example of one board which can easily connect via JTAG.

Post Reply