Closed snoremac closed 6 years ago
What was the command line you issued? IIRC you may likely need to supply the -m
example: run_avr -m atmega168 -f 2000000 someromname.elf
A command of that form gives me:
$ simavr -m atmega328 -f 16000000L test.elf
Loaded 10482 .text Loaded 580 .data avr_make_mcu_by_name: AVR 'atmega328' not known simavr: AVR 'atmega328' not known
First I ask for you to see to it that you have the latest commits...
RECOMPILE & TEST. Each time do a clean make to help rule out and residual data contaminating the run.
After that make sure CONFIG_SIMAVR_TRACE is disabled... in 'Makefile.common' I believe. Then in sim_elf.h? Find and disable ELF_SYMBOLS... Defining ELF_SYMBOLS 0 above the block should do the trick.
RECOMPILE & TEST.
Get back to me with the results.
Hi,
I got the exact same issue with simavr (using commit 4a297c69463eeba8646c6cee5b353a0b36995b45).
Problem was that CONFIG_CORES was not set. After hacking makefile to define it in sim_core_decl.h, everything worked fine. But this macro would not make sense.
Actually, it looks like the guilty guy is some script you use in the makefile to build it
Here is sim_core_decl.h generated on my mac
extern avr_kind_t mega48;
while your code expects
simavr/sim_core_config.h:#define CONFIG_MEGA48 1
Here is a small patch to solve this, that proved to work (in sime_core_decl.h target)
Question is: is it OSX shell that makes upper incorrect? is this path valid? Any feedback appreciated.
Could you post the badly generated file here? it works on my machine, it's rather bizarre...
// Autogenerated do not edit
extern avr_kind_t usb162;
extern avr_kind_t mega128;
extern avr_kind_t mega1280;
extern avr_kind_t mega1281;
extern avr_kind_t mega164;
extern avr_kind_t mega168;
extern avr_kind_t mega324;
extern avr_kind_t mega328;
extern avr_kind_t mega48;
extern avr_kind_t mega644;
extern avr_kind_t mega8;
extern avr_kind_t mega88;
extern avr_kind_t tiny13;
extern avr_kind_t tiny2313;
extern avr_kind_t tiny24;
extern avr_kind_t tiny25;
extern avr_kind_t tiny44;
extern avr_kind_t tiny45;
extern avr_kind_t tiny84;
extern avr_kind_t tiny85;
extern avr_kind_t * avr_kind[];
avr_kind_t * avr_kind[] = {
&usb162,
&mega128,
&mega1280,
&mega1281,
&mega164,
&mega168,
&mega324,
&mega328,
&mega48,
&mega644,
&mega8,
&mega88,
&tiny13,
&tiny2313,
&tiny24,
&tiny25,
&tiny44,
&tiny45,
&tiny84,
&tiny85,
NULL
};
As explained, the CONFIGCORES//SIM<...> is wrong (AFAICT)
Note I just test with CentOS 6, bash as a shell, and it works as you expect it. (Well, I have to import Arduino and tweak the makefiles since CentOS has an old avr-gcc, but its another story)
For the records, I also have make 3.8.1 on the both OS X and Centos 6
OS X is *BSD based whereas CentOS that I can tell is mainstream Linux... Don't know how it still stands but back at 10.3.x and earlier I spent a lot of time tweaking makefiles, source and even recompiling parts of the system to make things compile... Yes you can compare but not necessarily think it to be equal. I am hoping you know that already but putting it out there if you don't.
Somebody else already commented above about having issues going from 10.6 to 10.8... What OS X version you using? buserror?
Using debian here... make 3.81... so I don't think that is an issue... Shell?
it's definitely not a make problem; I use bash built in string substitution in the expression, but I'm pretty sure that expression has been there fro a long time too. It's entirely bizare, it's like they don't have the 'real' bash?
Almost, they manage to have a bash version older than CentSO 6 ;) See OS X 10.8.3 macbookair-hugues-w-r% uname -a Darwin macbookair-hugues.local 12.4.0 Darwin Kernel Version 12.4.0: Wed May 1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64 macbookair-hugues-w-r% bash --version GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12) Copyright (C) 2007 Free Software Foundation, Inc.
CentOS 6.3
[hugues@localhost]~% uname -a Linux localhost.localdomain 2.6.32-358.18.1.el6.x86_64 #1 SMP Wed Aug 28 17:19:38 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux [hugues@localhost]~% bash --version GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu) Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
I'll try with bash from Mac Ports and report, probably later this week
Just a reminder this issue is still present on OS X 10.9:
$ uname -a
Darwin Maiz.local 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
$ bash --version
GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)
Copyright (C) 2007 Free Software Foundation, Inc.
Yeah, I am still seeing the issue as well. The suggested change still works on 10.9, but I don't have a linux box to check if the change is backwards-compatible. In simavr/Makefile:
@@ -189,7 +189,7 @@
for core in $$(grep -r avr_kind_t cores/|awk -F '[ :]' '{print $$1 "=" $$3;}') ; do \
file=$${core/=*}; global=$${core/*=}; \
upper=$${file/cores\/sim_}; upper=$${upper/.c}; \
- upper=$$(echo $$upper|tr '[a-z]' '[A-Z]'); \
+ upper=$$(echo $$global|tr '[a-z]' '[A-Z]'); \
decl+="#if CONFIG_$$upper\nextern avr_kind_t $$global;\n#endif\n"; \
array+="#if CONFIG_$$upper\n\t&$$global,\n#endif\n"; \
done ; \
I had the same problem on MacOS 10.8.5. The above Makefile change worked for me. Thanks.
I've had this problem on Arch Linux with the zsh
shell.
$ uname -a
Linux dylan-pc 4.11.7-1-ARCH #1 SMP PREEMPT Sat Jun 24 09:07:09 CEST 2017 x86_64 GNU/Linux
The fix also worked for me.
Solved long ago
Hi,
Used simavr about 12 months ago when I was running 10.6 (Snow Leopard) and found it really useful.
Doing some arduino stuff again on 10.8 (Mountain Lion), but when I compile and execute run_avr I get:
(i.e. no AVR cores supported).
I've checked out sim_core_decl.h and related files and all the avr kinds are declared. Can't find anything obviously missing.
I did tweak Makefile.common a bit for my avr-gcc toolchain, but everything compiles fine and the tests pass, so I'm pretty sure I got it right.
Simavr revision 4e64e8b, compiling with Apple clang 4.1.
Any advice appreciated.
thanks,
Cam