Build micropython under Atmel studio

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
learnerforlife
Posts: 13
Joined: Mon Sep 17, 2018 5:38 am

Build micropython under Atmel studio

Post by learnerforlife » Wed Oct 03, 2018 10:59 am

Hi,
I was trying to integrate micropython into my existing project which which is on Atmel studio. I am trying to make it build from within the Atmel studio but I can't get past this error:

C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\cp.exe: invalid option -- e
Try `C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\cp.exe --help' for more information.

This is coming from the following line in mkrules.mk

Code: Select all

vpath %.c . $(TOP)
$(BUILD)/%.o: %.c
	$(call compile_c)
compile_c is defined as:

Code: Select all

$(ECHO) "CC $<"
$(Q)$(CC) $(CFLAGS) -c -MD -o $@ $<
@# The following fixes the dependency file.
@# See http://make.paulandlesley.org/autodep.html for details.
@# Regex adjusted from the above to play better with Windows paths, etc.
@$(CP) $(@:.o=.d) $(@:.o=.P); \
  $(SED) -e 's/#.*//' -e 's/^.*:  *//' -e 's/ *\\$$//' \
      -e '/^$$/ d' -e 's/$$/ :/' < $(@:.o=.d) >> $(@:.o=.P); \
  $(RM) -f $(@:.o=.d)
I assume "-e" is intended for sed and found there was no sed binary but even after getting the sed binary the same error persists. I specified all the binaries in mkenv.mk as following:

Code: Select all

RM = "C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\rm.exe"
ECHO = @echo
CP = "C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\cp.exe"
MKDIR = "C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\mkdir.exe"
SED = "C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\sed.exe"
PYTHON = python


Can anyone familiar with build process please point out what I am missing?

stijn
Posts: 278
Joined: Thu Apr 24, 2014 9:13 am

Re: Build micropython under Atmel studio

Post by stijn » Wed Oct 03, 2018 11:56 am

Whether SED is defined or not, cp should never see that -e because it's part of a seperate command. So I assume whatever build system/shell you use is ignoring the semicolon used to seperate the commands. Wouldn't know a proper solution though, sorry.

learnerforlife
Posts: 13
Joined: Mon Sep 17, 2018 5:38 am

Re: Build micropython under Atmel studio

Post by learnerforlife » Wed Oct 03, 2018 12:09 pm

The shell is default windows cmd.exe, and as far as I know it uses semicolon as command separator.
I'll try and see if I can use some other shell.

EDIT- Sorry my bad, seems & is the command separator in windows command prompt.

stijn
Posts: 278
Joined: Thu Apr 24, 2014 9:13 am

Re: Build micropython under Atmel studio

Post by stijn » Wed Oct 03, 2018 1:12 pm

Well this is what cmd.exe does:

Code: Select all

> echo a
a

> echo a; echo b
a; echo b

EDIT posted this right when you were editing the post I guess :)

learnerforlife
Posts: 13
Joined: Mon Sep 17, 2018 5:38 am

Re: Build micropython under Atmel studio

Post by learnerforlife » Fri Oct 05, 2018 5:24 am

I'm sure someone would have already tried it but just in case someone else is looking to integrate micropython in their codebase, it was far easier to build a static library from micropython source and just link it in you own code.

Post Reply