Good work flow methods

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
TheRegnirps
Posts: 8
Joined: Thu Feb 13, 2014 6:20 am

Good work flow methods

Post by TheRegnirps » Mon Sep 22, 2014 6:19 pm

I'm looking for input on an "optimal" work flow for development with Debian or Mac host. IDE's? Easiest way to edit and test code?

My first attempts involved moving SD cards back and forth and some testing from command line. This is rather slow and awkward. I use the pyboard and ST Discovery boards plus some with Stellaris launchpads.

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

Re: Good work flow methods

Post by dhylands » Mon Sep 22, 2014 6:44 pm

For stuff which doesn't need specific features of the pyboard, I tend to test out things using the unix build of micropython.

For things which need the pyboard, then I usually do something along the following:
  • edit file on my local computer
  • copy file to the pyboard via USB Storage
  • in the pyboard REPL, Press Control-D
  • import my test script which may then use the other scripts
when things don't work, then I'll usually explore with the REPL to figure out what I did wrong, and then repeat the whole process

I'm currently running ubuntu 14.04 or Linux Mint 13 depending on which computer I'm using.

nekomatic
Posts: 37
Joined: Thu May 08, 2014 9:31 pm

Re: Good work flow methods

Post by nekomatic » Tue Sep 23, 2014 7:33 am

Do you mean you've got Micropython up and running on the Stellaris? Any hints and tips if so, please?

TheRegnirps
Posts: 8
Joined: Thu Feb 13, 2014 6:20 am

Re: Good work flow methods

Post by TheRegnirps » Fri Sep 26, 2014 12:05 am

No, I intended to see what can be done with several Stellaris Launchpad kits I have. So, I have not looked yet to see if anyone has done it.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Good work flow methods

Post by pythoncoder » Fri Sep 26, 2014 8:05 am

dhylands wrote: ...
[*]copy file to the pyboard via USB Storage
...
I do the same as you but I've found it necessary to issue sync under Linux after performing this step otherwise on occasion the file on the target doesn't get updated.

Regards, Pete
Peter Hinch
Index to my micropython libraries.

fma
Posts: 164
Joined: Wed Jan 01, 2014 5:38 pm
Location: France

Re: Good work flow methods

Post by fma » Fri Sep 26, 2014 8:14 am

I think it is possible to force the 'sync' option when mounting usb storage devices...
Frédéric

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

Re: Good work flow methods

Post by dhylands » Fri Sep 26, 2014 3:24 pm

For me, this seems to be have been done by the OS:

Code: Select all

/dev/sdc1 on /media/dhylands/4421-0023 type vfat (rw,nosuid,nodev,uid=35029,gid=1001,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
I think that the "flush" option is the one you want. From: http://linux.die.net/man/8/mount

Code: Select all

flush
    If set, the filesystem will try to flush to disk more early than normal. Not set by default. 
Two of my machines use ubuntu 14.04 and this one uses Linux Mint 13, and they all seem to set flush on flash drives.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Good work flow methods

Post by pythoncoder » Mon Sep 29, 2014 8:50 am

Thanks for that. Now fixed (Debian, in fstab).

Regards, Pete
Peter Hinch
Index to my micropython libraries.

mosi
Posts: 28
Joined: Tue Oct 07, 2014 12:07 am

Re: Good work flow methods

Post by mosi » Thu Oct 09, 2014 7:07 pm

My pyboard v3 with current code causes the following:

REPL "freezes" when in minicom serial terminal on mac and becomes unresponsive.
It happens randomly, from 1 minute to 3 hours range.
It happens in all serial console tools.

The only solution is to close the serial port and re-open, sometimes hard reset is needed.
I tested two boards to exclude hardware problems, both behave the same.

How can I best debug in the C code of repl?

I can solder, use the SWD or JLINK with STlink v2, however I only did it on Keil so far, which works seamlessly.
I have a working openOCD setup as well on Mac.

How do you debug? Where can I turn on/off debugging REPL output?
All ideas are welcome.

blmorris
Posts: 348
Joined: Fri May 02, 2014 3:43 pm
Location: Massachusetts, USA

Re: Good work flow methods

Post by blmorris » Thu Oct 09, 2014 7:17 pm

@mosi - you may want to try 'screen' instead of minicom on the mac; I started out using minicom but found that screen is just generally easier to use, and probably more stable as well.
Are you really using v3 (the early kickstarter reward version)? You may want to check that you are using the right firmware image for your board. (You did mention that your firmware is current.)

Using screen doesn't require sudo on my machine, simply enter 'screen /dev/tty.usbmodem<your device #>' and the REPL will come up.
To exit type Control-A then k, and hit y to confirm you want to exit.

-Bryan

Post Reply