From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,FREEMAIL_REPLY autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fcd0ac136c3a2795 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Warren Newsgroups: comp.lang.ada Subject: Re: USB Boarduino on AVR-Ada Tutorial Date: Fri, 27 Aug 2010 12:51:26 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <4d1d662b-f476-41e4-938c-0564ad90d74e@d17g2000yqb.googlegroups.com> <8bfbd728-638e-4d27-b52e-0107c6b2847d@i31g2000yqm.googlegroups.com> <1db702dd-3289-4e76-98fe-08ab4bae38e1@v8g2000yqe.googlegroups.com> Injection-Date: Fri, 27 Aug 2010 12:51:26 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="9f8M0iN5t54V+4DF/iqO8g"; logging-data="15400"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18A8p9qyzYZqeSraZ51TMwR/bCNetp1MCU=" User-Agent: Xnews/5.04.25 X-Face: &6@]C2>ZS=NM|HE-^zWuryN#Z/2_.s9E|G&~DRi|sav9{E}XQJb*\_>=a5"q]\%A;5}LKP][1mA{gZ,Q!j Cancel-Lock: sha1:dOoSQioH9ASQFgiaMAs5pCuNbeM= Xref: g2news1.google.com comp.lang.ada:13779 Date: 2010-08-27T12:51:26+00:00 List-Id: b.robinson.jp@gmail.com expounded in news:1db702dd-3289-4e76-98fe- 08ab4bae38e1@v8g2000yqe.googlegroups.com: >>.. I was able to > compile the project and generate my binary. The LED stays lit and > does not flash, but at least I have something to work on now. :) Check that you have exactly the right part specified for compiling the unit. What happens is that the object code may be compatible, but the configured SRAM size is not. This is critical in the main program, where it initializes the stack pointer (SP) at startup. I ran into this when building for atmega328, which supports a 2K SRAM. I was using an atmega168 with a 1K SRAM instead, but is otherwise completely compatible with the 328. So everything would work until you _called_ something. The called routine might work (if it needed no local vars or kept them in registers). But when it would try to return to the calling program, it would go west. Building for the 328 sets the SP 1K higher than the 168 address wise, where there is no SRAM. So a return would go to address 16#FFFF#, since FF is what "no memory" returns. Compiling _libraries_ for a bigger part is ok, since it doesn't have to initialize the SP. But the main program has to be "right on" in this respect. In your case, I suspect that the delay routine is not returning properly. This strongly hints at the stack size problem. So check that MCU= parameter (I had to get a magnifying glass out to read my chip). Warren