andysworkshop / stm32plus

The C++ library for the STM32 F0, F100, F103, F107 and F4 microcontrollers
http://www.andybrown.me.uk
Other
745 stars 224 forks source link

ERROR - build stm32plus inside the terminal #226

Open FiiHaa opened 4 years ago

FiiHaa commented 4 years ago

Hi all,

I am trying to use stm32plus library, but I am failing in building the library inside the terminal. I follow steps
as is described in: https://andybrown.me.uk/2015/03/22/stm32dev-windows/

I am running Ubuntu. Thx a lot for help.

terminal output:

$ sudo git clone https://github.com/andysworkshop/stm32plus.git Cloning into 'stm32plus'... remote: Enumerating objects: 17, done. remote: Counting objects: 100% (17/17), done. remote: Compressing objects: 100% (16/16), done. remote: Total 21028 (delta 2), reused 5 (delta 1), pack-reused 21011 Receiving objects: 100% (21028/21028), 21.43 MiB | 1.68 MiB/s, done. Resolving deltas: 100% (14160/14160), done. $ :~/src$ cd stm32plus/ $ :~/src/stm32plus$ scons mode=debug mcu=f407 hsi=8000000 -j12 install INSTALLDIR=~/install/stm32plus scons: Reading SConscript files ... stm32plus build version is 040100 AttributeError: 'function' object has no attribute 'func_code': File "/home/fiihaa/src/stm32plus/SConstruct", line 267: SConscript("examples/SConscript",exports=["mode","mcu","osc","osc_type","osc_def","env","systemprefix","INSTALLDIR","INSTALLDIR_PREFIX","VERSION"]) File "/usr/lib/scons/SCons/Script/SConscript.py", line 660: return method(*args, kw) File "/usr/lib/scons/SCons/Script/SConscript.py", line 597: return _SConscript(self.fs, *files, *subst_kw) File "/usr/lib/scons/SCons/Script/SConscript.py", line 286: exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals) File "/home/fiihaa/src/stm32plus/examples/SConscript", line 17: SConscript(example+"/SConscript", File "/usr/lib/scons/SCons/Script/SConscript.py", line 660: return method(args, kw) File "/usr/lib/scons/SCons/Script/SConscript.py", line 597: return _SConscript(self.fs, *files, **subst_kw) File "/usr/lib/scons/SCons/Script/SConscript.py", line 286: exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals) File "/home/fiihaa/src/stm32plus/examples/adc_analog_watchdog/SConscript", line 18: sconscriptFile=(lambda x:x).func_code.co_filename

kmani314 commented 4 years ago

I solved this by downgrading to scons v3.0. It seems like some features have been deprecated in newer releases, so downgrading to a version released around when the install guide was written fixed it for me.

jcw commented 4 years ago

See #225 - a batch edit (of some 90+ files) solves this, then it works with SCons 4.0.1.