Need help on Makefiles

View: New views
4 Messages — Rating Filter:   Alert me  

Need help on Makefiles

by uprinz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

I did a quick integration of openocd into the Makefiles to use "make
burn" with that tool and an openocd-usb dongle too.

But my script is fixed to a CPU and the user has to modify script if he
as another CPU than my SAM7X256.

How can I find out the CPU type in the Makefile so I can select the
right script?

Thanks and best regards
Ulrich
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Re: Need help on Makefiles

by Ethernut :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ulrich Prinz wrote:
> I did a quick integration of openocd into the Makefiles to use "make
> burn" with that tool and an openocd-usb dongle too.
>
> But my script is fixed to a CPU and the user has to modify script if he
> as another CPU than my SAM7X256.
>
> How can I find out the CPU type in the Makefile so I can select the
> right script?

No chance. By accident avrdude still supports the same symbolic names,
that are used by the compiler for the target CPU. Although this is not
documented. Thus, in most cases this works on the AVR platform out of
the box.

In general you need to edit Makeburn because of the interface and
possibly other options, like verify etc. You can also create your own
Makeburn files, the Configurator will detect them automatically.

Just in case: Do not overload the Configurator with items, that are not
Nut/OS specific. Creating an app tree or selecting Makeburn should be
viewed as temporary features. They are just there, because we have no
alternative and to get newbies up and running easily.

Harald




_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Re: Need help on Makefiles

by Thiago A. Corrêa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On Wed, Sep 9, 2009 at 5:33 AM, Harald Kipp<harald.kipp@...> wrote:

> Ulrich Prinz wrote:
>> I did a quick integration of openocd into the Makefiles to use "make
>> burn" with that tool and an openocd-usb dongle too.
>>
>> But my script is fixed to a CPU and the user has to modify script if he
>> as another CPU than my SAM7X256.
>>
>> How can I find out the CPU type in the Makefile so I can select the
>> right script?
>
> No chance. By accident avrdude still supports the same symbolic names,
> that are used by the compiler for the target CPU. Although this is not
> documented. Thus, in most cases this works on the AVR platform out of
> the box.
>

Well, you could always make some if's in the Makeburn to translate the
different names.

I assume you want to create a Makeburn.openocd right?
Then you could translate the MCU variable to some OPENOCD_MCU using ifs.

Kind Regards,
   Thiago A. Correa
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Re: Need help on Makefiles

by uprinz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

 >>> How can I find out the CPU type in the Makefile so I can select the
 >>> right script?
 >> No chance. By accident avrdude still supports the same symbolic names,
 >> that are used by the compiler for the target CPU. Although this is not
 >> documented. Thus, in most cases this works on the AVR platform out of
 >> the box.

Uh... I mean I feared the answer, but it came true :)

Is there really no -DDEFINE that is passed to the Makeburn system, that
allowes me to decied which CPU is selected? I have no problem with
writing a Makeburn that has lots of comparisions in it to call the right
script or to pass some direct calls to openocd.

Direct passing works fine, as you can see in the Makeburn. I fit in the
binary image file as -c "writeimage erase ...".

The only thing missing is the correct script or a decision for the flash
page detection. OpenOCD version 0.2.0 learned a lot, may be there are
some more mechanism to detect some parts automatically. SO the script
might be smaller than expected.

I only need the §%$&§&%§ CPU class (sam7x, sam7x...) or better type.
...
>
> I assume you want to create a Makeburn.openocd right?
> Then you could translate the MCU variable to some OPENOCD_MCU using ifs.
>
Äh... repeat please! There is a MCU variable?
By the way, I already created the Makeburn.arm-oocd and it works fine
with 0.1.0 and 0.2.0 version without modification. But it is nailed to
SAM7X256. I want to make it flexible as I have different CPUs and just
for the other users too.

Best regards, I am busy with finding that $(MCU) :)

Ulrich
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion